refactor: avoid deprecated v8::Context::GetIsolate() calls (pt 1) (#47760)

* refactor: avoid redundant GetIsolate() calls in NodeBindings::CreateEnvironment()

Xref: https://chromium-review.googlesource.com/c/v8/v8/+/6563615

* refactor: use v8::Isolate::GetCurrent() in Initialize() methods

* refactor: add v8::Isolate* arg to NodeBindings::CreateEnvironment()

* fixup! refactor: use v8::Isolate::GetCurrent() in Initialize() methods

* refactor: add v8::Isolate* arg to RendererClientBase::DidCreateScriptContext()

* fixup! refactor: add v8::Isolate* arg to NodeBindings::CreateEnvironment()

* fixup! fixup! refactor: use v8::Isolate::GetCurrent() in Initialize() methods

refactor: prefer JavascriptEnvironment::GetIsolate() in the browser layer
This commit is contained in:
Charles Kerr 2025-07-21 09:34:38 -05:00 committed by GitHub
commit 39cca586f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 136 additions and 110 deletions

View file

@ -108,6 +108,7 @@ void ElectronSandboxedRendererClient::RunScriptsAtDocumentEnd(
}
void ElectronSandboxedRendererClient::DidCreateScriptContext(
v8::Isolate* const isolate,
v8::Local<v8::Context> context,
content::RenderFrame* render_frame) {
// Only allow preload for the main frame or
@ -120,7 +121,6 @@ void ElectronSandboxedRendererClient::DidCreateScriptContext(
// Wrap the bundle into a function that receives the binding object as
// argument.
auto* isolate = context->GetIsolate();
auto binding = v8::Object::New(isolate);
InitializeBindings(binding, context, render_frame);