-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
44 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
#ifndef XPROFILER_SRC_COMMANDS_LISTENER_H | ||
#define XPROFILER_SRC_COMMANDS_LISTENER_H | ||
|
||
#include "nan.h" | ||
#include "environment_data.h" | ||
|
||
namespace xprofiler { | ||
using Nan::FunctionCallbackInfo; | ||
using v8::Value; | ||
|
||
// javascript-accessible | ||
void RunCommandsListener(const FunctionCallbackInfo<Value>& info); | ||
} // namespace xprofiler | ||
int StartCommandsListener(EnvironmentData* env_data); | ||
} | ||
|
||
#endif /* XPROFILER_SRC_COMMANDS_LISTENER_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "include/export_thread_listener.h" | ||
|
||
#include "commands/listener.h" | ||
#include "environment_data.h" | ||
|
||
namespace xprofiler { | ||
using Nan::False; | ||
using Nan::FunctionCallbackInfo; | ||
using Nan::ThrowTypeError; | ||
using Nan::True; | ||
using v8::Value; | ||
|
||
void RunCommandsListener(const FunctionCallbackInfo<Value>& info) { | ||
EnvironmentData* env_data = EnvironmentData::GetCurrent(info); | ||
int rc = StartCommandsListener(env_data); | ||
if (rc != 0) { | ||
ThrowTypeError("xprofiler: create uv commands listener thread failed!"); | ||
} | ||
info.GetReturnValue().Set(rc == 0 ? True() : False()); | ||
} | ||
} // namespace xprofiler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef XPROFILER_SRC_JSAPI_THREAD_LISTENER_H | ||
#define XPROFILER_SRC_JSAPI_THREAD_LISTENER_H | ||
|
||
#include "nan.h" | ||
|
||
namespace xprofiler { | ||
void RunCommandsListener(const Nan::FunctionCallbackInfo<v8::Value>& info); | ||
} | ||
|
||
#endif /* XPROFILER_SRC_JSAPI_THREAD_LISTENER_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters