refactor: use WeakRef on main process side of remote (#24115)

This commit is contained in:
Jeremy Rose 2020-06-16 14:34:08 -07:00 committed by GitHub
parent 09c0ee8f87
commit e1e73fa5f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 43 additions and 181 deletions

View file

@ -16,10 +16,6 @@
#include "url/origin.h"
#include "v8/include/v8-profiler.h"
#if BUILDFLAG(ENABLE_REMOTE_MODULE)
#include "shell/common/api/remote/remote_callback_freer.h"
#endif
namespace std {
// The hash function used by DoubleIDWeakMap.
@ -144,13 +140,6 @@ void Initialize(v8::Local<v8::Object> exports,
dict.SetMethod("deleteHiddenValue", &DeleteHiddenValue);
dict.SetMethod("getObjectHash", &GetObjectHash);
dict.SetMethod("takeHeapSnapshot", &TakeHeapSnapshot);
#if BUILDFLAG(ENABLE_REMOTE_MODULE)
dict.SetMethod("setRemoteCallbackFreer",
&electron::RemoteCallbackFreer::BindTo);
dict.SetMethod(
"createDoubleIDWeakMap",
&electron::api::KeyWeakMap<std::pair<std::string, int32_t>>::Create);
#endif
dict.SetMethod("requestGarbageCollectionForTesting",
&RequestGarbageCollectionForTesting);
dict.SetMethod("isSameOrigin", &IsSameOrigin);