@@ -122,12 +122,6 @@ base::FilePath GetResourcesPath(bool is_browser) {
122122 return resources_path;
123123}
124124
125- void RegisterBuiltinModules () {
126- #define V (modname ) _register_##modname();
127- ELECTRON_BUILTIN_MODULES (V)
128- #undef V
129- }
130-
131125} // namespace
132126
133127NodeBindings::NodeBindings (BrowserEnvironment browser_env)
@@ -161,6 +155,12 @@ NodeBindings::~NodeBindings() {
161155 stop_and_close_uv_loop (uv_loop_);
162156}
163157
158+ void NodeBindings::RegisterBuiltinModules () {
159+ #define V (modname ) _register_##modname();
160+ ELECTRON_BUILTIN_MODULES (V)
161+ #undef V
162+ }
163+
164164void NodeBindings::Initialize () {
165165 // Open node's error reporting system for browser process.
166166 node::g_standalone_mode = browser_env_ == BROWSER;
@@ -172,13 +172,13 @@ void NodeBindings::Initialize() {
172172 AtomCommandLine::InitializeFromCommandLine ();
173173#endif
174174
175+ // Explicitly register electron's builtin modules.
176+ RegisterBuiltinModules ();
177+
175178 // Init node.
176179 // (we assume node::Init would not modify the parameters under embedded mode).
177180 node::Init (nullptr , nullptr , nullptr , nullptr );
178181
179- // Explicitly register electron's builtin modules.
180- RegisterBuiltinModules ();
181-
182182#if defined(OS_WIN)
183183 // uv_init overrides error mode to suppress the default crash dialog, bring
184184 // it back if user wants to show it.
@@ -189,7 +189,8 @@ void NodeBindings::Initialize() {
189189}
190190
191191node::Environment* NodeBindings::CreateEnvironment (
192- v8::Handle<v8::Context> context) {
192+ v8::Handle<v8::Context> context,
193+ node::MultiIsolatePlatform* platform) {
193194 auto args = AtomCommandLine::argv ();
194195
195196 // Feed node the path to initialization script.
@@ -215,8 +216,8 @@ node::Environment* NodeBindings::CreateEnvironment(
215216
216217 std::unique_ptr<const char *[]> c_argv = StringVectorToArgArray (args);
217218 node::Environment* env = node::CreateEnvironment (
218- new node::IsolateData (context->GetIsolate (), uv_loop_), context ,
219- args.size (), c_argv.get (), 0 , nullptr );
219+ node::CreateIsolateData (context->GetIsolate (), uv_loop_, platform) ,
220+ context, args.size (), c_argv.get (), 0 , nullptr );
220221
221222 if (browser_env_ == BROWSER) {
222223 // SetAutorunMicrotasks is no longer called in node::CreateEnvironment
0 commit comments