|
@@ -18,13 +18,20 @@
|
|
|
#include "shell/common/native_mate_converters/once_callback.h"
|
|
|
#include "shell/common/node_includes.h"
|
|
|
#include "shell/common/promise_util.h"
|
|
|
-#include "shell/renderer/api/context_bridge/render_frame_function_store.h"
|
|
|
#include "third_party/blink/public/web/web_local_frame.h"
|
|
|
|
|
|
namespace electron {
|
|
|
|
|
|
namespace api {
|
|
|
|
|
|
+namespace context_bridge {
|
|
|
+
|
|
|
+const char* const kProxyFunctionPrivateKey = "electron_contextBridge_proxy_fn";
|
|
|
+const char* const kSupportsDynamicPropertiesPrivateKey =
|
|
|
+ "electron_contextBridge_supportsDynamicProperties";
|
|
|
+
|
|
|
+} // namespace context_bridge
|
|
|
+
|
|
|
namespace {
|
|
|
|
|
|
static int kMaxRecursion = 1000;
|
|
@@ -39,17 +46,6 @@ content::RenderFrame* GetRenderFrame(const v8::Local<v8::Object>& value) {
|
|
|
return content::RenderFrame::FromWebFrame(frame);
|
|
|
}
|
|
|
|
|
|
-context_bridge::RenderFrameFunctionStore* GetOrCreateStore(
|
|
|
- content::RenderFrame* render_frame) {
|
|
|
- auto it = context_bridge::GetStoreMap().find(render_frame->GetRoutingID());
|
|
|
- if (it == context_bridge::GetStoreMap().end()) {
|
|
|
- auto* store = new context_bridge::RenderFrameFunctionStore(render_frame);
|
|
|
- context_bridge::GetStoreMap().emplace(render_frame->GetRoutingID(), store);
|
|
|
- return store;
|
|
|
- }
|
|
|
- return it->second;
|
|
|
-}
|
|
|
-
|
|
|
// Sourced from "extensions/renderer/v8_schema_registry.cc"
|
|
|
// Recursively freezes every v8 object on |object|.
|
|
|
bool DeepFreeze(const v8::Local<v8::Object>& object,
|
|
@@ -101,35 +97,27 @@ bool IsPlainArray(const v8::Local<v8::Value>& arr) {
|
|
|
return !arr->IsTypedArray();
|
|
|
}
|
|
|
|
|
|
-class FunctionLifeMonitor final : public ObjectLifeMonitor {
|
|
|
- public:
|
|
|
- static void BindTo(
|
|
|
- v8::Isolate* isolate,
|
|
|
- v8::Local<v8::Object> target,
|
|
|
- base::WeakPtr<context_bridge::RenderFrameFunctionStore> store,
|
|
|
- size_t func_id) {
|
|
|
- new FunctionLifeMonitor(isolate, target, store, func_id);
|
|
|
- }
|
|
|
-
|
|
|
- protected:
|
|
|
- FunctionLifeMonitor(
|
|
|
- v8::Isolate* isolate,
|
|
|
- v8::Local<v8::Object> target,
|
|
|
- base::WeakPtr<context_bridge::RenderFrameFunctionStore> store,
|
|
|
- size_t func_id)
|
|
|
- : ObjectLifeMonitor(isolate, target), store_(store), func_id_(func_id) {}
|
|
|
- ~FunctionLifeMonitor() override = default;
|
|
|
-
|
|
|
- void RunDestructor() override {
|
|
|
- if (!store_)
|
|
|
- return;
|
|
|
- store_->functions().erase(func_id_);
|
|
|
- }
|
|
|
+void SetPrivate(v8::Local<v8::Context> context,
|
|
|
+ v8::Local<v8::Object> target,
|
|
|
+ const std::string& key,
|
|
|
+ v8::Local<v8::Value> value) {
|
|
|
+ target
|
|
|
+ ->SetPrivate(
|
|
|
+ context,
|
|
|
+ v8::Private::ForApi(context->GetIsolate(),
|
|
|
+ gin::StringToV8(context->GetIsolate(), key)),
|
|
|
+ value)
|
|
|
+ .Check();
|
|
|
+}
|
|
|
|
|
|
- private:
|
|
|
- base::WeakPtr<context_bridge::RenderFrameFunctionStore> store_;
|
|
|
- size_t func_id_;
|
|
|
-};
|
|
|
+v8::MaybeLocal<v8::Value> GetPrivate(v8::Local<v8::Context> context,
|
|
|
+ v8::Local<v8::Object> target,
|
|
|
+ const std::string& key) {
|
|
|
+ return target->GetPrivate(
|
|
|
+ context,
|
|
|
+ v8::Private::ForApi(context->GetIsolate(),
|
|
|
+ gin::StringToV8(context->GetIsolate(), key)));
|
|
|
+}
|
|
|
|
|
|
} // namespace
|
|
|
|
|
@@ -147,7 +135,6 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
|
|
|
v8::Local<v8::Context> source_context,
|
|
|
v8::Local<v8::Context> destination_context,
|
|
|
v8::Local<v8::Value> value,
|
|
|
- context_bridge::RenderFrameFunctionStore* store,
|
|
|
context_bridge::ObjectCache* object_cache,
|
|
|
bool support_dynamic_properties,
|
|
|
int recursion_depth) {
|
|
@@ -172,22 +159,21 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
|
|
|
// the global handle at the right time.
|
|
|
if (value->IsFunction()) {
|
|
|
auto func = v8::Local<v8::Function>::Cast(value);
|
|
|
- v8::Global<v8::Function> global_func(source_context->GetIsolate(), func);
|
|
|
- v8::Global<v8::Context> global_source(source_context->GetIsolate(),
|
|
|
- source_context);
|
|
|
|
|
|
- size_t func_id = store->take_func_id();
|
|
|
- store->functions()[func_id] =
|
|
|
- std::make_tuple(std::move(global_func), std::move(global_source));
|
|
|
- v8::Context::Scope destination_scope(destination_context);
|
|
|
{
|
|
|
- v8::Local<v8::Value> proxy_func = BindRepeatingFunctionToV8(
|
|
|
- destination_context->GetIsolate(),
|
|
|
- base::BindRepeating(&ProxyFunctionWrapper, store, func_id,
|
|
|
- support_dynamic_properties));
|
|
|
- FunctionLifeMonitor::BindTo(destination_context->GetIsolate(),
|
|
|
- v8::Local<v8::Object>::Cast(proxy_func),
|
|
|
- store->GetWeakPtr(), func_id);
|
|
|
+ v8::Context::Scope destination_scope(destination_context);
|
|
|
+ v8::Local<v8::Object> state =
|
|
|
+ v8::Object::New(destination_context->GetIsolate());
|
|
|
+ SetPrivate(destination_context, state,
|
|
|
+ context_bridge::kProxyFunctionPrivateKey, func);
|
|
|
+ SetPrivate(destination_context, state,
|
|
|
+ context_bridge::kSupportsDynamicPropertiesPrivateKey,
|
|
|
+ gin::ConvertToV8(destination_context->GetIsolate(),
|
|
|
+ support_dynamic_properties));
|
|
|
+ v8::Local<v8::Value> proxy_func;
|
|
|
+ if (!v8::Function::New(destination_context, ProxyFunctionWrapper, state)
|
|
|
+ .ToLocal(&proxy_func))
|
|
|
+ return v8::MaybeLocal<v8::Value>();
|
|
|
object_cache->CacheProxiedObject(value, proxy_func);
|
|
|
return v8::MaybeLocal<v8::Value>(proxy_func);
|
|
|
}
|
|
@@ -219,7 +205,6 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
|
|
|
v8::Isolate* isolate,
|
|
|
v8::Global<v8::Context> global_source_context,
|
|
|
v8::Global<v8::Context> global_destination_context,
|
|
|
- context_bridge::RenderFrameFunctionStore* store,
|
|
|
v8::Local<v8::Value> result) {
|
|
|
if (global_source_context.IsEmpty() ||
|
|
|
global_destination_context.IsEmpty())
|
|
@@ -228,13 +213,13 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
|
|
|
auto val =
|
|
|
PassValueToOtherContext(global_source_context.Get(isolate),
|
|
|
global_destination_context.Get(isolate),
|
|
|
- result, store, &object_cache, false, 0);
|
|
|
+ result, &object_cache, false, 0);
|
|
|
if (!val.IsEmpty())
|
|
|
proxied_promise->Resolve(val.ToLocalChecked());
|
|
|
},
|
|
|
proxied_promise, destination_context->GetIsolate(),
|
|
|
std::move(global_then_source_context),
|
|
|
- std::move(global_then_destination_context), store);
|
|
|
+ std::move(global_then_destination_context));
|
|
|
|
|
|
v8::Global<v8::Context> global_catch_source_context(
|
|
|
source_context->GetIsolate(), source_context);
|
|
@@ -248,7 +233,6 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
|
|
|
v8::Isolate* isolate,
|
|
|
v8::Global<v8::Context> global_source_context,
|
|
|
v8::Global<v8::Context> global_destination_context,
|
|
|
- context_bridge::RenderFrameFunctionStore* store,
|
|
|
v8::Local<v8::Value> result) {
|
|
|
if (global_source_context.IsEmpty() ||
|
|
|
global_destination_context.IsEmpty())
|
|
@@ -257,13 +241,13 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
|
|
|
auto val =
|
|
|
PassValueToOtherContext(global_source_context.Get(isolate),
|
|
|
global_destination_context.Get(isolate),
|
|
|
- result, store, &object_cache, false, 0);
|
|
|
+ result, &object_cache, false, 0);
|
|
|
if (!val.IsEmpty())
|
|
|
proxied_promise->Reject(val.ToLocalChecked());
|
|
|
},
|
|
|
proxied_promise, destination_context->GetIsolate(),
|
|
|
std::move(global_catch_source_context),
|
|
|
- std::move(global_catch_destination_context), store);
|
|
|
+ std::move(global_catch_destination_context));
|
|
|
|
|
|
ignore_result(source_promise->Then(
|
|
|
source_context,
|
|
@@ -299,7 +283,7 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
|
|
|
for (size_t i = 0; i < length; i++) {
|
|
|
auto value_for_array = PassValueToOtherContext(
|
|
|
source_context, destination_context,
|
|
|
- arr->Get(source_context, i).ToLocalChecked(), store, object_cache,
|
|
|
+ arr->Get(source_context, i).ToLocalChecked(), object_cache,
|
|
|
support_dynamic_properties, recursion_depth + 1);
|
|
|
if (value_for_array.IsEmpty())
|
|
|
return v8::MaybeLocal<v8::Value>();
|
|
@@ -319,7 +303,7 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
|
|
|
if (IsPlainObject(value)) {
|
|
|
auto object_value = v8::Local<v8::Object>::Cast(value);
|
|
|
auto passed_value = CreateProxyForAPI(
|
|
|
- object_value, source_context, destination_context, store, object_cache,
|
|
|
+ object_value, source_context, destination_context, object_cache,
|
|
|
support_dynamic_properties, recursion_depth + 1);
|
|
|
if (passed_value.IsEmpty())
|
|
|
return v8::MaybeLocal<v8::Value>();
|
|
@@ -346,33 +330,43 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-v8::Local<v8::Value> ProxyFunctionWrapper(
|
|
|
- context_bridge::RenderFrameFunctionStore* store,
|
|
|
- size_t func_id,
|
|
|
- bool support_dynamic_properties,
|
|
|
- mate::Arguments* args) {
|
|
|
+void ProxyFunctionWrapper(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
|
|
+ CHECK(info.Data()->IsObject());
|
|
|
+ v8::Local<v8::Object> data = info.Data().As<v8::Object>();
|
|
|
+ bool support_dynamic_properties = false;
|
|
|
+ mate::Arguments args(info);
|
|
|
// Context the proxy function was called from
|
|
|
- v8::Local<v8::Context> calling_context = args->isolate()->GetCurrentContext();
|
|
|
- // Context the function was created in
|
|
|
- v8::Local<v8::Context> func_owning_context =
|
|
|
- std::get<1>(store->functions()[func_id]).Get(args->isolate());
|
|
|
+ v8::Local<v8::Context> calling_context = args.isolate()->GetCurrentContext();
|
|
|
+
|
|
|
+ // Pull the original function and its context off of the data private key
|
|
|
+ v8::MaybeLocal<v8::Value> sdp_value =
|
|
|
+ GetPrivate(calling_context, data,
|
|
|
+ context_bridge::kSupportsDynamicPropertiesPrivateKey);
|
|
|
+ v8::MaybeLocal<v8::Value> maybe_func = GetPrivate(
|
|
|
+ calling_context, data, context_bridge::kProxyFunctionPrivateKey);
|
|
|
+ v8::Local<v8::Value> func_value;
|
|
|
+ if (sdp_value.IsEmpty() || maybe_func.IsEmpty() ||
|
|
|
+ !gin::ConvertFromV8(args.isolate(), sdp_value.ToLocalChecked(),
|
|
|
+ &support_dynamic_properties) ||
|
|
|
+ !maybe_func.ToLocal(&func_value))
|
|
|
+ return;
|
|
|
+
|
|
|
+ v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(func_value);
|
|
|
+ v8::Local<v8::Context> func_owning_context = func->CreationContext();
|
|
|
|
|
|
v8::Context::Scope func_owning_context_scope(func_owning_context);
|
|
|
context_bridge::ObjectCache object_cache;
|
|
|
{
|
|
|
- v8::Local<v8::Function> func =
|
|
|
- (std::get<0>(store->functions()[func_id])).Get(args->isolate());
|
|
|
-
|
|
|
std::vector<v8::Local<v8::Value>> original_args;
|
|
|
std::vector<v8::Local<v8::Value>> proxied_args;
|
|
|
- args->GetRemaining(&original_args);
|
|
|
+ args.GetRemaining(&original_args);
|
|
|
|
|
|
for (auto value : original_args) {
|
|
|
- auto arg = PassValueToOtherContext(calling_context, func_owning_context,
|
|
|
- value, store, &object_cache,
|
|
|
- support_dynamic_properties, 0);
|
|
|
+ auto arg =
|
|
|
+ PassValueToOtherContext(calling_context, func_owning_context, value,
|
|
|
+ &object_cache, support_dynamic_properties, 0);
|
|
|
if (arg.IsEmpty())
|
|
|
- return v8::Undefined(args->isolate());
|
|
|
+ return;
|
|
|
proxied_args.push_back(arg.ToLocalChecked());
|
|
|
}
|
|
|
|
|
@@ -380,7 +374,7 @@ v8::Local<v8::Value> ProxyFunctionWrapper(
|
|
|
bool did_error = false;
|
|
|
std::string error_message;
|
|
|
{
|
|
|
- v8::TryCatch try_catch(args->isolate());
|
|
|
+ v8::TryCatch try_catch(args.isolate());
|
|
|
maybe_return_value = func->Call(func_owning_context, func,
|
|
|
proxied_args.size(), proxied_args.data());
|
|
|
if (try_catch.HasCaught()) {
|
|
@@ -388,7 +382,7 @@ v8::Local<v8::Value> ProxyFunctionWrapper(
|
|
|
auto message = try_catch.Message();
|
|
|
|
|
|
if (message.IsEmpty() ||
|
|
|
- !mate::ConvertFromV8(args->isolate(), message->Get(),
|
|
|
+ !mate::ConvertFromV8(args.isolate(), message->Get(),
|
|
|
&error_message)) {
|
|
|
error_message =
|
|
|
"An unknown exception occurred in the isolated context, an "
|
|
@@ -401,21 +395,22 @@ v8::Local<v8::Value> ProxyFunctionWrapper(
|
|
|
if (did_error) {
|
|
|
v8::Context::Scope calling_context_scope(calling_context);
|
|
|
{
|
|
|
- args->ThrowError(error_message);
|
|
|
- return v8::Local<v8::Object>();
|
|
|
+ args.isolate()->ThrowException(v8::Exception::Error(
|
|
|
+ gin::StringToV8(args.isolate(), error_message)));
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (maybe_return_value.IsEmpty())
|
|
|
- return v8::Undefined(args->isolate());
|
|
|
+ return;
|
|
|
|
|
|
auto ret =
|
|
|
PassValueToOtherContext(func_owning_context, calling_context,
|
|
|
- maybe_return_value.ToLocalChecked(), store,
|
|
|
+ maybe_return_value.ToLocalChecked(),
|
|
|
&object_cache, support_dynamic_properties, 0);
|
|
|
if (ret.IsEmpty())
|
|
|
- return v8::Undefined(args->isolate());
|
|
|
- return ret.ToLocalChecked();
|
|
|
+ return;
|
|
|
+ info.GetReturnValue().Set(ret.ToLocalChecked());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -423,7 +418,6 @@ v8::MaybeLocal<v8::Object> CreateProxyForAPI(
|
|
|
const v8::Local<v8::Object>& api_object,
|
|
|
const v8::Local<v8::Context>& source_context,
|
|
|
const v8::Local<v8::Context>& destination_context,
|
|
|
- context_bridge::RenderFrameFunctionStore* store,
|
|
|
context_bridge::ObjectCache* object_cache,
|
|
|
bool support_dynamic_properties,
|
|
|
int recursion_depth) {
|
|
@@ -470,15 +464,13 @@ v8::MaybeLocal<v8::Object> CreateProxyForAPI(
|
|
|
v8::Local<v8::Value> setter_proxy;
|
|
|
if (!getter.IsEmpty()) {
|
|
|
if (!PassValueToOtherContext(source_context, destination_context,
|
|
|
- getter, store, object_cache, false,
|
|
|
- 1)
|
|
|
+ getter, object_cache, false, 1)
|
|
|
.ToLocal(&getter_proxy))
|
|
|
continue;
|
|
|
}
|
|
|
if (!setter.IsEmpty()) {
|
|
|
if (!PassValueToOtherContext(source_context, destination_context,
|
|
|
- setter, store, object_cache, false,
|
|
|
- 1)
|
|
|
+ setter, object_cache, false, 1)
|
|
|
.ToLocal(&setter_proxy))
|
|
|
continue;
|
|
|
}
|
|
@@ -496,7 +488,7 @@ v8::MaybeLocal<v8::Object> CreateProxyForAPI(
|
|
|
continue;
|
|
|
|
|
|
auto passed_value = PassValueToOtherContext(
|
|
|
- source_context, destination_context, value, store, object_cache,
|
|
|
+ source_context, destination_context, value, object_cache,
|
|
|
support_dynamic_properties, recursion_depth + 1);
|
|
|
if (passed_value.IsEmpty())
|
|
|
return v8::MaybeLocal<v8::Object>();
|
|
@@ -507,23 +499,11 @@ v8::MaybeLocal<v8::Object> CreateProxyForAPI(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#ifdef DCHECK_IS_ON
|
|
|
-mate::Dictionary DebugGC(mate::Dictionary empty) {
|
|
|
- auto* render_frame = GetRenderFrame(empty.GetHandle());
|
|
|
- auto* store = GetOrCreateStore(render_frame);
|
|
|
- mate::Dictionary ret = mate::Dictionary::CreateEmpty(empty.isolate());
|
|
|
- ret.Set("functionCount", store->functions().size());
|
|
|
- return ret;
|
|
|
-}
|
|
|
-#endif
|
|
|
-
|
|
|
void ExposeAPIInMainWorld(const std::string& key,
|
|
|
v8::Local<v8::Object> api_object,
|
|
|
mate::Arguments* args) {
|
|
|
auto* render_frame = GetRenderFrame(api_object);
|
|
|
CHECK(render_frame);
|
|
|
- context_bridge::RenderFrameFunctionStore* store =
|
|
|
- GetOrCreateStore(render_frame);
|
|
|
auto* frame = render_frame->GetWebFrame();
|
|
|
CHECK(frame);
|
|
|
v8::Local<v8::Context> main_context = frame->MainWorldScriptContext();
|
|
@@ -542,9 +522,8 @@ void ExposeAPIInMainWorld(const std::string& key,
|
|
|
context_bridge::ObjectCache object_cache;
|
|
|
v8::Context::Scope main_context_scope(main_context);
|
|
|
{
|
|
|
- v8::MaybeLocal<v8::Object> maybe_proxy =
|
|
|
- CreateProxyForAPI(api_object, isolated_context, main_context, store,
|
|
|
- &object_cache, false, 0);
|
|
|
+ v8::MaybeLocal<v8::Object> maybe_proxy = CreateProxyForAPI(
|
|
|
+ api_object, isolated_context, main_context, &object_cache, false, 0);
|
|
|
if (maybe_proxy.IsEmpty())
|
|
|
return;
|
|
|
auto proxy = maybe_proxy.ToLocalChecked();
|
|
@@ -573,8 +552,6 @@ void OverrideGlobalValueFromIsolatedWorld(
|
|
|
|
|
|
auto* render_frame = GetRenderFrame(value);
|
|
|
CHECK(render_frame);
|
|
|
- context_bridge::RenderFrameFunctionStore* store =
|
|
|
- GetOrCreateStore(render_frame);
|
|
|
auto* frame = render_frame->GetWebFrame();
|
|
|
CHECK(frame);
|
|
|
v8::Local<v8::Context> main_context = frame->MainWorldScriptContext();
|
|
@@ -586,9 +563,9 @@ void OverrideGlobalValueFromIsolatedWorld(
|
|
|
{
|
|
|
v8::Context::Scope main_context_scope(main_context);
|
|
|
context_bridge::ObjectCache object_cache;
|
|
|
- v8::MaybeLocal<v8::Value> maybe_proxy = PassValueToOtherContext(
|
|
|
- value->CreationContext(), main_context, value, store, &object_cache,
|
|
|
- support_dynamic_properties, 1);
|
|
|
+ v8::MaybeLocal<v8::Value> maybe_proxy =
|
|
|
+ PassValueToOtherContext(value->CreationContext(), main_context, value,
|
|
|
+ &object_cache, support_dynamic_properties, 1);
|
|
|
DCHECK(!maybe_proxy.IsEmpty());
|
|
|
auto proxy = maybe_proxy.ToLocalChecked();
|
|
|
|
|
@@ -606,8 +583,6 @@ bool OverrideGlobalPropertyFromIsolatedWorld(
|
|
|
|
|
|
auto* render_frame = GetRenderFrame(getter);
|
|
|
CHECK(render_frame);
|
|
|
- context_bridge::RenderFrameFunctionStore* store =
|
|
|
- GetOrCreateStore(render_frame);
|
|
|
auto* frame = render_frame->GetWebFrame();
|
|
|
CHECK(frame);
|
|
|
v8::Local<v8::Context> main_context = frame->MainWorldScriptContext();
|
|
@@ -625,14 +600,14 @@ bool OverrideGlobalPropertyFromIsolatedWorld(
|
|
|
if (!getter->IsNullOrUndefined()) {
|
|
|
v8::MaybeLocal<v8::Value> maybe_getter_proxy =
|
|
|
PassValueToOtherContext(getter->CreationContext(), main_context,
|
|
|
- getter, store, &object_cache, false, 1);
|
|
|
+ getter, &object_cache, false, 1);
|
|
|
DCHECK(!maybe_getter_proxy.IsEmpty());
|
|
|
getter_proxy = maybe_getter_proxy.ToLocalChecked();
|
|
|
}
|
|
|
if (!setter->IsNullOrUndefined() && setter->IsObject()) {
|
|
|
v8::MaybeLocal<v8::Value> maybe_setter_proxy =
|
|
|
PassValueToOtherContext(getter->CreationContext(), main_context,
|
|
|
- setter, store, &object_cache, false, 1);
|
|
|
+ setter, &object_cache, false, 1);
|
|
|
DCHECK(!maybe_setter_proxy.IsEmpty());
|
|
|
setter_proxy = maybe_setter_proxy.ToLocalChecked();
|
|
|
}
|
|
@@ -686,7 +661,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
|
|
dict.SetMethod("_isCalledFromIsolatedWorld",
|
|
|
&electron::api::IsCalledFromIsolatedWorld);
|
|
|
#ifdef DCHECK_IS_ON
|
|
|
- dict.SetMethod("_debugGCMaps", &electron::api::DebugGC);
|
|
|
+ dict.Set("_isDebug", true);
|
|
|
#endif
|
|
|
}
|
|
|
|