Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit6395898

Browse files
authored
refactor: use associatedv8::Context for event setup (electron#37355)
refactor: use associated v8::Context for event setup
1 parent32c60b2 commit6395898

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

‎shell/browser/electron_browser_main_parts.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ void ElectronBrowserMainParts::PostEarlyInitialization() {
270270

271271
v8::HandleScopescope(js_env_->isolate());
272272

273-
node_bindings_->Initialize();
273+
node_bindings_->Initialize(js_env_->isolate()->GetCurrentContext());
274274
// Create the global environment.
275275
node::Environment* env = node_bindings_->CreateEnvironment(
276276
js_env_->isolate()->GetCurrentContext(), js_env_->platform());

‎shell/common/node_bindings.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ void NodeBindings::SetNodeCliFlags() {
415415
}
416416
}
417417

418-
voidNodeBindings::Initialize() {
418+
voidNodeBindings::Initialize(v8::Local<v8::Context> context) {
419419
TRACE_EVENT0("electron","NodeBindings::Initialize");
420420
// Open node's error reporting system for browser process.
421421

@@ -463,8 +463,7 @@ void NodeBindings::Initialize() {
463463
SetErrorMode(GetErrorMode() & ~SEM_NOGPFAULTERRORBOX);
464464
#endif
465465

466-
v8::Isolate* isolate =v8::Isolate::GetCurrent();
467-
gin_helper::internal::Event::GetConstructor(isolate->GetCurrentContext());
466+
gin_helper::internal::Event::GetConstructor(context);
468467

469468
g_is_initialized =true;
470469
}

‎shell/common/node_bindings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class NodeBindings {
8585
virtual~NodeBindings();
8686

8787
// Setup V8, libuv.
88-
voidInitialize();
88+
voidInitialize(v8::Local<v8::Context> context);
8989

9090
voidSetNodeCliFlags();
9191

‎shell/renderer/electron_renderer_client.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void ElectronRendererClient::DidCreateScriptContext(
7676

7777
if (!node_integration_initialized_) {
7878
node_integration_initialized_ =true;
79-
node_bindings_->Initialize();
79+
node_bindings_->Initialize(renderer_context);
8080
node_bindings_->PrepareEmbedThread();
8181
}
8282

‎shell/services/node/node_service.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void NodeService::Initialize(node::mojom::NodeServiceParamsPtr params) {
4747

4848
v8::HandleScopescope(js_env_->isolate());
4949

50-
node_bindings_->Initialize();
50+
node_bindings_->Initialize(js_env_->isolate()->GetCurrentContext());
5151

5252
// Append program path for process.argv0
5353
auto program =base::CommandLine::ForCurrentProcess()->GetProgram();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp