fix: expose v8util.createIDWeakMap() regardless of enable_remote_module (#23546)

This commit is contained in:
Milan Burda 2020-05-13 12:10:03 +02:00 committed by GitHub
parent 54ff423dac
commit 54b6c06062
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -21,7 +21,7 @@ class AccessDependenciesPlugin {
} }
const defines = { const defines = {
BUILDFLAG: ' ' BUILDFLAG: ''
} }
const buildFlagsPrefix = '--buildflags=' const buildFlagsPrefix = '--buildflags='

View file

@ -7,6 +7,7 @@
#include "base/hash/hash.h" #include "base/hash/hash.h"
#include "electron/buildflags/buildflags.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/content_converter.h"
#include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/gurl_converter.h"
#include "shell/common/gin_converters/std_converter.h" #include "shell/common/gin_converters/std_converter.h"
@ -16,7 +17,6 @@
#include "v8/include/v8-profiler.h" #include "v8/include/v8-profiler.h"
#if BUILDFLAG(ENABLE_REMOTE_MODULE) #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_callback_freer.h"
#include "shell/common/api/remote/remote_object_freer.h" #include "shell/common/api/remote/remote_object_freer.h"
#endif #endif
@ -127,12 +127,12 @@ void Initialize(v8::Local<v8::Object> exports,
&electron::RemoteCallbackFreer::BindTo); &electron::RemoteCallbackFreer::BindTo);
dict.SetMethod("setRemoteObjectFreer", &electron::RemoteObjectFreer::BindTo); dict.SetMethod("setRemoteObjectFreer", &electron::RemoteObjectFreer::BindTo);
dict.SetMethod("addRemoteObjectRef", &electron::RemoteObjectFreer::AddRef); dict.SetMethod("addRemoteObjectRef", &electron::RemoteObjectFreer::AddRef);
dict.SetMethod("createIDWeakMap",
&electron::api::KeyWeakMap<int32_t>::Create);
dict.SetMethod( dict.SetMethod(
"createDoubleIDWeakMap", "createDoubleIDWeakMap",
&electron::api::KeyWeakMap<std::pair<std::string, int32_t>>::Create); &electron::api::KeyWeakMap<std::pair<std::string, int32_t>>::Create);
#endif #endif
dict.SetMethod("createIDWeakMap",
&electron::api::KeyWeakMap<int32_t>::Create);
dict.SetMethod("requestGarbageCollectionForTesting", dict.SetMethod("requestGarbageCollectionForTesting",
&RequestGarbageCollectionForTesting); &RequestGarbageCollectionForTesting);
dict.SetMethod("isSameOrigin", &IsSameOrigin); dict.SetMethod("isSameOrigin", &IsSameOrigin);