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,12 +57,12 @@ enum class JumpListResult : int; | |||
| 
 | ||||
| namespace api { | ||||
| 
 | ||||
| class App : public ElectronBrowserClient::Delegate, | ||||
|             public gin::Wrappable<App>, | ||||
|             public gin_helper::EventEmitterMixin<App>, | ||||
|             private BrowserObserver, | ||||
|             private content::GpuDataManagerObserver, | ||||
|             private content::BrowserChildProcessObserver { | ||||
| class App final : public ElectronBrowserClient::Delegate, | ||||
|                   public gin::Wrappable<App>, | ||||
|                   public gin_helper::EventEmitterMixin<App>, | ||||
|                   private BrowserObserver, | ||||
|                   private content::GpuDataManagerObserver, | ||||
|                   private content::BrowserChildProcessObserver { | ||||
|  public: | ||||
|   using FileIconCallback = | ||||
|       base::RepeatingCallback<void(v8::Local<v8::Value>, const gfx::Image&)>; | ||||
|  |  | |||
|  | @ -19,10 +19,10 @@ class Handle; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class AutoUpdater : public gin::Wrappable<AutoUpdater>, | ||||
|                     public gin_helper::EventEmitterMixin<AutoUpdater>, | ||||
|                     public auto_updater::Delegate, | ||||
|                     private WindowListObserver { | ||||
| class AutoUpdater final : public gin::Wrappable<AutoUpdater>, | ||||
|                           public gin_helper::EventEmitterMixin<AutoUpdater>, | ||||
|                           public auto_updater::Delegate, | ||||
|                           private WindowListObserver { | ||||
|  public: | ||||
|   static gin::Handle<AutoUpdater> Create(v8::Isolate* isolate); | ||||
| 
 | ||||
|  |  | |||
|  | @ -31,8 +31,8 @@ class ElectronBrowserContext; | |||
| 
 | ||||
| namespace api { | ||||
| 
 | ||||
| class Cookies : public gin::Wrappable<Cookies>, | ||||
|                 public gin_helper::EventEmitterMixin<Cookies> { | ||||
| class Cookies final : public gin::Wrappable<Cookies>, | ||||
|                       public gin_helper::EventEmitterMixin<Cookies> { | ||||
|  public: | ||||
|   static gin::Handle<Cookies> Create(v8::Isolate* isolate, | ||||
|                                      ElectronBrowserContext* browser_context); | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ class Handle; | |||
| namespace electron::api { | ||||
| 
 | ||||
| // Retains reference to the data pipe.
 | ||||
| class DataPipeHolder : public gin::Wrappable<DataPipeHolder> { | ||||
| class DataPipeHolder final : public gin::Wrappable<DataPipeHolder> { | ||||
|  public: | ||||
|   // gin::Wrappable
 | ||||
|   static gin::WrapperInfo kWrapperInfo; | ||||
|  |  | |||
|  | @ -32,10 +32,10 @@ class Promise; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class Debugger : public gin::Wrappable<Debugger>, | ||||
|                  public gin_helper::EventEmitterMixin<Debugger>, | ||||
|                  public content::DevToolsAgentHostClient, | ||||
|                  private content::WebContentsObserver { | ||||
| class Debugger final : public gin::Wrappable<Debugger>, | ||||
|                        public gin_helper::EventEmitterMixin<Debugger>, | ||||
|                        public content::DevToolsAgentHostClient, | ||||
|                        private content::WebContentsObserver { | ||||
|  public: | ||||
|   static gin::Handle<Debugger> Create(v8::Isolate* isolate, | ||||
|                                       content::WebContents* web_contents); | ||||
|  |  | |||
|  | @ -21,9 +21,9 @@ class Handle; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class DesktopCapturer : public gin::Wrappable<DesktopCapturer>, | ||||
|                         public gin_helper::Pinnable<DesktopCapturer>, | ||||
|                         private DesktopMediaListObserver { | ||||
| class DesktopCapturer final : public gin::Wrappable<DesktopCapturer>, | ||||
|                               public gin_helper::Pinnable<DesktopCapturer>, | ||||
|                               private DesktopMediaListObserver { | ||||
|  public: | ||||
|   struct Source { | ||||
|     DesktopMediaList::Source media_list_source; | ||||
|  |  | |||
|  | @ -25,10 +25,10 @@ class Handle; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class DownloadItem : public gin::Wrappable<DownloadItem>, | ||||
|                      public gin_helper::Pinnable<DownloadItem>, | ||||
|                      public gin_helper::EventEmitterMixin<DownloadItem>, | ||||
|                      private download::DownloadItem::Observer { | ||||
| class DownloadItem final : public gin::Wrappable<DownloadItem>, | ||||
|                            public gin_helper::Pinnable<DownloadItem>, | ||||
|                            public gin_helper::EventEmitterMixin<DownloadItem>, | ||||
|                            private download::DownloadItem::Observer { | ||||
|  public: | ||||
|   static gin::Handle<DownloadItem> FromOrCreate(v8::Isolate* isolate, | ||||
|                                                 download::DownloadItem* item); | ||||
|  |  | |||
|  | @ -20,8 +20,9 @@ class Handle; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class GlobalShortcut : private extensions::GlobalShortcutListener::Observer, | ||||
|                        public gin::Wrappable<GlobalShortcut> { | ||||
| class GlobalShortcut final | ||||
|     : private extensions::GlobalShortcutListener::Observer, | ||||
|       public gin::Wrappable<GlobalShortcut> { | ||||
|  public: | ||||
|   static gin::Handle<GlobalShortcut> Create(v8::Isolate* isolate); | ||||
| 
 | ||||
|  |  | |||
|  | @ -22,9 +22,9 @@ class Handle; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class InAppPurchase : public gin::Wrappable<InAppPurchase>, | ||||
|                       public gin_helper::EventEmitterMixin<InAppPurchase>, | ||||
|                       private in_app_purchase::TransactionObserver { | ||||
| class InAppPurchase final : public gin::Wrappable<InAppPurchase>, | ||||
|                             public gin_helper::EventEmitterMixin<InAppPurchase>, | ||||
|                             private in_app_purchase::TransactionObserver { | ||||
|  public: | ||||
|   static gin::Handle<InAppPurchase> Create(v8::Isolate* isolate); | ||||
| 
 | ||||
|  |  | |||
|  | @ -18,9 +18,9 @@ class handle; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class NativeTheme : public gin::Wrappable<NativeTheme>, | ||||
|                     public gin_helper::EventEmitterMixin<NativeTheme>, | ||||
|                     private ui::NativeThemeObserver { | ||||
| class NativeTheme final : public gin::Wrappable<NativeTheme>, | ||||
|                           public gin_helper::EventEmitterMixin<NativeTheme>, | ||||
|                           private ui::NativeThemeObserver { | ||||
|  public: | ||||
|   static gin::Handle<NativeTheme> Create(v8::Isolate* isolate); | ||||
| 
 | ||||
|  |  | |||
|  | @ -35,7 +35,7 @@ class ElectronBrowserContext; | |||
| namespace api { | ||||
| 
 | ||||
| // The code is referenced from the net_log::NetExportFileWriter class.
 | ||||
| class NetLog : public gin::Wrappable<NetLog> { | ||||
| class NetLog final : public gin::Wrappable<NetLog> { | ||||
|  public: | ||||
|   static gin::Handle<NetLog> Create(v8::Isolate* isolate, | ||||
|                                     ElectronBrowserContext* browser_context); | ||||
|  |  | |||
|  | @ -30,11 +30,11 @@ class ErrorThrower; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class Notification : public gin::Wrappable<Notification>, | ||||
|                      public gin_helper::EventEmitterMixin<Notification>, | ||||
|                      public gin_helper::Constructible<Notification>, | ||||
|                      public gin_helper::CleanedUpAtExit, | ||||
|                      public NotificationDelegate { | ||||
| class Notification final : public gin::Wrappable<Notification>, | ||||
|                            public gin_helper::EventEmitterMixin<Notification>, | ||||
|                            public gin_helper::Constructible<Notification>, | ||||
|                            public gin_helper::CleanedUpAtExit, | ||||
|                            public NotificationDelegate { | ||||
|  public: | ||||
|   static bool IsSupported(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -17,12 +17,12 @@ | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class PowerMonitor : public gin::Wrappable<PowerMonitor>, | ||||
|                      public gin_helper::EventEmitterMixin<PowerMonitor>, | ||||
|                      public gin_helper::Pinnable<PowerMonitor>, | ||||
|                      private base::PowerStateObserver, | ||||
|                      private base::PowerSuspendObserver, | ||||
|                      private base::PowerThermalObserver { | ||||
| class PowerMonitor final : public gin::Wrappable<PowerMonitor>, | ||||
|                            public gin_helper::EventEmitterMixin<PowerMonitor>, | ||||
|                            public gin_helper::Pinnable<PowerMonitor>, | ||||
|                            private base::PowerStateObserver, | ||||
|                            private base::PowerSuspendObserver, | ||||
|                            private base::PowerThermalObserver { | ||||
|  public: | ||||
|   static v8::Local<v8::Value> Create(v8::Isolate* isolate); | ||||
| 
 | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ class Handle; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class PowerSaveBlocker : public gin::Wrappable<PowerSaveBlocker> { | ||||
| class PowerSaveBlocker final : public gin::Wrappable<PowerSaveBlocker> { | ||||
|  public: | ||||
|   static gin::Handle<PowerSaveBlocker> Create(v8::Isolate* isolate); | ||||
| 
 | ||||
|  |  | |||
|  | @ -45,8 +45,8 @@ enum class ProtocolError { | |||
| }; | ||||
| 
 | ||||
| // Protocol implementation based on network services.
 | ||||
| class Protocol : public gin::Wrappable<Protocol>, | ||||
|                  public gin_helper::Constructible<Protocol> { | ||||
| class Protocol final : public gin::Wrappable<Protocol>, | ||||
|                        public gin_helper::Constructible<Protocol> { | ||||
|  public: | ||||
|   static gin::Handle<Protocol> Create(v8::Isolate* isolate, | ||||
|                                       ElectronBrowserContext* browser_context); | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ class Handle; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class PushNotifications | ||||
| class PushNotifications final | ||||
|     : public ElectronBrowserClient::Delegate, | ||||
|       public gin::Wrappable<PushNotifications>, | ||||
|       public gin_helper::EventEmitterMixin<PushNotifications>, | ||||
|  |  | |||
|  | @ -25,9 +25,9 @@ class ErrorThrower; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class Screen : public gin::Wrappable<Screen>, | ||||
|                public gin_helper::EventEmitterMixin<Screen>, | ||||
|                private display::DisplayObserver { | ||||
| class Screen final : public gin::Wrappable<Screen>, | ||||
|                      public gin_helper::EventEmitterMixin<Screen>, | ||||
|                      private display::DisplayObserver { | ||||
|  public: | ||||
|   static v8::Local<v8::Value> Create(gin_helper::ErrorThrower error_thrower); | ||||
| 
 | ||||
|  |  | |||
|  | @ -22,7 +22,7 @@ class ElectronBrowserContext; | |||
| 
 | ||||
| namespace api { | ||||
| 
 | ||||
| class ServiceWorkerContext | ||||
| class ServiceWorkerContext final | ||||
|     : public gin::Wrappable<ServiceWorkerContext>, | ||||
|       public gin_helper::EventEmitterMixin<ServiceWorkerContext>, | ||||
|       private content::ServiceWorkerContextObserver { | ||||
|  |  | |||
|  | @ -60,18 +60,18 @@ class ElectronBrowserContext; | |||
| 
 | ||||
| namespace api { | ||||
| 
 | ||||
| class Session : public gin::Wrappable<Session>, | ||||
|                 public gin_helper::Pinnable<Session>, | ||||
|                 public gin_helper::Constructible<Session>, | ||||
|                 public gin_helper::EventEmitterMixin<Session>, | ||||
|                 public gin_helper::CleanedUpAtExit, | ||||
| class Session final : public gin::Wrappable<Session>, | ||||
|                       public gin_helper::Pinnable<Session>, | ||||
|                       public gin_helper::Constructible<Session>, | ||||
|                       public gin_helper::EventEmitterMixin<Session>, | ||||
|                       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<Session> CreateFrom( | ||||
|  |  | |||
|  | @ -37,7 +37,7 @@ enum class NotificationCenterKind { | |||
| }; | ||||
| #endif | ||||
| 
 | ||||
| class SystemPreferences | ||||
| class SystemPreferences final | ||||
|     : public gin::Wrappable<SystemPreferences>, | ||||
|       public gin_helper::EventEmitterMixin<SystemPreferences> | ||||
| #if BUILDFLAG(IS_WIN) | ||||
|  |  | |||
|  | @ -38,12 +38,12 @@ namespace electron::api { | |||
| 
 | ||||
| class Menu; | ||||
| 
 | ||||
| class Tray : public gin::Wrappable<Tray>, | ||||
|              public gin_helper::EventEmitterMixin<Tray>, | ||||
|              public gin_helper::Constructible<Tray>, | ||||
|              public gin_helper::CleanedUpAtExit, | ||||
|              public gin_helper::Pinnable<Tray>, | ||||
|              private TrayIconObserver { | ||||
| class Tray final : public gin::Wrappable<Tray>, | ||||
|                    public gin_helper::EventEmitterMixin<Tray>, | ||||
|                    public gin_helper::Constructible<Tray>, | ||||
|                    public gin_helper::CleanedUpAtExit, | ||||
|                    public gin_helper::Pinnable<Tray>, | ||||
|                    private TrayIconObserver { | ||||
|  public: | ||||
|   // gin_helper::Constructible
 | ||||
|   static gin::Handle<Tray> New(gin_helper::ErrorThrower thrower, | ||||
|  |  | |||
|  | @ -39,7 +39,7 @@ class Connector; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class UtilityProcessWrapper | ||||
| class UtilityProcessWrapper final | ||||
|     : public gin::Wrappable<UtilityProcessWrapper>, | ||||
|       public gin_helper::Pinnable<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
 | ||||
| // 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<ReplyChannel> { | ||||
| class ReplyChannel final : public gin::Wrappable<ReplyChannel> { | ||||
|  public: | ||||
|   using InvokeCallback = electron::mojom::ElectronApiIPC::InvokeCallback; | ||||
|   static gin::Handle<ReplyChannel> Create(v8::Isolate* isolate, | ||||
|  |  | |||
|  | @ -109,19 +109,19 @@ class BaseWindow; | |||
| class FrameSubscriber; | ||||
| 
 | ||||
| // Wrapper around the content::WebContents.
 | ||||
| class WebContents : public ExclusiveAccessContext, | ||||
|                     public gin::Wrappable<WebContents>, | ||||
|                     public gin_helper::EventEmitterMixin<WebContents>, | ||||
|                     public gin_helper::Constructible<WebContents>, | ||||
|                     public gin_helper::Pinnable<WebContents>, | ||||
|                     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<WebContents>, | ||||
|                           public gin_helper::EventEmitterMixin<WebContents>, | ||||
|                           public gin_helper::Constructible<WebContents>, | ||||
|                           public gin_helper::Pinnable<WebContents>, | ||||
|                           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.
 | ||||
|  |  | |||
|  | @ -38,10 +38,10 @@ namespace electron::api { | |||
| class WebContents; | ||||
| 
 | ||||
| // Bindings for accessing frames from the main process.
 | ||||
| class WebFrameMain : public gin::Wrappable<WebFrameMain>, | ||||
|                      public gin_helper::EventEmitterMixin<WebFrameMain>, | ||||
|                      public gin_helper::Pinnable<WebFrameMain>, | ||||
|                      public gin_helper::Constructible<WebFrameMain> { | ||||
| class WebFrameMain final : public gin::Wrappable<WebFrameMain>, | ||||
|                            public gin_helper::EventEmitterMixin<WebFrameMain>, | ||||
|                            public gin_helper::Pinnable<WebFrameMain>, | ||||
|                            public gin_helper::Constructible<WebFrameMain> { | ||||
|  public: | ||||
|   // Create a new WebFrameMain and return the V8 wrapper of it.
 | ||||
|   static gin::Handle<WebFrameMain> New(v8::Isolate* isolate); | ||||
|  |  | |||
|  | @ -31,7 +31,8 @@ class Handle; | |||
| 
 | ||||
| namespace electron::api { | ||||
| 
 | ||||
| class WebRequest : public gin::Wrappable<WebRequest>, public WebRequestAPI { | ||||
| class WebRequest final : public gin::Wrappable<WebRequest>, | ||||
|                          public WebRequestAPI { | ||||
|  public: | ||||
|   // Return the WebRequest object attached to |browser_context|, create if there
 | ||||
|   // is no one.
 | ||||
|  |  | |||
|  | @ -27,9 +27,9 @@ class Connector; | |||
| namespace electron { | ||||
| 
 | ||||
| // A non-blink version of blink::MessagePort.
 | ||||
| class MessagePort : public gin::Wrappable<MessagePort>, | ||||
|                     public gin_helper::CleanedUpAtExit, | ||||
|                     public mojo::MessageReceiver { | ||||
| class MessagePort final : public gin::Wrappable<MessagePort>, | ||||
|                           public gin_helper::CleanedUpAtExit, | ||||
|                           public mojo::MessageReceiver { | ||||
|  public: | ||||
|   ~MessagePort() override; | ||||
|   static gin::Handle<MessagePort> Create(v8::Isolate* isolate); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	![37223003+trop[bot]@users.noreply.github.com](/assets/img/avatar_default.png) trop[bot]
				trop[bot]