From 8ae5aacc8c2734e65ac0e1ccfbe96539f5f07dd2 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 4 Sep 2024 18:40:02 -0500 Subject: [PATCH] refactor: declare gin::Wrapper subclasses as final (#43527) As per the gin docs: "Wrappable explicitly does not support further subclassing of T. Subclasses of Wrappable should be declared final." --- shell/browser/api/electron_api_app.h | 12 ++++----- shell/browser/api/electron_api_auto_updater.h | 8 +++--- shell/browser/api/electron_api_cookies.h | 4 +-- .../api/electron_api_data_pipe_holder.h | 2 +- shell/browser/api/electron_api_debugger.h | 8 +++--- .../api/electron_api_desktop_capturer.h | 6 ++--- .../browser/api/electron_api_download_item.h | 8 +++--- .../api/electron_api_global_shortcut.h | 5 ++-- .../api/electron_api_in_app_purchase.h | 6 ++--- shell/browser/api/electron_api_native_theme.h | 6 ++--- shell/browser/api/electron_api_net_log.h | 2 +- shell/browser/api/electron_api_notification.h | 10 +++---- .../browser/api/electron_api_power_monitor.h | 12 ++++----- .../api/electron_api_power_save_blocker.h | 2 +- shell/browser/api/electron_api_protocol.h | 4 +-- .../api/electron_api_push_notifications.h | 2 +- shell/browser/api/electron_api_screen.h | 6 ++--- .../api/electron_api_service_worker_context.h | 2 +- shell/browser/api/electron_api_session.h | 16 ++++++------ .../api/electron_api_system_preferences.h | 2 +- shell/browser/api/electron_api_tray.h | 12 ++++----- .../api/electron_api_utility_process.h | 2 +- .../browser/api/electron_api_web_contents.cc | 2 +- shell/browser/api/electron_api_web_contents.h | 26 +++++++++---------- .../browser/api/electron_api_web_frame_main.h | 8 +++--- shell/browser/api/electron_api_web_request.h | 3 ++- shell/browser/api/message_port.h | 6 ++--- shell/common/api/electron_api_native_image.h | 2 +- shell/common/api/electron_api_url_loader.cc | 5 ++-- shell/common/api/electron_api_url_loader.h | 2 +- shell/common/gin_converters/net_converter.cc | 2 +- shell/common/gin_helper/event.h | 4 +-- .../renderer/api/electron_api_ipc_renderer.cc | 4 +-- shell/renderer/api/electron_api_web_frame.cc | 4 +-- shell/services/node/parent_port.h | 4 +-- 35 files changed, 106 insertions(+), 103 deletions(-) diff --git a/shell/browser/api/electron_api_app.h b/shell/browser/api/electron_api_app.h index 9c423892426..0d17c25e7de 100644 --- a/shell/browser/api/electron_api_app.h +++ b/shell/browser/api/electron_api_app.h @@ -57,12 +57,12 @@ enum class JumpListResult : int; namespace api { -class App : public ElectronBrowserClient::Delegate, - public gin::Wrappable, - public gin_helper::EventEmitterMixin, - private BrowserObserver, - private content::GpuDataManagerObserver, - private content::BrowserChildProcessObserver { +class App final : public ElectronBrowserClient::Delegate, + public gin::Wrappable, + public gin_helper::EventEmitterMixin, + private BrowserObserver, + private content::GpuDataManagerObserver, + private content::BrowserChildProcessObserver { public: using FileIconCallback = base::RepeatingCallback, const gfx::Image&)>; diff --git a/shell/browser/api/electron_api_auto_updater.h b/shell/browser/api/electron_api_auto_updater.h index 00fc40fbaf9..22a0f1f7c09 100644 --- a/shell/browser/api/electron_api_auto_updater.h +++ b/shell/browser/api/electron_api_auto_updater.h @@ -19,10 +19,10 @@ class Handle; namespace electron::api { -class AutoUpdater : public gin::Wrappable, - public gin_helper::EventEmitterMixin, - public auto_updater::Delegate, - private WindowListObserver { +class AutoUpdater final : public gin::Wrappable, + public gin_helper::EventEmitterMixin, + public auto_updater::Delegate, + private WindowListObserver { public: static gin::Handle Create(v8::Isolate* isolate); diff --git a/shell/browser/api/electron_api_cookies.h b/shell/browser/api/electron_api_cookies.h index 50a9470401c..df509fdb1d1 100644 --- a/shell/browser/api/electron_api_cookies.h +++ b/shell/browser/api/electron_api_cookies.h @@ -31,8 +31,8 @@ class ElectronBrowserContext; namespace api { -class Cookies : public gin::Wrappable, - public gin_helper::EventEmitterMixin { +class Cookies final : public gin::Wrappable, + public gin_helper::EventEmitterMixin { public: static gin::Handle Create(v8::Isolate* isolate, ElectronBrowserContext* browser_context); diff --git a/shell/browser/api/electron_api_data_pipe_holder.h b/shell/browser/api/electron_api_data_pipe_holder.h index f6c09cf34a8..1203ac09861 100644 --- a/shell/browser/api/electron_api_data_pipe_holder.h +++ b/shell/browser/api/electron_api_data_pipe_holder.h @@ -20,7 +20,7 @@ class Handle; namespace electron::api { // Retains reference to the data pipe. -class DataPipeHolder : public gin::Wrappable { +class DataPipeHolder final : public gin::Wrappable { public: // gin::Wrappable static gin::WrapperInfo kWrapperInfo; diff --git a/shell/browser/api/electron_api_debugger.h b/shell/browser/api/electron_api_debugger.h index f4329ee4fc2..4f4b6fd4fb0 100644 --- a/shell/browser/api/electron_api_debugger.h +++ b/shell/browser/api/electron_api_debugger.h @@ -32,10 +32,10 @@ class Promise; namespace electron::api { -class Debugger : public gin::Wrappable, - public gin_helper::EventEmitterMixin, - public content::DevToolsAgentHostClient, - private content::WebContentsObserver { +class Debugger final : public gin::Wrappable, + public gin_helper::EventEmitterMixin, + public content::DevToolsAgentHostClient, + private content::WebContentsObserver { public: static gin::Handle Create(v8::Isolate* isolate, content::WebContents* web_contents); diff --git a/shell/browser/api/electron_api_desktop_capturer.h b/shell/browser/api/electron_api_desktop_capturer.h index f02d782a209..1a146feb527 100644 --- a/shell/browser/api/electron_api_desktop_capturer.h +++ b/shell/browser/api/electron_api_desktop_capturer.h @@ -21,9 +21,9 @@ class Handle; namespace electron::api { -class DesktopCapturer : public gin::Wrappable, - public gin_helper::Pinnable, - private DesktopMediaListObserver { +class DesktopCapturer final : public gin::Wrappable, + public gin_helper::Pinnable, + private DesktopMediaListObserver { public: struct Source { DesktopMediaList::Source media_list_source; diff --git a/shell/browser/api/electron_api_download_item.h b/shell/browser/api/electron_api_download_item.h index 46e9e7b1935..17d02fdb54e 100644 --- a/shell/browser/api/electron_api_download_item.h +++ b/shell/browser/api/electron_api_download_item.h @@ -25,10 +25,10 @@ class Handle; namespace electron::api { -class DownloadItem : public gin::Wrappable, - public gin_helper::Pinnable, - public gin_helper::EventEmitterMixin, - private download::DownloadItem::Observer { +class DownloadItem final : public gin::Wrappable, + public gin_helper::Pinnable, + public gin_helper::EventEmitterMixin, + private download::DownloadItem::Observer { public: static gin::Handle FromOrCreate(v8::Isolate* isolate, download::DownloadItem* item); diff --git a/shell/browser/api/electron_api_global_shortcut.h b/shell/browser/api/electron_api_global_shortcut.h index 8b1048680c4..614082d889f 100644 --- a/shell/browser/api/electron_api_global_shortcut.h +++ b/shell/browser/api/electron_api_global_shortcut.h @@ -20,8 +20,9 @@ class Handle; namespace electron::api { -class GlobalShortcut : private extensions::GlobalShortcutListener::Observer, - public gin::Wrappable { +class GlobalShortcut final + : private extensions::GlobalShortcutListener::Observer, + public gin::Wrappable { public: static gin::Handle Create(v8::Isolate* isolate); diff --git a/shell/browser/api/electron_api_in_app_purchase.h b/shell/browser/api/electron_api_in_app_purchase.h index 4e88a495561..b50cba62f44 100644 --- a/shell/browser/api/electron_api_in_app_purchase.h +++ b/shell/browser/api/electron_api_in_app_purchase.h @@ -22,9 +22,9 @@ class Handle; namespace electron::api { -class InAppPurchase : public gin::Wrappable, - public gin_helper::EventEmitterMixin, - private in_app_purchase::TransactionObserver { +class InAppPurchase final : public gin::Wrappable, + public gin_helper::EventEmitterMixin, + private in_app_purchase::TransactionObserver { public: static gin::Handle Create(v8::Isolate* isolate); diff --git a/shell/browser/api/electron_api_native_theme.h b/shell/browser/api/electron_api_native_theme.h index 70066558b2c..d94f148ec53 100644 --- a/shell/browser/api/electron_api_native_theme.h +++ b/shell/browser/api/electron_api_native_theme.h @@ -18,9 +18,9 @@ class handle; namespace electron::api { -class NativeTheme : public gin::Wrappable, - public gin_helper::EventEmitterMixin, - private ui::NativeThemeObserver { +class NativeTheme final : public gin::Wrappable, + public gin_helper::EventEmitterMixin, + private ui::NativeThemeObserver { public: static gin::Handle Create(v8::Isolate* isolate); diff --git a/shell/browser/api/electron_api_net_log.h b/shell/browser/api/electron_api_net_log.h index e7aa9b733f9..b3d84d5a9e2 100644 --- a/shell/browser/api/electron_api_net_log.h +++ b/shell/browser/api/electron_api_net_log.h @@ -35,7 +35,7 @@ class ElectronBrowserContext; namespace api { // The code is referenced from the net_log::NetExportFileWriter class. -class NetLog : public gin::Wrappable { +class NetLog final : public gin::Wrappable { public: static gin::Handle Create(v8::Isolate* isolate, ElectronBrowserContext* browser_context); diff --git a/shell/browser/api/electron_api_notification.h b/shell/browser/api/electron_api_notification.h index 7cdf6cba5d5..c67c5d71601 100644 --- a/shell/browser/api/electron_api_notification.h +++ b/shell/browser/api/electron_api_notification.h @@ -30,11 +30,11 @@ class ErrorThrower; namespace electron::api { -class Notification : public gin::Wrappable, - public gin_helper::EventEmitterMixin, - public gin_helper::Constructible, - public gin_helper::CleanedUpAtExit, - public NotificationDelegate { +class Notification final : public gin::Wrappable, + public gin_helper::EventEmitterMixin, + public gin_helper::Constructible, + public gin_helper::CleanedUpAtExit, + public NotificationDelegate { public: static bool IsSupported(); diff --git a/shell/browser/api/electron_api_power_monitor.h b/shell/browser/api/electron_api_power_monitor.h index 436fd9c0f87..d0dd651f01c 100644 --- a/shell/browser/api/electron_api_power_monitor.h +++ b/shell/browser/api/electron_api_power_monitor.h @@ -17,12 +17,12 @@ namespace electron::api { -class PowerMonitor : public gin::Wrappable, - public gin_helper::EventEmitterMixin, - public gin_helper::Pinnable, - private base::PowerStateObserver, - private base::PowerSuspendObserver, - private base::PowerThermalObserver { +class PowerMonitor final : public gin::Wrappable, + public gin_helper::EventEmitterMixin, + public gin_helper::Pinnable, + private base::PowerStateObserver, + private base::PowerSuspendObserver, + private base::PowerThermalObserver { public: static v8::Local Create(v8::Isolate* isolate); diff --git a/shell/browser/api/electron_api_power_save_blocker.h b/shell/browser/api/electron_api_power_save_blocker.h index 43b2265b064..881a222e1af 100644 --- a/shell/browser/api/electron_api_power_save_blocker.h +++ b/shell/browser/api/electron_api_power_save_blocker.h @@ -19,7 +19,7 @@ class Handle; namespace electron::api { -class PowerSaveBlocker : public gin::Wrappable { +class PowerSaveBlocker final : public gin::Wrappable { public: static gin::Handle Create(v8::Isolate* isolate); diff --git a/shell/browser/api/electron_api_protocol.h b/shell/browser/api/electron_api_protocol.h index 82d74013b3a..273efc4dea8 100644 --- a/shell/browser/api/electron_api_protocol.h +++ b/shell/browser/api/electron_api_protocol.h @@ -45,8 +45,8 @@ enum class ProtocolError { }; // Protocol implementation based on network services. -class Protocol : public gin::Wrappable, - public gin_helper::Constructible { +class Protocol final : public gin::Wrappable, + public gin_helper::Constructible { public: static gin::Handle Create(v8::Isolate* isolate, ElectronBrowserContext* browser_context); diff --git a/shell/browser/api/electron_api_push_notifications.h b/shell/browser/api/electron_api_push_notifications.h index 5cc32770809..eea0f9909d5 100644 --- a/shell/browser/api/electron_api_push_notifications.h +++ b/shell/browser/api/electron_api_push_notifications.h @@ -21,7 +21,7 @@ class Handle; namespace electron::api { -class PushNotifications +class PushNotifications final : public ElectronBrowserClient::Delegate, public gin::Wrappable, public gin_helper::EventEmitterMixin, diff --git a/shell/browser/api/electron_api_screen.h b/shell/browser/api/electron_api_screen.h index bbc7ade94de..cd5d7f5b5d2 100644 --- a/shell/browser/api/electron_api_screen.h +++ b/shell/browser/api/electron_api_screen.h @@ -25,9 +25,9 @@ class ErrorThrower; namespace electron::api { -class Screen : public gin::Wrappable, - public gin_helper::EventEmitterMixin, - private display::DisplayObserver { +class Screen final : public gin::Wrappable, + public gin_helper::EventEmitterMixin, + private display::DisplayObserver { public: static v8::Local Create(gin_helper::ErrorThrower error_thrower); diff --git a/shell/browser/api/electron_api_service_worker_context.h b/shell/browser/api/electron_api_service_worker_context.h index fb6bb9fe6eb..286c3bcecc5 100644 --- a/shell/browser/api/electron_api_service_worker_context.h +++ b/shell/browser/api/electron_api_service_worker_context.h @@ -22,7 +22,7 @@ class ElectronBrowserContext; namespace api { -class ServiceWorkerContext +class ServiceWorkerContext final : public gin::Wrappable, public gin_helper::EventEmitterMixin, private content::ServiceWorkerContextObserver { diff --git a/shell/browser/api/electron_api_session.h b/shell/browser/api/electron_api_session.h index 37a1c9b2fbc..8e921eb290f 100644 --- a/shell/browser/api/electron_api_session.h +++ b/shell/browser/api/electron_api_session.h @@ -60,18 +60,18 @@ class ElectronBrowserContext; namespace api { -class Session : public gin::Wrappable, - public gin_helper::Pinnable, - public gin_helper::Constructible, - public gin_helper::EventEmitterMixin, - public gin_helper::CleanedUpAtExit, +class Session final : public gin::Wrappable, + public gin_helper::Pinnable, + public gin_helper::Constructible, + public gin_helper::EventEmitterMixin, + public gin_helper::CleanedUpAtExit, #if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER) - private SpellcheckHunspellDictionary::Observer, + private SpellcheckHunspellDictionary::Observer, #endif #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) - private extensions::ExtensionRegistryObserver, + private extensions::ExtensionRegistryObserver, #endif - private content::DownloadManager::Observer { + private content::DownloadManager::Observer { public: // Gets or creates Session from the |browser_context|. static gin::Handle CreateFrom( diff --git a/shell/browser/api/electron_api_system_preferences.h b/shell/browser/api/electron_api_system_preferences.h index f5021242a02..100d77b8a3b 100644 --- a/shell/browser/api/electron_api_system_preferences.h +++ b/shell/browser/api/electron_api_system_preferences.h @@ -37,7 +37,7 @@ enum class NotificationCenterKind { }; #endif -class SystemPreferences +class SystemPreferences final : public gin::Wrappable, public gin_helper::EventEmitterMixin #if BUILDFLAG(IS_WIN) diff --git a/shell/browser/api/electron_api_tray.h b/shell/browser/api/electron_api_tray.h index 8f3433d33ae..fbcb908d044 100644 --- a/shell/browser/api/electron_api_tray.h +++ b/shell/browser/api/electron_api_tray.h @@ -38,12 +38,12 @@ namespace electron::api { class Menu; -class Tray : public gin::Wrappable, - public gin_helper::EventEmitterMixin, - public gin_helper::Constructible, - public gin_helper::CleanedUpAtExit, - public gin_helper::Pinnable, - private TrayIconObserver { +class Tray final : public gin::Wrappable, + public gin_helper::EventEmitterMixin, + public gin_helper::Constructible, + public gin_helper::CleanedUpAtExit, + public gin_helper::Pinnable, + private TrayIconObserver { public: // gin_helper::Constructible static gin::Handle New(gin_helper::ErrorThrower thrower, diff --git a/shell/browser/api/electron_api_utility_process.h b/shell/browser/api/electron_api_utility_process.h index 767252d54fc..2e37157c85a 100644 --- a/shell/browser/api/electron_api_utility_process.h +++ b/shell/browser/api/electron_api_utility_process.h @@ -39,7 +39,7 @@ class Connector; namespace electron::api { -class UtilityProcessWrapper +class UtilityProcessWrapper final : public gin::Wrappable, public gin_helper::Pinnable, public gin_helper::EventEmitterMixin, diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index a54ba3da246..93f0cd25aab 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -1902,7 +1902,7 @@ namespace { // This object wraps the InvokeCallback so that if it gets GC'd by V8, we can // still call the callback and send an error. Not doing so causes a Mojo DCHECK, // since Mojo requires callbacks to be called before they are destroyed. -class ReplyChannel : public gin::Wrappable { +class ReplyChannel final : public gin::Wrappable { public: using InvokeCallback = electron::mojom::ElectronApiIPC::InvokeCallback; static gin::Handle Create(v8::Isolate* isolate, diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index 850f9de729d..20c96abdd1a 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -110,19 +110,19 @@ class BaseWindow; class FrameSubscriber; // Wrapper around the content::WebContents. -class WebContents : public ExclusiveAccessContext, - public gin::Wrappable, - public gin_helper::EventEmitterMixin, - public gin_helper::Constructible, - public gin_helper::Pinnable, - public gin_helper::CleanedUpAtExit, - public content::WebContentsObserver, - public content::WebContentsDelegate, - private content::RenderWidgetHost::InputEventObserver, - public content::JavaScriptDialogManager, - public InspectableWebContentsDelegate, - public InspectableWebContentsViewDelegate, - public BackgroundThrottlingSource { +class WebContents final : public ExclusiveAccessContext, + public gin::Wrappable, + public gin_helper::EventEmitterMixin, + public gin_helper::Constructible, + public gin_helper::Pinnable, + public gin_helper::CleanedUpAtExit, + public content::WebContentsObserver, + public content::WebContentsDelegate, + private content::RenderWidgetHost::InputEventObserver, + public content::JavaScriptDialogManager, + public InspectableWebContentsDelegate, + public InspectableWebContentsViewDelegate, + public BackgroundThrottlingSource { public: enum class Type { kBackgroundPage, // An extension background page. diff --git a/shell/browser/api/electron_api_web_frame_main.h b/shell/browser/api/electron_api_web_frame_main.h index c4552b03a89..ec86f3edcc1 100644 --- a/shell/browser/api/electron_api_web_frame_main.h +++ b/shell/browser/api/electron_api_web_frame_main.h @@ -38,10 +38,10 @@ namespace electron::api { class WebContents; // Bindings for accessing frames from the main process. -class WebFrameMain : public gin::Wrappable, - public gin_helper::EventEmitterMixin, - public gin_helper::Pinnable, - public gin_helper::Constructible { +class WebFrameMain final : public gin::Wrappable, + public gin_helper::EventEmitterMixin, + public gin_helper::Pinnable, + public gin_helper::Constructible { public: // Create a new WebFrameMain and return the V8 wrapper of it. static gin::Handle New(v8::Isolate* isolate); diff --git a/shell/browser/api/electron_api_web_request.h b/shell/browser/api/electron_api_web_request.h index 7a0add857f4..d7a78c3e591 100644 --- a/shell/browser/api/electron_api_web_request.h +++ b/shell/browser/api/electron_api_web_request.h @@ -31,7 +31,8 @@ class Handle; namespace electron::api { -class WebRequest : public gin::Wrappable, public WebRequestAPI { +class WebRequest final : public gin::Wrappable, + public WebRequestAPI { public: // Return the WebRequest object attached to |browser_context|, create if there // is no one. diff --git a/shell/browser/api/message_port.h b/shell/browser/api/message_port.h index ce4bde2a64d..1a2c7ff52b4 100644 --- a/shell/browser/api/message_port.h +++ b/shell/browser/api/message_port.h @@ -27,9 +27,9 @@ class Connector; namespace electron { // A non-blink version of blink::MessagePort. -class MessagePort : public gin::Wrappable, - public gin_helper::CleanedUpAtExit, - public mojo::MessageReceiver { +class MessagePort final : public gin::Wrappable, + public gin_helper::CleanedUpAtExit, + public mojo::MessageReceiver { public: ~MessagePort() override; static gin::Handle Create(v8::Isolate* isolate); diff --git a/shell/common/api/electron_api_native_image.h b/shell/common/api/electron_api_native_image.h index 94fc3cc5c0f..3b82956f826 100644 --- a/shell/common/api/electron_api_native_image.h +++ b/shell/common/api/electron_api_native_image.h @@ -45,7 +45,7 @@ class ErrorThrower; namespace electron::api { -class NativeImage : public gin::Wrappable { +class NativeImage final : public gin::Wrappable { public: NativeImage(v8::Isolate* isolate, const gfx::Image& image); #if BUILDFLAG(IS_WIN) diff --git a/shell/common/api/electron_api_url_loader.cc b/shell/common/api/electron_api_url_loader.cc index 20551a27bb8..2c7e546b5f9 100644 --- a/shell/common/api/electron_api_url_loader.cc +++ b/shell/common/api/electron_api_url_loader.cc @@ -162,8 +162,9 @@ class BufferDataSource : public mojo::DataPipeProducer::DataSource { std::vector buffer_; }; -class JSChunkedDataPipeGetter : public gin::Wrappable, - public network::mojom::ChunkedDataPipeGetter { +class JSChunkedDataPipeGetter final + : public gin::Wrappable, + public network::mojom::ChunkedDataPipeGetter { public: static gin::Handle Create( v8::Isolate* isolate, diff --git a/shell/common/api/electron_api_url_loader.h b/shell/common/api/electron_api_url_loader.h index b78f9e3d1de..98b2c567015 100644 --- a/shell/common/api/electron_api_url_loader.h +++ b/shell/common/api/electron_api_url_loader.h @@ -47,7 +47,7 @@ class ElectronBrowserContext; namespace electron::api { /** Wraps a SimpleURLLoader to make it usable from JavaScript */ -class SimpleURLLoaderWrapper +class SimpleURLLoaderWrapper final : public gin::Wrappable, public gin_helper::EventEmitterMixin, private network::SimpleURLLoaderStreamConsumer, diff --git a/shell/common/gin_converters/net_converter.cc b/shell/common/gin_converters/net_converter.cc index 47a4ffb52f1..7a41afd470b 100644 --- a/shell/common/gin_converters/net_converter.cc +++ b/shell/common/gin_converters/net_converter.cc @@ -253,7 +253,7 @@ bool Converter::FromV8(v8::Isolate* isolate, namespace { -class ChunkedDataPipeReadableStream +class ChunkedDataPipeReadableStream final : public gin::Wrappable { public: static gin::Handle Create( diff --git a/shell/common/gin_helper/event.h b/shell/common/gin_helper/event.h index 7f04d27edbb..389f1d84acd 100644 --- a/shell/common/gin_helper/event.h +++ b/shell/common/gin_helper/event.h @@ -23,8 +23,8 @@ class ObjectTemplate; namespace gin_helper::internal { -class Event : public gin::Wrappable, - public gin_helper::Constructible { +class Event final : public gin::Wrappable, + public gin_helper::Constructible { public: // gin_helper::Constructible static gin::Handle New(v8::Isolate* isolate); diff --git a/shell/renderer/api/electron_api_ipc_renderer.cc b/shell/renderer/api/electron_api_ipc_renderer.cc index bf8867a31ec..35dab4c4c54 100644 --- a/shell/renderer/api/electron_api_ipc_renderer.cc +++ b/shell/renderer/api/electron_api_ipc_renderer.cc @@ -40,8 +40,8 @@ RenderFrame* GetCurrentRenderFrame() { return RenderFrame::FromWebFrame(frame); } -class IPCRenderer : public gin::Wrappable, - private content::RenderFrameObserver { +class IPCRenderer final : public gin::Wrappable, + private content::RenderFrameObserver { public: static gin::WrapperInfo kWrapperInfo; diff --git a/shell/renderer/api/electron_api_web_frame.cc b/shell/renderer/api/electron_api_web_frame.cc index 495ddf4b5ec..2750e17a435 100644 --- a/shell/renderer/api/electron_api_web_frame.cc +++ b/shell/renderer/api/electron_api_web_frame.cc @@ -326,8 +326,8 @@ class SpellCheckerHolder final : private content::RenderFrameObserver { std::unique_ptr spell_check_client_; }; -class WebFrameRenderer : public gin::Wrappable, - private content::RenderFrameObserver { +class WebFrameRenderer final : public gin::Wrappable, + private content::RenderFrameObserver { public: static gin::WrapperInfo kWrapperInfo; diff --git a/shell/services/node/parent_port.h b/shell/services/node/parent_port.h index 082d47a2efb..20f6adc5b13 100644 --- a/shell/services/node/parent_port.h +++ b/shell/services/node/parent_port.h @@ -30,8 +30,8 @@ namespace electron { // There is only a single instance of this class // for the lifetime of a Utility Process which // also means that GC lifecycle is ignored by this class. -class ParentPort : public gin::Wrappable, - public mojo::MessageReceiver { +class ParentPort final : public gin::Wrappable, + public mojo::MessageReceiver { public: static ParentPort* GetInstance(); static gin::Handle Create(v8::Isolate* isolate);