Get rid of the global_env
This commit is contained in:
parent
e5886dda9b
commit
e401335ebb
4 changed files with 13 additions and 20 deletions
|
@ -106,8 +106,6 @@ base::FilePath GetResourcesPath(bool is_browser) {
|
|||
|
||||
} // namespace
|
||||
|
||||
node::Environment* global_env = nullptr;
|
||||
|
||||
NodeBindings::NodeBindings(bool is_browser)
|
||||
: is_browser_(is_browser),
|
||||
message_loop_(nullptr),
|
||||
|
@ -214,10 +212,8 @@ void NodeBindings::RunMessageLoop() {
|
|||
void NodeBindings::UvRunOnce() {
|
||||
DCHECK(!is_browser_ || BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
|
||||
// By default the global env would be used unless user specified another one
|
||||
// (this happens for renderer process, which wraps the uv loop with web page
|
||||
// context).
|
||||
node::Environment* env = uv_env() ? uv_env() : global_env;
|
||||
node::Environment* env = uv_env();
|
||||
CHECK(env);
|
||||
|
||||
// Use Locker in browser process.
|
||||
mate::Locker locker(env->isolate());
|
||||
|
|
|
@ -28,11 +28,4 @@
|
|||
#include "vendor/node/src/node_buffer.h"
|
||||
#include "vendor/node/src/node_internals.h"
|
||||
|
||||
namespace atom {
|
||||
// Defined in node_bindings.cc.
|
||||
// For renderer it's created in atom_renderer_client.cc.
|
||||
// For browser it's created in atom_browser_main_parts.cc.
|
||||
extern node::Environment* global_env;
|
||||
}
|
||||
|
||||
#endif // ATOM_COMMON_NODE_INCLUDES_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue