fix: gin_helper::MicrotasksScope instantiation (#43185)

This commit is contained in:
Charles Kerr 2024-08-05 08:24:27 -05:00 committed by GitHub
parent e64302cc91
commit 6877671390
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 55 additions and 44 deletions

View file

@ -221,9 +221,9 @@ void SpellCheckClient::SpellCheckWords(const SpellCheckScope& scope,
DCHECK(!scope.spell_check_.IsEmpty());
auto context = isolate_->GetCurrentContext();
gin_helper::MicrotasksScope microtasks_scope(
isolate_, context->GetMicrotaskQueue(),
v8::MicrotasksScope::kDoNotRunMicrotasks);
gin_helper::MicrotasksScope microtasks_scope{
isolate_, context->GetMicrotaskQueue(), false,
v8::MicrotasksScope::kDoNotRunMicrotasks};
v8::Local<v8::FunctionTemplate> templ = gin_helper::CreateFunctionTemplate(
isolate_, base::BindRepeating(&SpellCheckClient::OnSpellCheckDone,

View file

@ -204,9 +204,9 @@ void ElectronSandboxedRendererClient::WillReleaseScriptContext(
return;
auto* isolate = context->GetIsolate();
gin_helper::MicrotasksScope microtasks_scope(
isolate, context->GetMicrotaskQueue(),
v8::MicrotasksScope::kDoNotRunMicrotasks);
gin_helper::MicrotasksScope microtasks_scope{
isolate, context->GetMicrotaskQueue(), false,
v8::MicrotasksScope::kDoNotRunMicrotasks};
v8::HandleScope handle_scope(isolate);
v8::Context::Scope context_scope(context);
InvokeEmitProcessEvent(context, "exit");
@ -223,9 +223,9 @@ void ElectronSandboxedRendererClient::EmitProcessEvent(
v8::HandleScope handle_scope{isolate};
v8::Local<v8::Context> context = GetContext(frame, isolate);
gin_helper::MicrotasksScope microtasks_scope(
isolate, context->GetMicrotaskQueue(),
v8::MicrotasksScope::kDoNotRunMicrotasks);
gin_helper::MicrotasksScope microtasks_scope{
isolate, context->GetMicrotaskQueue(), false,
v8::MicrotasksScope::kDoNotRunMicrotasks};
v8::Context::Scope context_scope(context);
InvokeEmitProcessEvent(context, event_name);