Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! trace_events: move SetupTraceCategoryState into node_trace_eve…
…nts.cc
  • Loading branch information
joyeecheung committed Dec 19, 2018
commit a7005a8483fd209b0be0bde5e026d551b3d0bc8d
4 changes: 2 additions & 2 deletions lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ function readAndExecuteStdin() {
function setupTraceCategoryState() {
const {
traceCategoryState,
setupTraceCategoryState
setTraceCategoryStateUpdateHandler
} = internalBinding('trace_events');
const kCategoryAsyncHooks = 0;
let traceEventsAsyncHook;
Expand All @@ -408,7 +408,7 @@ function setupTraceCategoryState() {
}

toggleTraceCategoryState();
setupTraceCategoryState(toggleTraceCategoryState);
setTraceCategoryStateUpdateHandler(toggleTraceCategoryState);
}

function setupProcessObject() {
Expand Down
7 changes: 5 additions & 2 deletions src/node_trace_events.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ void GetEnabledCategories(const FunctionCallbackInfo<Value>& args) {
}
}

static void SetupTraceCategoryState(const FunctionCallbackInfo<Value>& args) {
static void SetTraceCategoryStateUpdateHandler(
const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
CHECK(args[0]->IsFunction());
env->set_trace_category_state_function(args[0].As<Function>());
Expand All @@ -116,7 +117,9 @@ void NodeCategorySet::Initialize(Local<Object> target,
Environment* env = Environment::GetCurrent(context);

env->SetMethod(target, "getEnabledCategories", GetEnabledCategories);
env->SetMethod(target, "setupTraceCategoryState", SetupTraceCategoryState);
env->SetMethod(
target, "setTraceCategoryStateUpdateHandler",
SetTraceCategoryStateUpdateHandler);

Local<FunctionTemplate> category_set =
env->NewFunctionTemplate(NodeCategorySet::New);
Expand Down