MCPcopy Create free account
hub / github.com/nodejs/nan / HandleProgressCallback

Method HandleProgressCallback

test/cpp/asyncprogressworkerstream.cpp:49–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 }
48
49 void HandleProgressCallback(const T *data, size_t count) {
50 HandleScope scope;
51 v8::Local<v8::Object> obj = Nan::New<v8::Object>();
52 Nan::Set(
53 obj,
54 Nan::New("index").ToLocalChecked(),
55 New<v8::Integer>(data->index));
56 Nan::Set(
57 obj,
58 Nan::New("data").ToLocalChecked(),
59 New<v8::Integer>(data->data));
60
61 v8::Local<v8::Value> argv[] = { obj };
62 progress->Call(1, argv, this->async_resource);
63 }
64
65 private:
66 Callback *progress;

Callers

nothing calls this directly

Calls 4

ToLocalCheckedMethod · 0.80
CallMethod · 0.80
SetFunction · 0.50
NewFunction · 0.50

Tested by

no test coverage detected