diff --git a/shell/browser/api/electron_api_auto_updater.cc b/shell/browser/api/electron_api_auto_updater.cc index 2a1feaa9d837..4111342ec1f9 100644 --- a/shell/browser/api/electron_api_auto_updater.cc +++ b/shell/browser/api/electron_api_auto_updater.cc @@ -46,10 +46,6 @@ void AutoUpdater::OnError(const std::string& message) { gin::StringToV8(isolate, message), }; - gin_helper::MicrotasksScope microtasks_scope{ - wrapper->GetCreationContextChecked(), true, - v8::MicrotasksScope::kRunMicrotasks}; - node::MakeCallback(isolate, wrapper, "emit", args.size(), args.data(), {0, 0}); } diff --git a/shell/common/api/electron_bindings.cc b/shell/common/api/electron_bindings.cc index a2bc082ed0e0..dc8ba3709ed9 100644 --- a/shell/common/api/electron_bindings.cc +++ b/shell/common/api/electron_bindings.cc @@ -235,12 +235,11 @@ void ElectronBindings::DidReceiveMemoryDump( base::ProcessId target_pid, bool success, std::unique_ptr global_dump) { + DCHECK(electron::IsBrowserProcess()); v8::Isolate* isolate = promise.isolate(); v8::HandleScope handle_scope(isolate); v8::Local local_context = v8::Local::New(isolate, context); - gin_helper::MicrotasksScope microtasks_scope{ - local_context, true, v8::MicrotasksScope::kRunMicrotasks}; v8::Context::Scope context_scope(local_context); if (!success) { diff --git a/shell/renderer/api/electron_api_spell_check_client.cc b/shell/renderer/api/electron_api_spell_check_client.cc index 46b8a03163a6..58ac2da5e028 100644 --- a/shell/renderer/api/electron_api_spell_check_client.cc +++ b/shell/renderer/api/electron_api_spell_check_client.cc @@ -215,8 +215,8 @@ void SpellCheckClient::SpellCheckWords(const SpellCheckScope& scope, DCHECK(!scope.spell_check_.IsEmpty()); auto context = isolate_->GetCurrentContext(); - gin_helper::MicrotasksScope microtasks_scope{ - context, false, v8::MicrotasksScope::kDoNotRunMicrotasks}; + v8::MicrotasksScope microtasks_scope( + context, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local templ = gin_helper::CreateFunctionTemplate( isolate_, base::BindRepeating(&SpellCheckClient::OnSpellCheckDone, diff --git a/shell/renderer/electron_sandboxed_renderer_client.cc b/shell/renderer/electron_sandboxed_renderer_client.cc index 2c985c9a59c0..2f8511a3a70d 100644 --- a/shell/renderer/electron_sandboxed_renderer_client.cc +++ b/shell/renderer/electron_sandboxed_renderer_client.cc @@ -146,8 +146,8 @@ void ElectronSandboxedRendererClient::WillReleaseScriptContext( return; auto* isolate = context->GetIsolate(); - gin_helper::MicrotasksScope microtasks_scope{ - context, false, v8::MicrotasksScope::kDoNotRunMicrotasks}; + v8::MicrotasksScope microtasks_scope( + context, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::HandleScope handle_scope(isolate); v8::Context::Scope context_scope(context); InvokeEmitProcessEvent(context, "exit"); @@ -164,8 +164,8 @@ void ElectronSandboxedRendererClient::EmitProcessEvent( v8::HandleScope handle_scope{isolate}; v8::Local context = GetContext(frame, isolate); - gin_helper::MicrotasksScope microtasks_scope{ - context, false, v8::MicrotasksScope::kDoNotRunMicrotasks}; + v8::MicrotasksScope microtasks_scope( + context, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Context::Scope context_scope(context); InvokeEmitProcessEvent(context, event_name);