refactor: avoid deprecated v8::Context::GetIsolate()
calls (pt 1) (#47843)
* refactor: avoid redundant GetIsolate() calls in NodeBindings::CreateEnvironment() Xref: https://chromium-review.googlesource.com/c/v8/v8/+/6563615 Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: use v8::Isolate::GetCurrent() in Initialize() methods Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: add v8::Isolate* arg to NodeBindings::CreateEnvironment() Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! refactor: use v8::Isolate::GetCurrent() in Initialize() methods Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: add v8::Isolate* arg to RendererClientBase::DidCreateScriptContext() Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! refactor: add v8::Isolate* arg to NodeBindings::CreateEnvironment() Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! fixup! refactor: use v8::Isolate::GetCurrent() in Initialize() methods refactor: prefer JavascriptEnvironment::GetIsolate() in the browser layer Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
673ec5d39e
commit
d426b92326
61 changed files with 136 additions and 110 deletions
|
@ -27,7 +27,8 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||
gin_helper::Dictionary dict{isolate, exports};
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
dict.SetMethod("getCrashdumpSignalFD", &GetCrashdumpSignalFD);
|
||||
dict.SetMethod("getCrashpadHandlerPID", &GetCrashpadHandlerPID);
|
||||
|
|
|
@ -213,7 +213,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
auto* isolate = exports->GetIsolate();
|
||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||
|
||||
auto cons = Archive::CreateFunctionTemplate(isolate)
|
||||
->GetFunction(context)
|
||||
|
|
|
@ -294,7 +294,8 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||
gin_helper::Dictionary dict{isolate, exports};
|
||||
dict.SetMethod("availableFormats",
|
||||
&electron::api::Clipboard::AvailableFormats);
|
||||
dict.SetMethod("has", &electron::api::Clipboard::Has);
|
||||
|
|
|
@ -64,7 +64,8 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||
gin_helper::Dictionary dict{isolate, exports};
|
||||
dict.SetMethod("hasSwitch", &HasSwitch);
|
||||
dict.SetMethod("getSwitchValue", &GetSwitchValue);
|
||||
dict.SetMethod("appendSwitch", &AppendSwitch);
|
||||
|
|
|
@ -29,7 +29,8 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||
gin_helper::Dictionary dict{isolate, exports};
|
||||
dict.SetMethod("getVar", &GetVar);
|
||||
dict.SetMethod("hasVar", &HasVar);
|
||||
dict.SetMethod("setVar", &SetVar);
|
||||
|
|
|
@ -619,8 +619,8 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
v8::Isolate* isolate = context->GetIsolate();
|
||||
gin_helper::Dictionary dict(isolate, exports);
|
||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||
gin_helper::Dictionary dict{isolate, exports};
|
||||
auto native_image = gin_helper::Dictionary::CreateEmpty(isolate);
|
||||
dict.Set("nativeImage", native_image);
|
||||
|
||||
|
|
|
@ -80,9 +80,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
v8::Isolate* isolate = context->GetIsolate();
|
||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||
|
||||
gin_helper::Dictionary dict(isolate, exports);
|
||||
gin_helper::Dictionary dict{isolate, exports};
|
||||
dict.SetMethod("isOnline", &IsOnline);
|
||||
dict.SetMethod("isValidHeaderName", &IsValidHeaderName);
|
||||
dict.SetMethod("isValidHeaderValue", &IsValidHeaderValue);
|
||||
|
|
|
@ -173,7 +173,8 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||
gin_helper::Dictionary dict{isolate, exports};
|
||||
dict.SetMethod("showItemInFolder", &platform_util::ShowItemInFolder);
|
||||
dict.SetMethod("openPath", &OpenPath);
|
||||
dict.SetMethod("openExternal", &OpenExternal);
|
||||
|
|
|
@ -45,7 +45,8 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||
gin_helper::Dictionary dict{isolate, exports};
|
||||
dict.SetMethod("log", &Log);
|
||||
dict.SetMethod("getLoggingDestination", &GetLoggingDestination);
|
||||
}
|
||||
|
|
|
@ -99,7 +99,8 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||
gin_helper::Dictionary dict{isolate, exports};
|
||||
dict.SetMethod("getHiddenValue", &GetHiddenValue);
|
||||
dict.SetMethod("setHiddenValue", &SetHiddenValue);
|
||||
dict.SetMethod("getObjectHash", &GetObjectHash);
|
||||
|
|
|
@ -41,7 +41,8 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||
gin_helper::Dictionary dict{isolate, exports};
|
||||
dict.SetMethod("isBuiltinSpellCheckerEnabled", &IsBuiltinSpellCheckerEnabled);
|
||||
dict.SetMethod("isPDFViewerEnabled", &IsPDFViewerEnabled);
|
||||
dict.SetMethod("isFakeLocationProviderEnabled",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue