refactor: declare gin::Wrapper subclasses as final (#43565)
As per the gin docs: "Wrappable<T> explicitly does not support further subclassing of T. Subclasses of Wrappable<T> should be declared final." Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
f30c9120a1
commit
e92eb210bb
35 changed files with 106 additions and 103 deletions
|
@ -57,7 +57,7 @@ enum class JumpListResult : int;
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
class App : public ElectronBrowserClient::Delegate,
|
class App final : public ElectronBrowserClient::Delegate,
|
||||||
public gin::Wrappable<App>,
|
public gin::Wrappable<App>,
|
||||||
public gin_helper::EventEmitterMixin<App>,
|
public gin_helper::EventEmitterMixin<App>,
|
||||||
private BrowserObserver,
|
private BrowserObserver,
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Handle;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class AutoUpdater : public gin::Wrappable<AutoUpdater>,
|
class AutoUpdater final : public gin::Wrappable<AutoUpdater>,
|
||||||
public gin_helper::EventEmitterMixin<AutoUpdater>,
|
public gin_helper::EventEmitterMixin<AutoUpdater>,
|
||||||
public auto_updater::Delegate,
|
public auto_updater::Delegate,
|
||||||
private WindowListObserver {
|
private WindowListObserver {
|
||||||
|
|
|
@ -31,7 +31,7 @@ class ElectronBrowserContext;
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
class Cookies : public gin::Wrappable<Cookies>,
|
class Cookies final : public gin::Wrappable<Cookies>,
|
||||||
public gin_helper::EventEmitterMixin<Cookies> {
|
public gin_helper::EventEmitterMixin<Cookies> {
|
||||||
public:
|
public:
|
||||||
static gin::Handle<Cookies> Create(v8::Isolate* isolate,
|
static gin::Handle<Cookies> Create(v8::Isolate* isolate,
|
||||||
|
|
|
@ -20,7 +20,7 @@ class Handle;
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
// Retains reference to the data pipe.
|
// Retains reference to the data pipe.
|
||||||
class DataPipeHolder : public gin::Wrappable<DataPipeHolder> {
|
class DataPipeHolder final : public gin::Wrappable<DataPipeHolder> {
|
||||||
public:
|
public:
|
||||||
// gin::Wrappable
|
// gin::Wrappable
|
||||||
static gin::WrapperInfo kWrapperInfo;
|
static gin::WrapperInfo kWrapperInfo;
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Promise;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class Debugger : public gin::Wrappable<Debugger>,
|
class Debugger final : public gin::Wrappable<Debugger>,
|
||||||
public gin_helper::EventEmitterMixin<Debugger>,
|
public gin_helper::EventEmitterMixin<Debugger>,
|
||||||
public content::DevToolsAgentHostClient,
|
public content::DevToolsAgentHostClient,
|
||||||
private content::WebContentsObserver {
|
private content::WebContentsObserver {
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Handle;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class DesktopCapturer : public gin::Wrappable<DesktopCapturer>,
|
class DesktopCapturer final : public gin::Wrappable<DesktopCapturer>,
|
||||||
public gin_helper::Pinnable<DesktopCapturer>,
|
public gin_helper::Pinnable<DesktopCapturer>,
|
||||||
private DesktopMediaListObserver {
|
private DesktopMediaListObserver {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Handle;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class DownloadItem : public gin::Wrappable<DownloadItem>,
|
class DownloadItem final : public gin::Wrappable<DownloadItem>,
|
||||||
public gin_helper::Pinnable<DownloadItem>,
|
public gin_helper::Pinnable<DownloadItem>,
|
||||||
public gin_helper::EventEmitterMixin<DownloadItem>,
|
public gin_helper::EventEmitterMixin<DownloadItem>,
|
||||||
private download::DownloadItem::Observer {
|
private download::DownloadItem::Observer {
|
||||||
|
|
|
@ -20,7 +20,8 @@ class Handle;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class GlobalShortcut : private extensions::GlobalShortcutListener::Observer,
|
class GlobalShortcut final
|
||||||
|
: private extensions::GlobalShortcutListener::Observer,
|
||||||
public gin::Wrappable<GlobalShortcut> {
|
public gin::Wrappable<GlobalShortcut> {
|
||||||
public:
|
public:
|
||||||
static gin::Handle<GlobalShortcut> Create(v8::Isolate* isolate);
|
static gin::Handle<GlobalShortcut> Create(v8::Isolate* isolate);
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Handle;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class InAppPurchase : public gin::Wrappable<InAppPurchase>,
|
class InAppPurchase final : public gin::Wrappable<InAppPurchase>,
|
||||||
public gin_helper::EventEmitterMixin<InAppPurchase>,
|
public gin_helper::EventEmitterMixin<InAppPurchase>,
|
||||||
private in_app_purchase::TransactionObserver {
|
private in_app_purchase::TransactionObserver {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -18,7 +18,7 @@ class handle;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class NativeTheme : public gin::Wrappable<NativeTheme>,
|
class NativeTheme final : public gin::Wrappable<NativeTheme>,
|
||||||
public gin_helper::EventEmitterMixin<NativeTheme>,
|
public gin_helper::EventEmitterMixin<NativeTheme>,
|
||||||
private ui::NativeThemeObserver {
|
private ui::NativeThemeObserver {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -35,7 +35,7 @@ class ElectronBrowserContext;
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
// The code is referenced from the net_log::NetExportFileWriter class.
|
// The code is referenced from the net_log::NetExportFileWriter class.
|
||||||
class NetLog : public gin::Wrappable<NetLog> {
|
class NetLog final : public gin::Wrappable<NetLog> {
|
||||||
public:
|
public:
|
||||||
static gin::Handle<NetLog> Create(v8::Isolate* isolate,
|
static gin::Handle<NetLog> Create(v8::Isolate* isolate,
|
||||||
ElectronBrowserContext* browser_context);
|
ElectronBrowserContext* browser_context);
|
||||||
|
|
|
@ -30,7 +30,7 @@ class ErrorThrower;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class Notification : public gin::Wrappable<Notification>,
|
class Notification final : public gin::Wrappable<Notification>,
|
||||||
public gin_helper::EventEmitterMixin<Notification>,
|
public gin_helper::EventEmitterMixin<Notification>,
|
||||||
public gin_helper::Constructible<Notification>,
|
public gin_helper::Constructible<Notification>,
|
||||||
public gin_helper::CleanedUpAtExit,
|
public gin_helper::CleanedUpAtExit,
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class PowerMonitor : public gin::Wrappable<PowerMonitor>,
|
class PowerMonitor final : public gin::Wrappable<PowerMonitor>,
|
||||||
public gin_helper::EventEmitterMixin<PowerMonitor>,
|
public gin_helper::EventEmitterMixin<PowerMonitor>,
|
||||||
public gin_helper::Pinnable<PowerMonitor>,
|
public gin_helper::Pinnable<PowerMonitor>,
|
||||||
private base::PowerStateObserver,
|
private base::PowerStateObserver,
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Handle;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class PowerSaveBlocker : public gin::Wrappable<PowerSaveBlocker> {
|
class PowerSaveBlocker final : public gin::Wrappable<PowerSaveBlocker> {
|
||||||
public:
|
public:
|
||||||
static gin::Handle<PowerSaveBlocker> Create(v8::Isolate* isolate);
|
static gin::Handle<PowerSaveBlocker> Create(v8::Isolate* isolate);
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ enum class ProtocolError {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Protocol implementation based on network services.
|
// Protocol implementation based on network services.
|
||||||
class Protocol : public gin::Wrappable<Protocol>,
|
class Protocol final : public gin::Wrappable<Protocol>,
|
||||||
public gin_helper::Constructible<Protocol> {
|
public gin_helper::Constructible<Protocol> {
|
||||||
public:
|
public:
|
||||||
static gin::Handle<Protocol> Create(v8::Isolate* isolate,
|
static gin::Handle<Protocol> Create(v8::Isolate* isolate,
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Handle;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class PushNotifications
|
class PushNotifications final
|
||||||
: public ElectronBrowserClient::Delegate,
|
: public ElectronBrowserClient::Delegate,
|
||||||
public gin::Wrappable<PushNotifications>,
|
public gin::Wrappable<PushNotifications>,
|
||||||
public gin_helper::EventEmitterMixin<PushNotifications>,
|
public gin_helper::EventEmitterMixin<PushNotifications>,
|
||||||
|
|
|
@ -25,7 +25,7 @@ class ErrorThrower;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class Screen : public gin::Wrappable<Screen>,
|
class Screen final : public gin::Wrappable<Screen>,
|
||||||
public gin_helper::EventEmitterMixin<Screen>,
|
public gin_helper::EventEmitterMixin<Screen>,
|
||||||
private display::DisplayObserver {
|
private display::DisplayObserver {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -22,7 +22,7 @@ class ElectronBrowserContext;
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
class ServiceWorkerContext
|
class ServiceWorkerContext final
|
||||||
: public gin::Wrappable<ServiceWorkerContext>,
|
: public gin::Wrappable<ServiceWorkerContext>,
|
||||||
public gin_helper::EventEmitterMixin<ServiceWorkerContext>,
|
public gin_helper::EventEmitterMixin<ServiceWorkerContext>,
|
||||||
private content::ServiceWorkerContextObserver {
|
private content::ServiceWorkerContextObserver {
|
||||||
|
|
|
@ -60,7 +60,7 @@ class ElectronBrowserContext;
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
class Session : public gin::Wrappable<Session>,
|
class Session final : public gin::Wrappable<Session>,
|
||||||
public gin_helper::Pinnable<Session>,
|
public gin_helper::Pinnable<Session>,
|
||||||
public gin_helper::Constructible<Session>,
|
public gin_helper::Constructible<Session>,
|
||||||
public gin_helper::EventEmitterMixin<Session>,
|
public gin_helper::EventEmitterMixin<Session>,
|
||||||
|
|
|
@ -37,7 +37,7 @@ enum class NotificationCenterKind {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class SystemPreferences
|
class SystemPreferences final
|
||||||
: public gin::Wrappable<SystemPreferences>,
|
: public gin::Wrappable<SystemPreferences>,
|
||||||
public gin_helper::EventEmitterMixin<SystemPreferences>
|
public gin_helper::EventEmitterMixin<SystemPreferences>
|
||||||
#if BUILDFLAG(IS_WIN)
|
#if BUILDFLAG(IS_WIN)
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace electron::api {
|
||||||
|
|
||||||
class Menu;
|
class Menu;
|
||||||
|
|
||||||
class Tray : public gin::Wrappable<Tray>,
|
class Tray final : public gin::Wrappable<Tray>,
|
||||||
public gin_helper::EventEmitterMixin<Tray>,
|
public gin_helper::EventEmitterMixin<Tray>,
|
||||||
public gin_helper::Constructible<Tray>,
|
public gin_helper::Constructible<Tray>,
|
||||||
public gin_helper::CleanedUpAtExit,
|
public gin_helper::CleanedUpAtExit,
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Connector;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class UtilityProcessWrapper
|
class UtilityProcessWrapper final
|
||||||
: public gin::Wrappable<UtilityProcessWrapper>,
|
: public gin::Wrappable<UtilityProcessWrapper>,
|
||||||
public gin_helper::Pinnable<UtilityProcessWrapper>,
|
public gin_helper::Pinnable<UtilityProcessWrapper>,
|
||||||
public gin_helper::EventEmitterMixin<UtilityProcessWrapper>,
|
public gin_helper::EventEmitterMixin<UtilityProcessWrapper>,
|
||||||
|
|
|
@ -1887,7 +1887,7 @@ namespace {
|
||||||
// This object wraps the InvokeCallback so that if it gets GC'd by V8, we can
|
// 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,
|
// 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.
|
// since Mojo requires callbacks to be called before they are destroyed.
|
||||||
class ReplyChannel : public gin::Wrappable<ReplyChannel> {
|
class ReplyChannel final : public gin::Wrappable<ReplyChannel> {
|
||||||
public:
|
public:
|
||||||
using InvokeCallback = electron::mojom::ElectronApiIPC::InvokeCallback;
|
using InvokeCallback = electron::mojom::ElectronApiIPC::InvokeCallback;
|
||||||
static gin::Handle<ReplyChannel> Create(v8::Isolate* isolate,
|
static gin::Handle<ReplyChannel> Create(v8::Isolate* isolate,
|
||||||
|
|
|
@ -109,7 +109,7 @@ class BaseWindow;
|
||||||
class FrameSubscriber;
|
class FrameSubscriber;
|
||||||
|
|
||||||
// Wrapper around the content::WebContents.
|
// Wrapper around the content::WebContents.
|
||||||
class WebContents : public ExclusiveAccessContext,
|
class WebContents final : public ExclusiveAccessContext,
|
||||||
public gin::Wrappable<WebContents>,
|
public gin::Wrappable<WebContents>,
|
||||||
public gin_helper::EventEmitterMixin<WebContents>,
|
public gin_helper::EventEmitterMixin<WebContents>,
|
||||||
public gin_helper::Constructible<WebContents>,
|
public gin_helper::Constructible<WebContents>,
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace electron::api {
|
||||||
class WebContents;
|
class WebContents;
|
||||||
|
|
||||||
// Bindings for accessing frames from the main process.
|
// Bindings for accessing frames from the main process.
|
||||||
class WebFrameMain : public gin::Wrappable<WebFrameMain>,
|
class WebFrameMain final : public gin::Wrappable<WebFrameMain>,
|
||||||
public gin_helper::EventEmitterMixin<WebFrameMain>,
|
public gin_helper::EventEmitterMixin<WebFrameMain>,
|
||||||
public gin_helper::Pinnable<WebFrameMain>,
|
public gin_helper::Pinnable<WebFrameMain>,
|
||||||
public gin_helper::Constructible<WebFrameMain> {
|
public gin_helper::Constructible<WebFrameMain> {
|
||||||
|
|
|
@ -31,7 +31,8 @@ class Handle;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class WebRequest : public gin::Wrappable<WebRequest>, public WebRequestAPI {
|
class WebRequest final : public gin::Wrappable<WebRequest>,
|
||||||
|
public WebRequestAPI {
|
||||||
public:
|
public:
|
||||||
// Return the WebRequest object attached to |browser_context|, create if there
|
// Return the WebRequest object attached to |browser_context|, create if there
|
||||||
// is no one.
|
// is no one.
|
||||||
|
|
|
@ -27,7 +27,7 @@ class Connector;
|
||||||
namespace electron {
|
namespace electron {
|
||||||
|
|
||||||
// A non-blink version of blink::MessagePort.
|
// A non-blink version of blink::MessagePort.
|
||||||
class MessagePort : public gin::Wrappable<MessagePort>,
|
class MessagePort final : public gin::Wrappable<MessagePort>,
|
||||||
public gin_helper::CleanedUpAtExit,
|
public gin_helper::CleanedUpAtExit,
|
||||||
public mojo::MessageReceiver {
|
public mojo::MessageReceiver {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -45,7 +45,7 @@ class ErrorThrower;
|
||||||
|
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
class NativeImage : public gin::Wrappable<NativeImage> {
|
class NativeImage final : public gin::Wrappable<NativeImage> {
|
||||||
public:
|
public:
|
||||||
NativeImage(v8::Isolate* isolate, const gfx::Image& image);
|
NativeImage(v8::Isolate* isolate, const gfx::Image& image);
|
||||||
#if BUILDFLAG(IS_WIN)
|
#if BUILDFLAG(IS_WIN)
|
||||||
|
|
|
@ -162,7 +162,8 @@ class BufferDataSource : public mojo::DataPipeProducer::DataSource {
|
||||||
std::vector<char> buffer_;
|
std::vector<char> buffer_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class JSChunkedDataPipeGetter : public gin::Wrappable<JSChunkedDataPipeGetter>,
|
class JSChunkedDataPipeGetter final
|
||||||
|
: public gin::Wrappable<JSChunkedDataPipeGetter>,
|
||||||
public network::mojom::ChunkedDataPipeGetter {
|
public network::mojom::ChunkedDataPipeGetter {
|
||||||
public:
|
public:
|
||||||
static gin::Handle<JSChunkedDataPipeGetter> Create(
|
static gin::Handle<JSChunkedDataPipeGetter> Create(
|
||||||
|
|
|
@ -47,7 +47,7 @@ class ElectronBrowserContext;
|
||||||
namespace electron::api {
|
namespace electron::api {
|
||||||
|
|
||||||
/** Wraps a SimpleURLLoader to make it usable from JavaScript */
|
/** Wraps a SimpleURLLoader to make it usable from JavaScript */
|
||||||
class SimpleURLLoaderWrapper
|
class SimpleURLLoaderWrapper final
|
||||||
: public gin::Wrappable<SimpleURLLoaderWrapper>,
|
: public gin::Wrappable<SimpleURLLoaderWrapper>,
|
||||||
public gin_helper::EventEmitterMixin<SimpleURLLoaderWrapper>,
|
public gin_helper::EventEmitterMixin<SimpleURLLoaderWrapper>,
|
||||||
private network::SimpleURLLoaderStreamConsumer,
|
private network::SimpleURLLoaderStreamConsumer,
|
||||||
|
|
|
@ -253,7 +253,7 @@ bool Converter<net::HttpRequestHeaders>::FromV8(v8::Isolate* isolate,
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class ChunkedDataPipeReadableStream
|
class ChunkedDataPipeReadableStream final
|
||||||
: public gin::Wrappable<ChunkedDataPipeReadableStream> {
|
: public gin::Wrappable<ChunkedDataPipeReadableStream> {
|
||||||
public:
|
public:
|
||||||
static gin::Handle<ChunkedDataPipeReadableStream> Create(
|
static gin::Handle<ChunkedDataPipeReadableStream> Create(
|
||||||
|
|
|
@ -23,7 +23,7 @@ class ObjectTemplate;
|
||||||
|
|
||||||
namespace gin_helper::internal {
|
namespace gin_helper::internal {
|
||||||
|
|
||||||
class Event : public gin::Wrappable<Event>,
|
class Event final : public gin::Wrappable<Event>,
|
||||||
public gin_helper::Constructible<Event> {
|
public gin_helper::Constructible<Event> {
|
||||||
public:
|
public:
|
||||||
// gin_helper::Constructible
|
// gin_helper::Constructible
|
||||||
|
|
|
@ -40,7 +40,7 @@ RenderFrame* GetCurrentRenderFrame() {
|
||||||
return RenderFrame::FromWebFrame(frame);
|
return RenderFrame::FromWebFrame(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
class IPCRenderer : public gin::Wrappable<IPCRenderer>,
|
class IPCRenderer final : public gin::Wrappable<IPCRenderer>,
|
||||||
private content::RenderFrameObserver {
|
private content::RenderFrameObserver {
|
||||||
public:
|
public:
|
||||||
static gin::WrapperInfo kWrapperInfo;
|
static gin::WrapperInfo kWrapperInfo;
|
||||||
|
|
|
@ -326,7 +326,7 @@ class SpellCheckerHolder final : private content::RenderFrameObserver {
|
||||||
std::unique_ptr<SpellCheckClient> spell_check_client_;
|
std::unique_ptr<SpellCheckClient> spell_check_client_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class WebFrameRenderer : public gin::Wrappable<WebFrameRenderer>,
|
class WebFrameRenderer final : public gin::Wrappable<WebFrameRenderer>,
|
||||||
private content::RenderFrameObserver {
|
private content::RenderFrameObserver {
|
||||||
public:
|
public:
|
||||||
static gin::WrapperInfo kWrapperInfo;
|
static gin::WrapperInfo kWrapperInfo;
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace electron {
|
||||||
// There is only a single instance of this class
|
// There is only a single instance of this class
|
||||||
// for the lifetime of a Utility Process which
|
// for the lifetime of a Utility Process which
|
||||||
// also means that GC lifecycle is ignored by this class.
|
// also means that GC lifecycle is ignored by this class.
|
||||||
class ParentPort : public gin::Wrappable<ParentPort>,
|
class ParentPort final : public gin::Wrappable<ParentPort>,
|
||||||
public mojo::MessageReceiver {
|
public mojo::MessageReceiver {
|
||||||
public:
|
public:
|
||||||
static ParentPort* GetInstance();
|
static ParentPort* GetInstance();
|
||||||
|
|
Loading…
Add table
Reference in a new issue