refactor: prefer GetCreationContextChecked(v8::Isolate*)
over GetCreationContextChecked()
(#47890)
* refactor: pass an isolate when calling GetCreationContextChecked() in V8FunctionInvoker Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: pass an isolate when calling GetCreationContextChecked() in RendererClientBase Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: pass an isolate when calling GetCreationContextChecked() in ScriptExecutionCallback::Completed() Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: pass an isolate when calling GetCreationContextChecked() in ScriptExecutionCallback::CopyResultToCallingContextAndFinalize() Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: pass an isolate when calling GetCreationContextChecked() in electron::GetRenderFrame() Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: pass an isolate when calling GetCreationContextChecked() in gin_helper::internal::CallMethodWithArgs() Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: pass an isolate when calling GetCreationContextChecked() in OverrideGlobalPropertyFromIsolatedWorld() Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: pass an isolate when calling GetCreationContextChecked() in OverrideGlobalValueFromIsolatedWorld() Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: pass an isolate when calling GetCreationContextChecked() in ProxyFunctionWrapper() Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: pass an isolate when calling GetCreationContextChecked() in PassValueToOtherContextInner() Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! refactor: pass an isolate when calling GetCreationContextChecked() in electron::GetRenderFrame() 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
e1e12318e2
commit
3fefa06d34
5 changed files with 44 additions and 35 deletions
|
@ -49,7 +49,7 @@ struct V8FunctionInvoker<v8::Local<v8::Value>(ArgTypes...)> {
|
||||||
if (!function.IsAlive())
|
if (!function.IsAlive())
|
||||||
return v8::Null(isolate);
|
return v8::Null(isolate);
|
||||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||||
v8::Local<v8::Context> context = holder->GetCreationContextChecked();
|
v8::Local<v8::Context> context = holder->GetCreationContextChecked(isolate);
|
||||||
v8::MicrotasksScope microtasks_scope(context,
|
v8::MicrotasksScope microtasks_scope(context,
|
||||||
v8::MicrotasksScope::kRunMicrotasks);
|
v8::MicrotasksScope::kRunMicrotasks);
|
||||||
v8::Context::Scope context_scope(context);
|
v8::Context::Scope context_scope(context);
|
||||||
|
@ -74,7 +74,7 @@ struct V8FunctionInvoker<void(ArgTypes...)> {
|
||||||
if (!function.IsAlive())
|
if (!function.IsAlive())
|
||||||
return;
|
return;
|
||||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||||
v8::Local<v8::Context> context = holder->GetCreationContextChecked();
|
v8::Local<v8::Context> context = holder->GetCreationContextChecked(isolate);
|
||||||
v8::MicrotasksScope microtasks_scope(context,
|
v8::MicrotasksScope microtasks_scope(context,
|
||||||
v8::MicrotasksScope::kRunMicrotasks);
|
v8::MicrotasksScope::kRunMicrotasks);
|
||||||
v8::Context::Scope context_scope(context);
|
v8::Context::Scope context_scope(context);
|
||||||
|
@ -98,7 +98,7 @@ struct V8FunctionInvoker<ReturnType(ArgTypes...)> {
|
||||||
if (!function.IsAlive())
|
if (!function.IsAlive())
|
||||||
return ret;
|
return ret;
|
||||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||||
v8::Local<v8::Context> context = holder->GetCreationContextChecked();
|
v8::Local<v8::Context> context = holder->GetCreationContextChecked(isolate);
|
||||||
v8::MicrotasksScope microtasks_scope(context,
|
v8::MicrotasksScope microtasks_scope(context,
|
||||||
v8::MicrotasksScope::kRunMicrotasks);
|
v8::MicrotasksScope::kRunMicrotasks);
|
||||||
v8::Context::Scope context_scope(context);
|
v8::Context::Scope context_scope(context);
|
||||||
|
|
|
@ -23,7 +23,7 @@ v8::Local<v8::Value> CallMethodWithArgs(
|
||||||
node::async_context{0, 0}};
|
node::async_context{0, 0}};
|
||||||
|
|
||||||
// Perform microtask checkpoint after running JavaScript.
|
// Perform microtask checkpoint after running JavaScript.
|
||||||
v8::MicrotasksScope microtasks_scope(obj->GetCreationContextChecked(),
|
v8::MicrotasksScope microtasks_scope(obj->GetCreationContextChecked(isolate),
|
||||||
v8::MicrotasksScope::kRunMicrotasks);
|
v8::MicrotasksScope::kRunMicrotasks);
|
||||||
|
|
||||||
// node::MakeCallback will also run pending tasks in Node.js.
|
// node::MakeCallback will also run pending tasks in Node.js.
|
||||||
|
|
|
@ -38,7 +38,8 @@ BASE_FEATURE(kContextBridgeMutability,
|
||||||
|
|
||||||
namespace electron {
|
namespace electron {
|
||||||
|
|
||||||
content::RenderFrame* GetRenderFrame(v8::Local<v8::Object> value);
|
content::RenderFrame* GetRenderFrame(v8::Isolate* const isolate,
|
||||||
|
v8::Local<v8::Object> value);
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
|
@ -157,13 +158,15 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContextInner(
|
||||||
bool support_dynamic_properties,
|
bool support_dynamic_properties,
|
||||||
int recursion_depth,
|
int recursion_depth,
|
||||||
BridgeErrorTarget error_target) {
|
BridgeErrorTarget error_target) {
|
||||||
|
v8::Isolate* const source_isolate = source_context->GetIsolate();
|
||||||
|
|
||||||
TRACE_EVENT0("electron", "ContextBridge::PassValueToOtherContextInner");
|
TRACE_EVENT0("electron", "ContextBridge::PassValueToOtherContextInner");
|
||||||
if (recursion_depth >= kMaxRecursion) {
|
if (recursion_depth >= kMaxRecursion) {
|
||||||
v8::Context::Scope error_scope(error_target == BridgeErrorTarget::kSource
|
v8::Context::Scope error_scope(error_target == BridgeErrorTarget::kSource
|
||||||
? source_context
|
? source_context
|
||||||
: destination_context);
|
: destination_context);
|
||||||
source_context->GetIsolate()->ThrowException(v8::Exception::TypeError(
|
source_isolate->ThrowException(v8::Exception::TypeError(
|
||||||
gin::StringToV8(source_context->GetIsolate(),
|
gin::StringToV8(source_isolate,
|
||||||
"Electron contextBridge recursion depth exceeded. "
|
"Electron contextBridge recursion depth exceeded. "
|
||||||
"Nested objects "
|
"Nested objects "
|
||||||
"deeper than 1000 are not supported.")));
|
"deeper than 1000 are not supported.")));
|
||||||
|
@ -205,8 +208,8 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContextInner(
|
||||||
// creation context of the original method. If it's not we proceed
|
// creation context of the original method. If it's not we proceed
|
||||||
// with the proxy logic
|
// with the proxy logic
|
||||||
if (maybe_original_fn.ToLocal(&proxy_func) && proxy_func->IsFunction() &&
|
if (maybe_original_fn.ToLocal(&proxy_func) && proxy_func->IsFunction() &&
|
||||||
proxy_func.As<v8::Object>()->GetCreationContextChecked() ==
|
proxy_func.As<v8::Object>()->GetCreationContextChecked(
|
||||||
destination_context) {
|
source_isolate) == destination_context) {
|
||||||
return v8::MaybeLocal<v8::Value>(proxy_func);
|
return v8::MaybeLocal<v8::Value>(proxy_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,8 +246,8 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContextInner(
|
||||||
v8::Local<v8::Promise> proxied_promise_handle =
|
v8::Local<v8::Promise> proxied_promise_handle =
|
||||||
proxied_promise->GetHandle();
|
proxied_promise->GetHandle();
|
||||||
|
|
||||||
v8::Global<v8::Context> global_then_source_context(
|
v8::Global<v8::Context> global_then_source_context(source_isolate,
|
||||||
source_context->GetIsolate(), source_context);
|
source_context);
|
||||||
v8::Global<v8::Context> global_then_destination_context(
|
v8::Global<v8::Context> global_then_destination_context(
|
||||||
destination_context->GetIsolate(), destination_context);
|
destination_context->GetIsolate(), destination_context);
|
||||||
global_then_source_context.SetWeak();
|
global_then_source_context.SetWeak();
|
||||||
|
@ -290,8 +293,8 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContextInner(
|
||||||
std::move(global_then_source_context),
|
std::move(global_then_source_context),
|
||||||
std::move(global_then_destination_context));
|
std::move(global_then_destination_context));
|
||||||
|
|
||||||
v8::Global<v8::Context> global_catch_source_context(
|
v8::Global<v8::Context> global_catch_source_context(source_isolate,
|
||||||
source_context->GetIsolate(), source_context);
|
source_context);
|
||||||
v8::Global<v8::Context> global_catch_destination_context(
|
v8::Global<v8::Context> global_catch_destination_context(
|
||||||
destination_context->GetIsolate(), destination_context);
|
destination_context->GetIsolate(), destination_context);
|
||||||
global_catch_source_context.SetWeak();
|
global_catch_source_context.SetWeak();
|
||||||
|
@ -356,8 +359,7 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContextInner(
|
||||||
// crosses the bridge we fallback to the v8::Message approach if we can't
|
// crosses the bridge we fallback to the v8::Message approach if we can't
|
||||||
// pull "message" for some reason
|
// pull "message" for some reason
|
||||||
v8::MaybeLocal<v8::Value> maybe_message = value.As<v8::Object>()->Get(
|
v8::MaybeLocal<v8::Value> maybe_message = value.As<v8::Object>()->Get(
|
||||||
source_context,
|
source_context, gin::ConvertToV8(source_isolate, "message"));
|
||||||
gin::ConvertToV8(source_context->GetIsolate(), "message"));
|
|
||||||
v8::Local<v8::Value> message;
|
v8::Local<v8::Value> message;
|
||||||
if (maybe_message.ToLocal(&message) && message->IsString()) {
|
if (maybe_message.ToLocal(&message) && message->IsString()) {
|
||||||
return v8::MaybeLocal<v8::Value>(
|
return v8::MaybeLocal<v8::Value>(
|
||||||
|
@ -496,7 +498,7 @@ void ProxyFunctionWrapper(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
||||||
|
|
||||||
v8::Local<v8::Function> func = func_value.As<v8::Function>();
|
v8::Local<v8::Function> func = func_value.As<v8::Function>();
|
||||||
v8::Local<v8::Context> func_owning_context =
|
v8::Local<v8::Context> func_owning_context =
|
||||||
func->GetCreationContextChecked();
|
func->GetCreationContextChecked(args.isolate());
|
||||||
|
|
||||||
{
|
{
|
||||||
v8::Context::Scope func_owning_context_scope(func_owning_context);
|
v8::Context::Scope func_owning_context_scope(func_owning_context);
|
||||||
|
@ -760,7 +762,7 @@ v8::MaybeLocal<v8::Context> GetTargetContext(v8::Isolate* isolate,
|
||||||
blink::ExecutionContext* execution_context =
|
blink::ExecutionContext* execution_context =
|
||||||
blink::ExecutionContext::From(source_context);
|
blink::ExecutionContext::From(source_context);
|
||||||
if (execution_context->IsWindow()) {
|
if (execution_context->IsWindow()) {
|
||||||
auto* render_frame = GetRenderFrame(source_context->Global());
|
auto* render_frame = GetRenderFrame(isolate, source_context->Global());
|
||||||
CHECK(render_frame);
|
CHECK(render_frame);
|
||||||
auto* frame = render_frame->GetWebFrame();
|
auto* frame = render_frame->GetWebFrame();
|
||||||
CHECK(frame);
|
CHECK(frame);
|
||||||
|
@ -812,13 +814,14 @@ gin_helper::Dictionary TraceKeyPath(const gin_helper::Dictionary& start,
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverrideGlobalValueFromIsolatedWorld(
|
void OverrideGlobalValueFromIsolatedWorld(
|
||||||
|
v8::Isolate* isolate,
|
||||||
const std::vector<std::string>& key_path,
|
const std::vector<std::string>& key_path,
|
||||||
v8::Local<v8::Object> value,
|
v8::Local<v8::Object> value,
|
||||||
bool support_dynamic_properties) {
|
bool support_dynamic_properties) {
|
||||||
if (key_path.empty())
|
if (key_path.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto* render_frame = GetRenderFrame(value);
|
auto* render_frame = GetRenderFrame(isolate, value);
|
||||||
CHECK(render_frame);
|
CHECK(render_frame);
|
||||||
auto* frame = render_frame->GetWebFrame();
|
auto* frame = render_frame->GetWebFrame();
|
||||||
CHECK(frame);
|
CHECK(frame);
|
||||||
|
@ -831,7 +834,8 @@ void OverrideGlobalValueFromIsolatedWorld(
|
||||||
|
|
||||||
{
|
{
|
||||||
v8::Context::Scope main_context_scope(main_context);
|
v8::Context::Scope main_context_scope(main_context);
|
||||||
v8::Local<v8::Context> source_context = value->GetCreationContextChecked();
|
v8::Local<v8::Context> source_context =
|
||||||
|
value->GetCreationContextChecked(isolate);
|
||||||
v8::MaybeLocal<v8::Value> maybe_proxy = PassValueToOtherContext(
|
v8::MaybeLocal<v8::Value> maybe_proxy = PassValueToOtherContext(
|
||||||
source_context, main_context, value, source_context->Global(),
|
source_context, main_context, value, source_context->Global(),
|
||||||
support_dynamic_properties, BridgeErrorTarget::kSource);
|
support_dynamic_properties, BridgeErrorTarget::kSource);
|
||||||
|
@ -843,6 +847,7 @@ void OverrideGlobalValueFromIsolatedWorld(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OverrideGlobalPropertyFromIsolatedWorld(
|
bool OverrideGlobalPropertyFromIsolatedWorld(
|
||||||
|
v8::Isolate* const isolate,
|
||||||
const std::vector<std::string>& key_path,
|
const std::vector<std::string>& key_path,
|
||||||
v8::Local<v8::Object> getter,
|
v8::Local<v8::Object> getter,
|
||||||
v8::Local<v8::Value> setter,
|
v8::Local<v8::Value> setter,
|
||||||
|
@ -850,7 +855,7 @@ bool OverrideGlobalPropertyFromIsolatedWorld(
|
||||||
if (key_path.empty())
|
if (key_path.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
auto* render_frame = GetRenderFrame(getter);
|
auto* render_frame = GetRenderFrame(isolate, getter);
|
||||||
CHECK(render_frame);
|
CHECK(render_frame);
|
||||||
auto* frame = render_frame->GetWebFrame();
|
auto* frame = render_frame->GetWebFrame();
|
||||||
CHECK(frame);
|
CHECK(frame);
|
||||||
|
@ -869,7 +874,7 @@ bool OverrideGlobalPropertyFromIsolatedWorld(
|
||||||
v8::Local<v8::Value> setter_proxy;
|
v8::Local<v8::Value> setter_proxy;
|
||||||
if (!getter->IsNullOrUndefined()) {
|
if (!getter->IsNullOrUndefined()) {
|
||||||
v8::Local<v8::Context> source_context =
|
v8::Local<v8::Context> source_context =
|
||||||
getter->GetCreationContextChecked();
|
getter->GetCreationContextChecked(isolate);
|
||||||
v8::MaybeLocal<v8::Value> maybe_getter_proxy = PassValueToOtherContext(
|
v8::MaybeLocal<v8::Value> maybe_getter_proxy = PassValueToOtherContext(
|
||||||
source_context, main_context, getter, source_context->Global(), false,
|
source_context, main_context, getter, source_context->Global(), false,
|
||||||
BridgeErrorTarget::kSource);
|
BridgeErrorTarget::kSource);
|
||||||
|
@ -878,7 +883,7 @@ bool OverrideGlobalPropertyFromIsolatedWorld(
|
||||||
}
|
}
|
||||||
if (!setter->IsNullOrUndefined() && setter->IsObject()) {
|
if (!setter->IsNullOrUndefined() && setter->IsObject()) {
|
||||||
v8::Local<v8::Context> source_context =
|
v8::Local<v8::Context> source_context =
|
||||||
getter->GetCreationContextChecked();
|
getter->GetCreationContextChecked(isolate);
|
||||||
v8::MaybeLocal<v8::Value> maybe_setter_proxy = PassValueToOtherContext(
|
v8::MaybeLocal<v8::Value> maybe_setter_proxy = PassValueToOtherContext(
|
||||||
source_context, main_context, setter, source_context->Global(), false,
|
source_context, main_context, setter, source_context->Global(), false,
|
||||||
BridgeErrorTarget::kSource);
|
BridgeErrorTarget::kSource);
|
||||||
|
|
|
@ -90,8 +90,9 @@ struct Converter<blink::WebCssOrigin> {
|
||||||
|
|
||||||
namespace electron {
|
namespace electron {
|
||||||
|
|
||||||
content::RenderFrame* GetRenderFrame(v8::Local<v8::Object> value) {
|
content::RenderFrame* GetRenderFrame(v8::Isolate* const isolate,
|
||||||
v8::Local<v8::Context> context = value->GetCreationContextChecked();
|
v8::Local<v8::Object> value) {
|
||||||
|
v8::Local<v8::Context> context = value->GetCreationContextChecked(isolate);
|
||||||
if (context.IsEmpty())
|
if (context.IsEmpty())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
blink::WebLocalFrame* frame = blink::WebLocalFrame::FrameForContext(context);
|
blink::WebLocalFrame* frame = blink::WebLocalFrame::FrameForContext(context);
|
||||||
|
@ -146,7 +147,7 @@ class ScriptExecutionCallback {
|
||||||
ScriptExecutionCallback& operator=(const ScriptExecutionCallback&) = delete;
|
ScriptExecutionCallback& operator=(const ScriptExecutionCallback&) = delete;
|
||||||
|
|
||||||
void CopyResultToCallingContextAndFinalize(
|
void CopyResultToCallingContextAndFinalize(
|
||||||
v8::Isolate* isolate,
|
v8::Isolate* const isolate,
|
||||||
const v8::Local<v8::Object>& result) {
|
const v8::Local<v8::Object>& result) {
|
||||||
v8::MaybeLocal<v8::Value> maybe_result;
|
v8::MaybeLocal<v8::Value> maybe_result;
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
@ -155,7 +156,7 @@ class ScriptExecutionCallback {
|
||||||
{
|
{
|
||||||
v8::TryCatch try_catch(isolate);
|
v8::TryCatch try_catch(isolate);
|
||||||
v8::Local<v8::Context> source_context =
|
v8::Local<v8::Context> source_context =
|
||||||
result->GetCreationContextChecked();
|
result->GetCreationContextChecked(isolate);
|
||||||
maybe_result = PassValueToOtherContext(
|
maybe_result = PassValueToOtherContext(
|
||||||
source_context, promise_.GetContext(), result,
|
source_context, promise_.GetContext(), result,
|
||||||
source_context->Global(), false, BridgeErrorTarget::kSource);
|
source_context->Global(), false, BridgeErrorTarget::kSource);
|
||||||
|
@ -201,7 +202,7 @@ class ScriptExecutionCallback {
|
||||||
bool should_clone_value =
|
bool should_clone_value =
|
||||||
!(value->IsObject() &&
|
!(value->IsObject() &&
|
||||||
promise_.GetContext() ==
|
promise_.GetContext() ==
|
||||||
value.As<v8::Object>()->GetCreationContextChecked()) &&
|
value.As<v8::Object>()->GetCreationContextChecked(isolate)) &&
|
||||||
value->IsObject();
|
value->IsObject();
|
||||||
if (should_clone_value) {
|
if (should_clone_value) {
|
||||||
CopyResultToCallingContextAndFinalize(isolate,
|
CopyResultToCallingContextAndFinalize(isolate,
|
||||||
|
@ -839,7 +840,8 @@ class WebFrameRenderer final
|
||||||
// Get the WebLocalFrame before (possibly) executing any user-space JS while
|
// Get the WebLocalFrame before (possibly) executing any user-space JS while
|
||||||
// getting the |params|. We track the status of the RenderFrame via an
|
// getting the |params|. We track the status of the RenderFrame via an
|
||||||
// observer in case it is deleted during user code execution.
|
// observer in case it is deleted during user code execution.
|
||||||
content::RenderFrame* render_frame = GetRenderFrame(content_window);
|
content::RenderFrame* render_frame =
|
||||||
|
GetRenderFrame(isolate, content_window);
|
||||||
if (!render_frame)
|
if (!render_frame)
|
||||||
return v8::Null(isolate);
|
return v8::Null(isolate);
|
||||||
|
|
||||||
|
@ -965,8 +967,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||||
|
|
||||||
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
v8::Isolate* const isolate = v8::Isolate::GetCurrent();
|
||||||
gin_helper::Dictionary dict{isolate, exports};
|
gin_helper::Dictionary dict{isolate, exports};
|
||||||
dict.Set("mainFrame", WebFrameRenderer::Create(
|
dict.Set("mainFrame",
|
||||||
isolate, electron::GetRenderFrame(exports)));
|
WebFrameRenderer::Create(
|
||||||
|
isolate, electron::GetRenderFrame(isolate, exports)));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -102,7 +102,8 @@
|
||||||
|
|
||||||
namespace electron {
|
namespace electron {
|
||||||
|
|
||||||
content::RenderFrame* GetRenderFrame(v8::Local<v8::Object> value);
|
content::RenderFrame* GetRenderFrame(v8::Isolate* const isolate,
|
||||||
|
v8::Local<v8::Object> value);
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -613,16 +614,16 @@ void RendererClientBase::AllowGuestViewElementDefinition(
|
||||||
v8::Local<v8::Object> context,
|
v8::Local<v8::Object> context,
|
||||||
v8::Local<v8::Function> register_cb) {
|
v8::Local<v8::Function> register_cb) {
|
||||||
v8::HandleScope handle_scope(isolate);
|
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;
|
blink::WebCustomElement::EmbedderNamesAllowedScope embedder_names_scope;
|
||||||
|
|
||||||
content::RenderFrame* render_frame = GetRenderFrame(context);
|
content::RenderFrame* render_frame = GetRenderFrame(isolate, context);
|
||||||
if (!render_frame)
|
if (!render_frame)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
render_frame->GetWebFrame()->RequestExecuteV8Function(
|
render_frame->GetWebFrame()->RequestExecuteV8Function(
|
||||||
context->GetCreationContextChecked(), register_cb, v8::Null(isolate), 0,
|
context->GetCreationContextChecked(isolate), register_cb,
|
||||||
nullptr, base::NullCallback());
|
v8::Null(isolate), 0, nullptr, base::NullCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace electron
|
} // namespace electron
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue