refactor: only pass v8::Context
to gin_helper::MicrotasksScope
constructor (#45484)
refactor: forward v8::Context to v8::MicrotasksScope constructor
This commit is contained in:
parent
326957009a
commit
517935cd55
14 changed files with 23 additions and 37 deletions
|
@ -81,8 +81,7 @@ void ElectronRenderFrameObserver::DidClearWindowObject() {
|
|||
v8::HandleScope handle_scope{isolate};
|
||||
v8::Local<v8::Context> context = web_frame->MainWorldScriptContext();
|
||||
v8::MicrotasksScope microtasks_scope(
|
||||
isolate, context->GetMicrotaskQueue(),
|
||||
v8::MicrotasksScope::kDoNotRunMicrotasks);
|
||||
context, v8::MicrotasksScope::kDoNotRunMicrotasks);
|
||||
v8::Context::Scope context_scope(context);
|
||||
// DidClearWindowObject only emits for the main world.
|
||||
DidInstallConditionalFeatures(context, MAIN_WORLD_ID);
|
||||
|
@ -123,10 +122,8 @@ void ElectronRenderFrameObserver::DidInstallConditionalFeatures(
|
|||
}
|
||||
has_delayed_node_initialization_ = false;
|
||||
|
||||
auto* isolate = context->GetIsolate();
|
||||
v8::MicrotasksScope microtasks_scope(
|
||||
isolate, context->GetMicrotaskQueue(),
|
||||
v8::MicrotasksScope::kDoNotRunMicrotasks);
|
||||
context, v8::MicrotasksScope::kDoNotRunMicrotasks);
|
||||
|
||||
if (ShouldNotifyClient(world_id))
|
||||
renderer_client_->DidCreateScriptContext(context, render_frame_);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue