diff --git a/BUILD.gn b/BUILD.gn index 488cd78ac6be..65d9dd2b751b 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -581,8 +581,6 @@ source_set("electron_lib") { if (enable_remote_module) { sources += [ - "shell/common/api/remote/object_life_monitor.cc", - "shell/common/api/remote/object_life_monitor.h", "shell/common/api/remote/remote_callback_freer.cc", "shell/common/api/remote/remote_callback_freer.h", "shell/common/api/remote/remote_object_freer.cc", diff --git a/filenames.gni b/filenames.gni index a57cd1dc1403..2ba08b5f6e91 100644 --- a/filenames.gni +++ b/filenames.gni @@ -454,6 +454,8 @@ filenames = { "shell/common/api/electron_bindings.cc", "shell/common/api/electron_bindings.h", "shell/common/api/features.cc", + "shell/common/api/object_life_monitor.cc", + "shell/common/api/object_life_monitor.h", "shell/common/application_info.cc", "shell/common/application_info.h", "shell/common/application_info_linux.cc", diff --git a/shell/common/api/electron_api_v8_util.cc b/shell/common/api/electron_api_v8_util.cc index 3ad990ac3e80..7b2b5f5d5cde 100644 --- a/shell/common/api/electron_api_v8_util.cc +++ b/shell/common/api/electron_api_v8_util.cc @@ -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); diff --git a/shell/common/api/remote/object_life_monitor.cc b/shell/common/api/object_life_monitor.cc similarity index 94% rename from shell/common/api/remote/object_life_monitor.cc rename to shell/common/api/object_life_monitor.cc index 17f3d18de30d..a1e93e14c858 100644 --- a/shell/common/api/remote/object_life_monitor.cc +++ b/shell/common/api/object_life_monitor.cc @@ -3,7 +3,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "shell/common/api/remote/object_life_monitor.h" +#include "shell/common/api/object_life_monitor.h" #include "base/bind.h" #include "base/message_loop/message_loop.h" diff --git a/shell/common/api/remote/object_life_monitor.h b/shell/common/api/object_life_monitor.h similarity index 81% rename from shell/common/api/remote/object_life_monitor.h rename to shell/common/api/object_life_monitor.h index bde07434a90a..0b11d1cb9d71 100644 --- a/shell/common/api/remote/object_life_monitor.h +++ b/shell/common/api/object_life_monitor.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef SHELL_COMMON_API_REMOTE_OBJECT_LIFE_MONITOR_H_ -#define SHELL_COMMON_API_REMOTE_OBJECT_LIFE_MONITOR_H_ +#ifndef SHELL_COMMON_API_OBJECT_LIFE_MONITOR_H_ +#define SHELL_COMMON_API_OBJECT_LIFE_MONITOR_H_ #include "base/macros.h" #include "base/memory/weak_ptr.h" @@ -31,4 +31,4 @@ class ObjectLifeMonitor { } // namespace electron -#endif // SHELL_COMMON_API_REMOTE_OBJECT_LIFE_MONITOR_H_ +#endif // SHELL_COMMON_API_OBJECT_LIFE_MONITOR_H_ diff --git a/shell/common/api/remote/remote_callback_freer.h b/shell/common/api/remote/remote_callback_freer.h index 512fecf67783..7e9d95a2e06d 100644 --- a/shell/common/api/remote/remote_callback_freer.h +++ b/shell/common/api/remote/remote_callback_freer.h @@ -8,7 +8,7 @@ #include #include "content/public/browser/web_contents_observer.h" -#include "shell/common/api/remote/object_life_monitor.h" +#include "shell/common/api/object_life_monitor.h" namespace electron { diff --git a/shell/common/api/remote/remote_object_freer.h b/shell/common/api/remote/remote_object_freer.h index 987911e78936..037b19e77a2a 100644 --- a/shell/common/api/remote/remote_object_freer.h +++ b/shell/common/api/remote/remote_object_freer.h @@ -8,7 +8,7 @@ #include #include -#include "shell/common/api/remote/object_life_monitor.h" +#include "shell/common/api/object_life_monitor.h" namespace electron { diff --git a/shell/renderer/api/context_bridge/object_cache.cc b/shell/renderer/api/context_bridge/object_cache.cc index fd060324d41a..8d111747e5ba 100644 --- a/shell/renderer/api/context_bridge/object_cache.cc +++ b/shell/renderer/api/context_bridge/object_cache.cc @@ -6,7 +6,7 @@ #include -#include "shell/common/api/remote/object_life_monitor.h" +#include "shell/common/api/object_life_monitor.h" namespace electron { diff --git a/shell/renderer/api/context_bridge/render_frame_function_store.cc b/shell/renderer/api/context_bridge/render_frame_function_store.cc index 6131544f590d..eb4c3c9c4235 100644 --- a/shell/renderer/api/context_bridge/render_frame_function_store.cc +++ b/shell/renderer/api/context_bridge/render_frame_function_store.cc @@ -6,7 +6,7 @@ #include -#include "shell/common/api/remote/object_life_monitor.h" +#include "shell/common/api/object_life_monitor.h" namespace electron { diff --git a/shell/renderer/api/electron_api_context_bridge.cc b/shell/renderer/api/electron_api_context_bridge.cc index 1c41a1e126b9..90ed012fb5ae 100644 --- a/shell/renderer/api/electron_api_context_bridge.cc +++ b/shell/renderer/api/electron_api_context_bridge.cc @@ -15,7 +15,7 @@ #include "base/strings/string_number_conversions.h" #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame_observer.h" -#include "shell/common/api/remote/object_life_monitor.h" +#include "shell/common/api/object_life_monitor.h" #include "shell/common/gin_converters/blink_converter.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_helper/dictionary.h"