From 54b6c0606226f6df806dc6bc458295ac50b1f792 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Wed, 13 May 2020 12:10:03 +0200 Subject: [PATCH] fix: expose v8util.createIDWeakMap() regardless of enable_remote_module (#23546) --- build/webpack/webpack.config.base.js | 2 +- shell/common/api/electron_api_v8_util.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/webpack/webpack.config.base.js b/build/webpack/webpack.config.base.js index 273bbd796b4e..d24776a9604b 100644 --- a/build/webpack/webpack.config.base.js +++ b/build/webpack/webpack.config.base.js @@ -21,7 +21,7 @@ class AccessDependenciesPlugin { } const defines = { - BUILDFLAG: ' ' + BUILDFLAG: '' } const buildFlagsPrefix = '--buildflags=' diff --git a/shell/common/api/electron_api_v8_util.cc b/shell/common/api/electron_api_v8_util.cc index 7b2b5f5d5cde..c7ed6b8fae10 100644 --- a/shell/common/api/electron_api_v8_util.cc +++ b/shell/common/api/electron_api_v8_util.cc @@ -7,6 +7,7 @@ #include "base/hash/hash.h" #include "electron/buildflags/buildflags.h" +#include "shell/common/api/electron_api_key_weak_map.h" #include "shell/common/gin_converters/content_converter.h" #include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/std_converter.h" @@ -16,7 +17,6 @@ #include "v8/include/v8-profiler.h" #if BUILDFLAG(ENABLE_REMOTE_MODULE) -#include "shell/common/api/electron_api_key_weak_map.h" #include "shell/common/api/remote/remote_callback_freer.h" #include "shell/common/api/remote/remote_object_freer.h" #endif @@ -127,12 +127,12 @@ void Initialize(v8::Local exports, &electron::RemoteCallbackFreer::BindTo); dict.SetMethod("setRemoteObjectFreer", &electron::RemoteObjectFreer::BindTo); dict.SetMethod("addRemoteObjectRef", &electron::RemoteObjectFreer::AddRef); - dict.SetMethod("createIDWeakMap", - &electron::api::KeyWeakMap::Create); dict.SetMethod( "createDoubleIDWeakMap", &electron::api::KeyWeakMap>::Create); #endif + dict.SetMethod("createIDWeakMap", + &electron::api::KeyWeakMap::Create); dict.SetMethod("requestGarbageCollectionForTesting", &RequestGarbageCollectionForTesting); dict.SetMethod("isSameOrigin", &IsSameOrigin);