mirror of
https://github.com/electron/electron.git
synced 2026-01-10 07:58:08 -05:00
Add process.activateUvLoop() API.
This commit is contained in:
@@ -10,10 +10,20 @@
|
||||
|
||||
namespace atom {
|
||||
|
||||
namespace {
|
||||
|
||||
static uv_async_t dummy_uv_handle;
|
||||
|
||||
void UvNoOp(uv_async_t* handle, int status) {
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// Defined in atom_extensions.cc.
|
||||
node::node_module_struct* GetBuiltinModule(const char *name, bool is_browser);
|
||||
|
||||
AtomBindings::AtomBindings() {
|
||||
uv_async_init(uv_default_loop(), &dummy_uv_handle, UvNoOp);
|
||||
}
|
||||
|
||||
AtomBindings::~AtomBindings() {
|
||||
@@ -24,6 +34,7 @@ void AtomBindings::BindTo(v8::Handle<v8::Object> process) {
|
||||
|
||||
node::SetMethod(process, "atomBinding", Binding);
|
||||
node::SetMethod(process, "crash", Crash);
|
||||
node::SetMethod(process, "activateUvLoop", ActivateUVLoop);
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -79,4 +90,10 @@ v8::Handle<v8::Value> AtomBindings::Crash(const v8::Arguments& args) {
|
||||
return v8::Undefined();
|
||||
}
|
||||
|
||||
// static
|
||||
v8::Handle<v8::Value> AtomBindings::ActivateUVLoop(const v8::Arguments& args) {
|
||||
uv_async_send(&dummy_uv_handle);
|
||||
return v8::Undefined();
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
||||
@@ -22,6 +22,7 @@ class AtomBindings {
|
||||
private:
|
||||
static v8::Handle<v8::Value> Binding(const v8::Arguments& args);
|
||||
static v8::Handle<v8::Value> Crash(const v8::Arguments& args);
|
||||
static v8::Handle<v8::Value> ActivateUVLoop(const v8::Arguments& args);
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomBindings);
|
||||
};
|
||||
|
||||
2
vendor/node
vendored
2
vendor/node
vendored
Submodule vendor/node updated: 13b5a98d46...4b4c40a51d
Reference in New Issue
Block a user