diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index e6dcb4e5454c..7c1342359b2e 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -98,7 +98,7 @@ base::FilePath GetResourcesPath(bool is_browser) { NodeBindings::NodeBindings(BrowserEnvironment browser_env) : browser_env_(browser_env), - uv_loop_(uv_default_loop()), + uv_loop_(browser_env == WORKER ? uv_loop_new() : uv_default_loop()), embed_closed_(false), uv_env_(nullptr), weak_factory_(this) { @@ -169,7 +169,7 @@ node::Environment* NodeBindings::CreateEnvironment( std::unique_ptr c_argv = StringVectorToArgArray(args); node::Environment* env = node::CreateEnvironment( - new node::IsolateData(context->GetIsolate(), uv_default_loop()), context, + new node::IsolateData(context->GetIsolate(), uv_loop_), context, args.size(), c_argv.get(), 0, nullptr); if (browser_env_ == BROWSER) { diff --git a/atom/renderer/web_worker_observer.cc b/atom/renderer/web_worker_observer.cc index a6296f92d58d..65ca81c67750 100644 --- a/atom/renderer/web_worker_observer.cc +++ b/atom/renderer/web_worker_observer.cc @@ -40,7 +40,7 @@ WebWorkerObserver::~WebWorkerObserver() { void WebWorkerObserver::ContextCreated(v8::Local context) { v8::Context::Scope context_scope(context); - node_bindings_->Initialize(); + // Start the embed thread. node_bindings_->PrepareMessageLoop(); // Setup node environment for each window.