refactor: prefer GetCreationContextChecked(v8::Isolate*) over GetCreationContextChecked() (#47878)

* refactor: pass an isolate when calling GetCreationContextChecked() in V8FunctionInvoker

* refactor: pass an isolate when calling GetCreationContextChecked() in RendererClientBase

* refactor: pass an isolate when calling GetCreationContextChecked() in ScriptExecutionCallback::Completed()

* refactor: pass an isolate when calling GetCreationContextChecked() in ScriptExecutionCallback::CopyResultToCallingContextAndFinalize()

* refactor: pass an isolate when calling GetCreationContextChecked() in electron::GetRenderFrame()

* refactor: pass an isolate when calling GetCreationContextChecked() in gin_helper::internal::CallMethodWithArgs()

* refactor: pass an isolate when calling GetCreationContextChecked() in OverrideGlobalPropertyFromIsolatedWorld()

* refactor: pass an isolate when calling GetCreationContextChecked() in OverrideGlobalValueFromIsolatedWorld()

* refactor: pass an isolate when calling GetCreationContextChecked() in ProxyFunctionWrapper()

* refactor: pass an isolate when calling GetCreationContextChecked() in PassValueToOtherContextInner()

* fixup! refactor: pass an isolate when calling GetCreationContextChecked() in electron::GetRenderFrame()
This commit is contained in:
Charles Kerr 2025-07-25 09:06:57 -05:00 committed by GitHub
commit 084c6ef549
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 44 additions and 35 deletions

View file

@ -102,7 +102,8 @@
namespace electron {
content::RenderFrame* GetRenderFrame(v8::Local<v8::Object> value);
content::RenderFrame* GetRenderFrame(v8::Isolate* const isolate,
v8::Local<v8::Object> value);
namespace {
@ -613,16 +614,16 @@ void RendererClientBase::AllowGuestViewElementDefinition(
v8::Local<v8::Object> context,
v8::Local<v8::Function> register_cb) {
v8::HandleScope handle_scope(isolate);
v8::Context::Scope context_scope(context->GetCreationContextChecked());
v8::Context::Scope context_scope(context->GetCreationContextChecked(isolate));
blink::WebCustomElement::EmbedderNamesAllowedScope embedder_names_scope;
content::RenderFrame* render_frame = GetRenderFrame(context);
content::RenderFrame* render_frame = GetRenderFrame(isolate, context);
if (!render_frame)
return;
render_frame->GetWebFrame()->RequestExecuteV8Function(
context->GetCreationContextChecked(), register_cb, v8::Null(isolate), 0,
nullptr, base::NullCallback());
context->GetCreationContextChecked(isolate), register_cb,
v8::Null(isolate), 0, nullptr, base::NullCallback());
}
} // namespace electron