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

This commit is contained in:
Milan Burda
2020-05-13 18:12:15 +02:00
committed by GitHub
parent 56e84acab9
commit 810b54854a

View File

@@ -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_helper/dictionary.h"
@@ -15,7 +16,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
@@ -126,12 +126,12 @@ void Initialize(v8::Local<v8::Object> exports,
&electron::RemoteCallbackFreer::BindTo);
dict.SetMethod("setRemoteObjectFreer", &electron::RemoteObjectFreer::BindTo);
dict.SetMethod("addRemoteObjectRef", &electron::RemoteObjectFreer::AddRef);
dict.SetMethod("createIDWeakMap",
&electron::api::KeyWeakMap<int32_t>::Create);
dict.SetMethod(
"createDoubleIDWeakMap",
&electron::api::KeyWeakMap<std::pair<std::string, int32_t>>::Create);
#endif
dict.SetMethod("createIDWeakMap",
&electron::api::KeyWeakMap<int32_t>::Create);
dict.SetMethod("requestGarbageCollectionForTesting",
&RequestGarbageCollectionForTesting);
dict.SetMethod("isSameOrigin", &IsSameOrigin);