Skip to content

Commit

Permalink
Fix warnings when building node addon (#1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcague authored Mar 19, 2019
1 parent 86a4fd3 commit ab2dfcb
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
3 changes: 2 additions & 1 deletion erizoAPI/ExternalInput.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class AsyncDeleter : public Nan::AsyncWorker {
Local<Value> argv[] = {
Nan::New(msg.c_str()).ToLocalChecked()
};
callback->Call(1, argv);
Nan::AsyncResource resource("erizo::addon.externalInput.deleter");
callback->Call(1, argv, &resource);
}
}
private:
Expand Down
3 changes: 2 additions & 1 deletion erizoAPI/ExternalOutput.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class AsyncCloser : public Nan::AsyncWorker {
Local<Value> argv[] = {
Nan::New(msg.c_str()).ToLocalChecked()
};
callback->Call(1, argv);
Nan::AsyncResource resource("erizo::addon.externalOutput.closer");
callback->Call(1, argv, &resource);
}
}
private:
Expand Down
9 changes: 6 additions & 3 deletions erizoAPI/MediaStream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ void StatCallWorker::HandleOKCallback() {
Local<Value> argv[] = {
Nan::New<v8::String>(stat_).ToLocalChecked()
};
callback->Call(1, argv);
Nan::AsyncResource resource("erizo::addon.statCall");
callback->Call(1, argv, &resource);
}

void destroyAsyncHandle(uv_handle_t *handle) {
Expand Down Expand Up @@ -439,7 +440,8 @@ NAUV_WORK_CB(MediaStream::statsCallback) {
if (obj->has_stats_callback_) {
while (!obj->stats_messages.empty()) {
Local<Value> args[] = {Nan::New(obj->stats_messages.front().c_str()).ToLocalChecked()};
Nan::MakeCallback(Nan::GetCurrentContext()->Global(), obj->stats_callback_->GetFunction(), 1, args);
Nan::AsyncResource resource("erizo::addon.stream.statsCallback");
resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), obj->stats_callback_->GetFunction(), 1, args);
obj->stats_messages.pop();
}
}
Expand All @@ -457,7 +459,8 @@ NAUV_WORK_CB(MediaStream::eventCallback) {
while (!obj->event_messages.empty()) {
Local<Value> args[] = {Nan::New(obj->event_messages.front().first.c_str()).ToLocalChecked(),
Nan::New(obj->event_messages.front().second.c_str()).ToLocalChecked()};
Nan::MakeCallback(Nan::GetCurrentContext()->Global(), obj->event_callback_->GetFunction(), 2, args);
Nan::AsyncResource resource("erizo::addon.stream.eventCallback");
resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), obj->event_callback_->GetFunction(), 2, args);
obj->event_messages.pop();
}
}
Expand Down
4 changes: 2 additions & 2 deletions erizoAPI/OneToManyProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class AsyncDeleter : public Nan::AsyncWorker {
Local<Value> argv[] = {
Nan::New(msg.c_str()).ToLocalChecked()
};

callback->Call(1, argv);
Nan::AsyncResource resource("erizo::addon.oneToManyProcessor.deleter");
callback->Call(1, argv, &resource);
}
}
private:
Expand Down
4 changes: 2 additions & 2 deletions erizoAPI/OneToManyTranscoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class AsyncDeleter : public Nan::AsyncWorker {
Local<Value> argv[] = {
Nan::New(msg.c_str()).ToLocalChecked()
};

callback->Call(1, argv);
Nan::AsyncResource resource("erizo::addon.oneToManyTranscoder.deleter");
callback->Call(1, argv), &resource;
}
}
private:
Expand Down
3 changes: 2 additions & 1 deletion erizoAPI/SyntheticInput.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class AsyncDeleter : public Nan::AsyncWorker {
Local<Value> argv[] = {
Nan::New(msg.c_str()).ToLocalChecked()
};
callback->Call(1, argv);
Nan::AsyncResource resource("erizo::addon.SyntheticInput.deleter");
callback->Call(1, argv, &resource);
}
}
private:
Expand Down
3 changes: 2 additions & 1 deletion erizoAPI/WebRtcConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,8 @@ NAUV_WORK_CB(WebRtcConnection::eventsCallback) {
Local<Value> args[] = {Nan::New(obj->event_status.front()),
Nan::New(obj->event_messages.front().first.c_str()).ToLocalChecked(),
Nan::New(obj->event_messages.front().second.c_str()).ToLocalChecked()};
Nan::MakeCallback(Nan::GetCurrentContext()->Global(), obj->event_callback_->GetFunction(), 3, args);
Nan::AsyncResource resource("erizo::addon.connection.eventsCallback");
resource.runInAsyncScope(Nan::GetCurrentContext()->Global(), obj->event_callback_->GetFunction(), 3, args);
obj->event_messages.pop();
obj->event_status.pop();
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/installErizo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ install_erizo_api(){
cd $ROOT/erizoAPI
. $NVM_CHECK
nvm use
npm install nan@2.3.2
npm install nan@2.13.1
$FAST_BUILD ./build.sh
check_result $?
cd $CURRENT_DIR
Expand Down

0 comments on commit ab2dfcb

Please sign in to comment.