Title: [175355] trunk/Source/WebCore
Revision
175355
Author
[email protected]
Date
2014-10-29 16:28:55 -0700 (Wed, 29 Oct 2014)

Log Message

Clean up virtual functions in inspector/
https://bugs.webkit.org/show_bug.cgi?id=138190

Reviewed by Andreas Kling.

Clean up virtual functions in inspector/ by:
- Making virtual functions final when possible
- Making classes final when possible
- Explicitly marking functions / destructors as virtual when they are
  inherently virtual
- Making isXXX() virtual functions private on XXX classes to avoid
  unnecessary type checks

No new tests, no behavior change.

* inspector/InspectorApplicationCacheAgent.h:
(WebCore::InspectorApplicationCacheAgent::~InspectorApplicationCacheAgent): Deleted.
* inspector/InspectorCSSAgent.h:
* inspector/InspectorDOMAgent.h:
* inspector/InspectorDOMDebuggerAgent.h:
* inspector/InspectorDOMStorageAgent.h:
* inspector/InspectorDatabaseAgent.h:
* inspector/InspectorFrontendClientLocal.h:
* inspector/InspectorIndexedDBAgent.h:
* inspector/InspectorLayerTreeAgent.h:
* inspector/InspectorPageAgent.h:
* inspector/InspectorReplayAgent.h:
* inspector/InspectorResourceAgent.h:
* inspector/InspectorStyleSheet.h:
* inspector/InspectorTimelineAgent.h:
* inspector/InspectorWorkerAgent.h:
* inspector/PageConsoleAgent.h:
* inspector/WorkerInspectorController.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (175354 => 175355)


--- trunk/Source/WebCore/ChangeLog	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/ChangeLog	2014-10-29 23:28:55 UTC (rev 175355)
@@ -1,3 +1,39 @@
+2014-10-29  Chris Dumez  <[email protected]>
+
+        Clean up virtual functions in inspector/
+        https://bugs.webkit.org/show_bug.cgi?id=138190
+
+        Reviewed by Andreas Kling.
+
+        Clean up virtual functions in inspector/ by:
+        - Making virtual functions final when possible
+        - Making classes final when possible
+        - Explicitly marking functions / destructors as virtual when they are
+          inherently virtual
+        - Making isXXX() virtual functions private on XXX classes to avoid
+          unnecessary type checks
+
+        No new tests, no behavior change.
+
+        * inspector/InspectorApplicationCacheAgent.h:
+        (WebCore::InspectorApplicationCacheAgent::~InspectorApplicationCacheAgent): Deleted.
+        * inspector/InspectorCSSAgent.h:
+        * inspector/InspectorDOMAgent.h:
+        * inspector/InspectorDOMDebuggerAgent.h:
+        * inspector/InspectorDOMStorageAgent.h:
+        * inspector/InspectorDatabaseAgent.h:
+        * inspector/InspectorFrontendClientLocal.h:
+        * inspector/InspectorIndexedDBAgent.h:
+        * inspector/InspectorLayerTreeAgent.h:
+        * inspector/InspectorPageAgent.h:
+        * inspector/InspectorReplayAgent.h:
+        * inspector/InspectorResourceAgent.h:
+        * inspector/InspectorStyleSheet.h:
+        * inspector/InspectorTimelineAgent.h:
+        * inspector/InspectorWorkerAgent.h:
+        * inspector/PageConsoleAgent.h:
+        * inspector/WorkerInspectorController.h:
+
 2014-10-29  Andreas Kling  <[email protected]>
 
         Generalize dirtying of parent's line boxes when taking a renderer out of tree.

Modified: trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -49,11 +49,11 @@
 
 typedef String ErrorString;
 
-class InspectorApplicationCacheAgent : public InspectorAgentBase, public Inspector::InspectorApplicationCacheBackendDispatcherHandler {
+class InspectorApplicationCacheAgent final : public InspectorAgentBase, public Inspector::InspectorApplicationCacheBackendDispatcherHandler {
     WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); WTF_MAKE_FAST_ALLOCATED;
 public:
     InspectorApplicationCacheAgent(InstrumentingAgents*, InspectorPageAgent*);
-    ~InspectorApplicationCacheAgent() { }
+    virtual ~InspectorApplicationCacheAgent() { }
 
     virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
     virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;

Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorCSSAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -64,7 +64,7 @@
 
 #if ENABLE(INSPECTOR)
 
-class InspectorCSSAgent
+class InspectorCSSAgent final
     : public InspectorAgentBase
     , public InspectorDOMAgent::DOMListener
     , public Inspector::InspectorCSSBackendDispatcherHandler
@@ -90,7 +90,7 @@
     };
 
     InspectorCSSAgent(InstrumentingAgents*, InspectorDOMAgent*);
-    ~InspectorCSSAgent();
+    virtual ~InspectorCSSAgent();
 
     static CSSStyleRule* asCSSStyleRule(CSSRule&);
 

Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -93,7 +93,7 @@
     const EventListenerVector eventListenerVector;
 };
 
-class InspectorDOMAgent : public InspectorAgentBase, public Inspector::InspectorDOMBackendDispatcherHandler {
+class InspectorDOMAgent final : public InspectorAgentBase, public Inspector::InspectorDOMBackendDispatcherHandler {
     WTF_MAKE_NONCOPYABLE(InspectorDOMAgent);
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -107,7 +107,7 @@
     };
 
     InspectorDOMAgent(InstrumentingAgents*, InspectorPageAgent*, Inspector::InjectedScriptManager*, InspectorOverlay*);
-    ~InspectorDOMAgent();
+    virtual ~InspectorDOMAgent();
 
     static String toErrorString(const ExceptionCode&);
 

Modified: trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -53,7 +53,7 @@
 
 typedef String ErrorString;
 
-class InspectorDOMDebuggerAgent : public InspectorAgentBase, public Inspector::InspectorDebuggerAgent::Listener, public Inspector::InspectorDOMDebuggerBackendDispatcherHandler {
+class InspectorDOMDebuggerAgent final : public InspectorAgentBase, public Inspector::InspectorDebuggerAgent::Listener, public Inspector::InspectorDOMDebuggerBackendDispatcherHandler {
     WTF_MAKE_NONCOPYABLE(InspectorDOMDebuggerAgent);
     WTF_MAKE_FAST_ALLOCATED;
 public:

Modified: trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -51,11 +51,11 @@
 
 typedef String ErrorString;
 
-class InspectorDOMStorageAgent : public InspectorAgentBase, public Inspector::InspectorDOMStorageBackendDispatcherHandler {
+class InspectorDOMStorageAgent final : public InspectorAgentBase, public Inspector::InspectorDOMStorageBackendDispatcherHandler {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     InspectorDOMStorageAgent(InstrumentingAgents*, InspectorPageAgent*);
-    ~InspectorDOMStorageAgent();
+    virtual ~InspectorDOMStorageAgent();
 
     virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
     virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;

Modified: trunk/Source/WebCore/inspector/InspectorDatabaseAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorDatabaseAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorDatabaseAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -49,11 +49,11 @@
 
 typedef String ErrorString;
 
-class InspectorDatabaseAgent : public InspectorAgentBase, public Inspector::InspectorDatabaseBackendDispatcherHandler {
+class InspectorDatabaseAgent final : public InspectorAgentBase, public Inspector::InspectorDatabaseBackendDispatcherHandler {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     explicit InspectorDatabaseAgent(InstrumentingAgents*);
-    ~InspectorDatabaseAgent();
+    virtual ~InspectorDatabaseAgent();
 
     virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
     virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -58,15 +58,15 @@
     WEBCORE_EXPORT InspectorFrontendClientLocal(InspectorController*, Page*, std::unique_ptr<Settings>);
     WEBCORE_EXPORT virtual ~InspectorFrontendClientLocal();
 
-    WEBCORE_EXPORT virtual void windowObjectCleared() override;
+    WEBCORE_EXPORT virtual void windowObjectCleared() override final;
     WEBCORE_EXPORT virtual void frontendLoaded() override;
 
-    WEBCORE_EXPORT virtual void moveWindowBy(float x, float y) override;
+    WEBCORE_EXPORT virtual void moveWindowBy(float x, float y) override final;
 
-    WEBCORE_EXPORT virtual void requestSetDockSide(DockSide) override;
-    WEBCORE_EXPORT virtual void changeAttachedWindowHeight(unsigned) override;
-    WEBCORE_EXPORT virtual void changeAttachedWindowWidth(unsigned) override;
-    WEBCORE_EXPORT virtual void openInNewTab(const String& url) override;
+    WEBCORE_EXPORT virtual void requestSetDockSide(DockSide) override final;
+    WEBCORE_EXPORT virtual void changeAttachedWindowHeight(unsigned) override final;
+    WEBCORE_EXPORT virtual void changeAttachedWindowWidth(unsigned) override final;
+    WEBCORE_EXPORT virtual void openInNewTab(const String& url) override final;
     virtual bool canSave()  override { return false; }
     virtual void save(const String&, const String&, bool, bool) override { }
     virtual void append(const String&, const String&) override { }
@@ -74,9 +74,9 @@
     virtual void attachWindow(DockSide) = 0;
     virtual void detachWindow() = 0;
 
-    WEBCORE_EXPORT virtual void sendMessageToBackend(const String& message) override;
+    WEBCORE_EXPORT virtual void sendMessageToBackend(const String& message) override final;
 
-    WEBCORE_EXPORT virtual bool isUnderTest() override;
+    WEBCORE_EXPORT virtual bool isUnderTest() override final;
 
     WEBCORE_EXPORT bool canAttachWindow();
     WEBCORE_EXPORT void setDockingUnavailable(bool);

Modified: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -47,10 +47,10 @@
 
 typedef String ErrorString;
 
-class InspectorIndexedDBAgent : public InspectorAgentBase, public Inspector::InspectorIndexedDBBackendDispatcherHandler {
+class InspectorIndexedDBAgent final : public InspectorAgentBase, public Inspector::InspectorIndexedDBBackendDispatcherHandler {
 public:
     InspectorIndexedDBAgent(InstrumentingAgents*, Inspector::InjectedScriptManager*, InspectorPageAgent*);
-    ~InspectorIndexedDBAgent();
+    virtual ~InspectorIndexedDBAgent();
 
     virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
     virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;

Modified: trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -46,11 +46,11 @@
 
 typedef String ErrorString;
 
-class InspectorLayerTreeAgent : public InspectorAgentBase, public Inspector::InspectorLayerTreeBackendDispatcherHandler {
+class InspectorLayerTreeAgent final : public InspectorAgentBase, public Inspector::InspectorLayerTreeBackendDispatcherHandler {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     explicit InspectorLayerTreeAgent(InstrumentingAgents*);
-    ~InspectorLayerTreeAgent();
+    virtual ~InspectorLayerTreeAgent();
 
     virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
     virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;

Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorPageAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -66,7 +66,7 @@
 
 typedef String ErrorString;
 
-class InspectorPageAgent : public InspectorAgentBase, public Inspector::InspectorPageBackendDispatcherHandler {
+class InspectorPageAgent final : public InspectorAgentBase, public Inspector::InspectorPageBackendDispatcherHandler {
     WTF_MAKE_NONCOPYABLE(InspectorPageAgent);
     WTF_MAKE_FAST_ALLOCATED;
 public:

Modified: trunk/Source/WebCore/inspector/InspectorReplayAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorReplayAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorReplayAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -62,7 +62,7 @@
     WTF_MAKE_NONCOPYABLE(InspectorReplayAgent);
 public:
     InspectorReplayAgent(InstrumentingAgents*, InspectorPageAgent*);
-    ~InspectorReplayAgent();
+    virtual ~InspectorReplayAgent();
 
     virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
     virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;

Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorResourceAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -75,11 +75,11 @@
 
 typedef String ErrorString;
 
-class InspectorResourceAgent : public InspectorAgentBase, public Inspector::InspectorNetworkBackendDispatcherHandler {
+class InspectorResourceAgent final : public InspectorAgentBase, public Inspector::InspectorNetworkBackendDispatcherHandler {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     InspectorResourceAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorClient*);
-    ~InspectorResourceAgent();
+    virtual ~InspectorResourceAgent();
 
     virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
     virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;

Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorStyleSheet.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -257,7 +257,7 @@
     Listener* m_listener;
 };
 
-class InspectorStyleSheetForInlineStyle : public InspectorStyleSheet {
+class InspectorStyleSheetForInlineStyle final : public InspectorStyleSheet {
 public:
     static PassRefPtr<InspectorStyleSheetForInlineStyle> create(InspectorPageAgent*, const String& id, PassRefPtr<Element>, Inspector::Protocol::CSS::StyleSheetOrigin, Listener*);
 

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -114,7 +114,7 @@
     WebSocketDestroy
 };
 
-class InspectorTimelineAgent
+class InspectorTimelineAgent final
     : public InspectorAgentBase
     , public Inspector::InspectorTimelineBackendDispatcherHandler
     , public Inspector::ScriptDebugListener {
@@ -124,7 +124,7 @@
     enum InspectorType { PageInspector, WorkerInspector };
 
     InspectorTimelineAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorType, InspectorClient*);
-    ~InspectorTimelineAgent();
+    virtual ~InspectorTimelineAgent();
 
     virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
     virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;

Modified: trunk/Source/WebCore/inspector/InspectorWorkerAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/InspectorWorkerAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/InspectorWorkerAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -48,11 +48,11 @@
 
 typedef String ErrorString;
 
-class InspectorWorkerAgent : public InspectorAgentBase, public Inspector::InspectorWorkerBackendDispatcherHandler {
+class InspectorWorkerAgent final : public InspectorAgentBase, public Inspector::InspectorWorkerBackendDispatcherHandler {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     explicit InspectorWorkerAgent(InstrumentingAgents*);
-    ~InspectorWorkerAgent();
+    virtual ~InspectorWorkerAgent();
 
     virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
     virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;

Modified: trunk/Source/WebCore/inspector/PageConsoleAgent.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/PageConsoleAgent.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/PageConsoleAgent.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -46,9 +46,8 @@
     PageConsoleAgent(WebInjectedScriptManager*, InspectorDOMAgent*);
     virtual ~PageConsoleAgent() { }
 
-    virtual bool isWorkerAgent() const override { return false; }
-
 private:
+    virtual bool isWorkerAgent() const override { return false; }
     virtual void clearMessages(ErrorString&) override;
     virtual void addInspectedNode(ErrorString&, int nodeId) override;
 

Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.h (175354 => 175355)


--- trunk/Source/WebCore/inspector/WorkerInspectorController.h	2014-10-29 23:18:36 UTC (rev 175354)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.h	2014-10-29 23:28:55 UTC (rev 175355)
@@ -60,7 +60,7 @@
     WTF_MAKE_FAST_ALLOCATED;
 public:
     explicit WorkerInspectorController(WorkerGlobalScope&);
-    ~WorkerInspectorController();
+    virtual ~WorkerInspectorController();
 
     void connectFrontend();
     void disconnectFrontend(Inspector::InspectorDisconnectReason);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to