Changeset 249132 in webkit


Ignore:
Timestamp:
Aug 26, 2019 10:00:30 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: use more C++ keywords for defining agents
https://bugs.webkit.org/show_bug.cgi?id=200959

Reviewed by Joseph Pecoraro.

  • make constructors protected when the agent isn't meant to be constructed directly
  • add virtual destructors that are defined in the *.cpp so forward-declarations work
  • use final wherever possible
  • add comments to indicate where any virtual functions come from

Source/JavaScriptCore:

  • inspector/agents/InspectorAgent.h:
  • inspector/agents/InspectorAgent.cpp:
  • inspector/agents/InspectorAuditAgent.h:
  • inspector/agents/InspectorAuditAgent.cpp:
  • inspector/agents/InspectorConsoleAgent.h:
  • inspector/agents/InspectorConsoleAgent.cpp:
  • inspector/agents/InspectorDebuggerAgent.h:
  • inspector/agents/InspectorDebuggerAgent.cpp:
  • inspector/agents/InspectorHeapAgent.h:
  • inspector/agents/InspectorHeapAgent.cpp:
  • inspector/agents/InspectorRuntimeAgent.h:
  • inspector/agents/InspectorScriptProfilerAgent.h:
  • inspector/agents/InspectorScriptProfilerAgent.cpp:
  • inspector/agents/InspectorTargetAgent.h:
  • inspector/agents/InspectorTargetAgent.cpp:
  • inspector/agents/JSGlobalObjectAuditAgent.h:
  • inspector/agents/JSGlobalObjectAuditAgent.cpp:
  • inspector/agents/JSGlobalObjectDebuggerAgent.h:
  • inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
  • inspector/agents/JSGlobalObjectRuntimeAgent.h:
  • inspector/agents/JSGlobalObjectRuntimeAgent.cpp:

Source/WebCore:

  • inspector/agents/InspectorApplicationCacheAgent.h:
  • inspector/agents/InspectorApplicationCacheAgent.cpp:
  • inspector/agents/InspectorCPUProfilerAgent.h:
  • inspector/agents/InspectorCPUProfilerAgent.cpp:
  • inspector/agents/InspectorCSSAgent.h:
  • inspector/agents/InspectorCSSAgent.cpp:
  • inspector/agents/InspectorCanvasAgent.h:
  • inspector/agents/InspectorCanvasAgent.cpp:
  • inspector/agents/InspectorDOMAgent.h:
  • inspector/agents/InspectorDOMAgent.cpp:
  • inspector/agents/InspectorDOMDebuggerAgent.h:
  • inspector/agents/InspectorDOMDebuggerAgent.cpp:
  • inspector/agents/InspectorDOMStorageAgent.h:
  • inspector/agents/InspectorDOMStorageAgent.cpp:
  • inspector/agents/InspectorDatabaseAgent.h:
  • inspector/agents/InspectorDatabaseAgent.cpp:
  • inspector/agents/InspectorIndexedDBAgent.h:
  • inspector/agents/InspectorIndexedDBAgent.cpp:
  • inspector/agents/InspectorLayerTreeAgent.h:
  • inspector/agents/InspectorLayerTreeAgent.cpp:
  • inspector/agents/InspectorMemoryAgent.h:
  • inspector/agents/InspectorMemoryAgent.cpp:
  • inspector/agents/InspectorNetworkAgent.h:
  • inspector/agents/InspectorNetworkAgent.cpp:
  • inspector/agents/InspectorPageAgent.h:
  • inspector/agents/InspectorPageAgent.cpp:
  • inspector/agents/InspectorTimelineAgent.h:
  • inspector/agents/InspectorTimelineAgent.cpp:
  • inspector/agents/InspectorWorkerAgent.h:
  • inspector/agents/InspectorWorkerAgent.cpp:
  • inspector/agents/WebConsoleAgent.h:
  • inspector/agents/WebConsoleAgent.cpp:
  • inspector/agents/WebDebuggerAgent.h:
  • inspector/agents/WebDebuggerAgent.cpp:
  • inspector/agents/WebHeapAgent.h:
  • inspector/agents/WebHeapAgent.cpp:
  • inspector/agents/page/PageAuditAgent.h:
  • inspector/agents/page/PageAuditAgent.cpp:
  • inspector/agents/page/PageConsoleAgent.h:
  • inspector/agents/page/PageConsoleAgent.cpp:
  • inspector/agents/page/PageDebuggerAgent.h:
  • inspector/agents/page/PageDebuggerAgent.cpp:
  • inspector/agents/page/PageHeapAgent.h:
  • inspector/agents/page/PageHeapAgent.cpp:
  • inspector/agents/page/PageNetworkAgent.h:
  • inspector/agents/page/PageNetworkAgent.cpp:
  • inspector/agents/page/PageRuntimeAgent.h:
  • inspector/agents/page/PageRuntimeAgent.cpp:
  • inspector/agents/worker/ServiceWorkerAgent.h:
  • inspector/agents/worker/ServiceWorkerAgent.cpp:
  • inspector/agents/worker/WorkerAuditAgent.h:
  • inspector/agents/worker/WorkerAuditAgent.cpp:
  • inspector/agents/worker/WorkerConsoleAgent.h:
  • inspector/agents/worker/WorkerConsoleAgent.cpp:
  • inspector/agents/worker/WorkerDebuggerAgent.h:
  • inspector/agents/worker/WorkerNetworkAgent.h:
  • inspector/agents/worker/WorkerNetworkAgent.cpp:
  • inspector/agents/worker/WorkerRuntimeAgent.h:
  • inspector/agents/worker/WorkerRuntimeAgent.cpp:

Source/WebKit:

  • UIProcess/WebPageInspectorTargetAgent.h:
  • UIProcess/WebPageInspectorTargetAgent.cpp:
Location:
trunk/Source
Files:
85 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r249128 r249132  
     12019-08-26  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: use more C++ keywords for defining agents
     4        https://bugs.webkit.org/show_bug.cgi?id=200959
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8         - make constructors `protected` when the agent isn't meant to be constructed directly
     9         - add `virtual` destructors that are defined in the *.cpp so forward-declarations work
     10         - use `final` wherever possible
     11         - add comments to indicate where any virtual functions come from
     12
     13        * inspector/agents/InspectorAgent.h:
     14        * inspector/agents/InspectorAgent.cpp:
     15        * inspector/agents/InspectorAuditAgent.h:
     16        * inspector/agents/InspectorAuditAgent.cpp:
     17        * inspector/agents/InspectorConsoleAgent.h:
     18        * inspector/agents/InspectorConsoleAgent.cpp:
     19        * inspector/agents/InspectorDebuggerAgent.h:
     20        * inspector/agents/InspectorDebuggerAgent.cpp:
     21        * inspector/agents/InspectorHeapAgent.h:
     22        * inspector/agents/InspectorHeapAgent.cpp:
     23        * inspector/agents/InspectorRuntimeAgent.h:
     24        * inspector/agents/InspectorScriptProfilerAgent.h:
     25        * inspector/agents/InspectorScriptProfilerAgent.cpp:
     26        * inspector/agents/InspectorTargetAgent.h:
     27        * inspector/agents/InspectorTargetAgent.cpp:
     28        * inspector/agents/JSGlobalObjectAuditAgent.h:
     29        * inspector/agents/JSGlobalObjectAuditAgent.cpp:
     30        * inspector/agents/JSGlobalObjectDebuggerAgent.h:
     31        * inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
     32        * inspector/agents/JSGlobalObjectRuntimeAgent.h:
     33        * inspector/agents/JSGlobalObjectRuntimeAgent.cpp:
     34
    1352019-08-26  Devin Rousso  <drousso@apple.com>
    236
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp

    r249128 r249132  
    4545{
    4646}
     47
     48InspectorAgent::~InspectorAgent() = default;
    4749
    4850void InspectorAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorAgent.h

    r244172 r249132  
    4848public:
    4949    InspectorAgent(AgentContext&);
    50     virtual ~InspectorAgent() = default;
     50    virtual ~InspectorAgent();
    5151
    52     void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) override;
    53     void willDestroyFrontendAndBackend(DisconnectReason) override;
     52    // InspectorAgentBase
     53    void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*);
     54    void willDestroyFrontendAndBackend(DisconnectReason);
    5455
    55     void enable(ErrorString&) override;
    56     void disable(ErrorString&) override;
    57     void initialized(ErrorString&) override;
     56    // InspectorBackendDispatcherHandler
     57    void enable(ErrorString&);
     58    void disable(ErrorString&);
     59    void initialized(ErrorString&);
    5860
     61    // CommandLineAPI
    5962    void inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<JSON::Object>&& hints);
     63
    6064    void evaluateForTestInFrontend(const String& script);
    6165
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorAuditAgent.cpp

    r249128 r249132  
    4848{
    4949}
     50
     51InspectorAuditAgent::~InspectorAuditAgent() = default;
    5052
    5153void InspectorAuditAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorAuditAgent.h

    r245909 r249132  
    4444    WTF_MAKE_FAST_ALLOCATED;
    4545public:
    46     virtual ~InspectorAuditAgent() = default;
     46    virtual ~InspectorAuditAgent();
    4747
    4848    // InspectorAgentBase
    49     void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) override;
    50     void willDestroyFrontendAndBackend(DisconnectReason) override;
     49    void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) final;
     50    void willDestroyFrontendAndBackend(DisconnectReason) final;
    5151
    5252    // AuditBackendDispatcherHandler
     
    5858
    5959protected:
    60     explicit InspectorAuditAgent(AgentContext&);
     60    InspectorAuditAgent(AgentContext&);
    6161
    6262    InjectedScriptManager& injectedScriptManager() { return m_injectedScriptManager; }
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp

    r249128 r249132  
    5151}
    5252
     53InspectorConsoleAgent::~InspectorConsoleAgent() = default;
     54
    5355void InspectorConsoleAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
    5456{
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h

    r246876 r249132  
    5454public:
    5555    InspectorConsoleAgent(AgentContext&);
    56     virtual ~InspectorConsoleAgent() = default;
     56    virtual ~InspectorConsoleAgent();
    5757
    58     void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) override;
    59     void willDestroyFrontendAndBackend(DisconnectReason) override;
    60     void discardValues() override;
     58    // InspectorAgentBase
     59    void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) final;
     60    void willDestroyFrontendAndBackend(DisconnectReason) final;
     61    void discardValues() final;
     62
     63    // ConsoleBackendDispatcherHandler
     64    void enable(ErrorString&) final;
     65    void disable(ErrorString&) final;
     66    void clearMessages(ErrorString&) override;
     67    void getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Protocol::Console::Channel>>&) override;
     68    void setLoggingChannelLevel(ErrorString&, const String& channel, const String& level) override;
    6169
    6270    void setInspectorHeapAgent(InspectorHeapAgent* agent) { m_heapAgent = agent; }
    63 
    64     void enable(ErrorString&) override;
    65     void disable(ErrorString&) override;
    66     void clearMessages(ErrorString&) override;
    6771
    6872    bool enabled() const { return m_enabled; }
     
    7781    void count(JSC::ExecState*, const String& label);
    7882    void countReset(JSC::ExecState*, const String& label);
    79 
    80     void getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Protocol::Console::Channel>>&) override;
    81     void setLoggingChannelLevel(ErrorString&, const String& channel, const String& level) override;
    8283
    8384protected:
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp

    r249128 r249132  
    7272}
    7373
    74 InspectorDebuggerAgent::~InspectorDebuggerAgent()
    75 {
    76 }
     74InspectorDebuggerAgent::~InspectorDebuggerAgent() = default;
    7775
    7876void InspectorDebuggerAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
     
    8280void InspectorDebuggerAgent::willDestroyFrontendAndBackend(DisconnectReason reason)
    8381{
    84     bool skipRecompile = reason == DisconnectReason::InspectedTargetDestroyed;
    85     disable(skipRecompile);
     82    disable(reason == DisconnectReason::InspectedTargetDestroyed);
    8683}
    8784
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h

    r248894 r249132  
    5050typedef String ErrorString;
    5151
    52 class JS_EXPORT_PRIVATE InspectorDebuggerAgent : public InspectorAgentBase, public ScriptDebugListener, public DebuggerBackendDispatcherHandler {
     52class JS_EXPORT_PRIVATE InspectorDebuggerAgent : public InspectorAgentBase, public DebuggerBackendDispatcherHandler, public ScriptDebugListener {
    5353    WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent);
    5454    WTF_MAKE_FAST_ALLOCATED;
    5555public:
     56    virtual ~InspectorDebuggerAgent();
     57
    5658    static const char* backtraceObjectGroup;
    5759
    58     virtual ~InspectorDebuggerAgent();
    59 
     60    // InspectorAgentBase
    6061    void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) final;
    6162    void willDestroyFrontendAndBackend(DisconnectReason) final;
     
    8586    void evaluateOnCallFrame(ErrorString&, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* emulateUserGesture, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) override;
    8687
     88    // ScriptDebugListener
     89    void didParseSource(JSC::SourceID, const Script&) final;
     90    void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage) final;
     91    void willRunMicrotask() final;
     92    void didRunMicrotask() final;
     93    void didPause(JSC::ExecState&, JSC::JSValue callFrames, JSC::JSValue exceptionOrCaughtValue) final;
     94    void didContinue() final;
     95    void breakpointActionSound(int breakpointActionIdentifier) final;
     96    void breakpointActionProbe(JSC::ExecState&, const ScriptBreakpointAction&, unsigned batchId, unsigned sampleId, JSC::JSValue sample) final;
     97
    8798    bool isPaused() const;
    8899    bool breakpointsActive() const;
     
    132143
    133144    virtual void enable();
    134     virtual void disable(bool skipRecompile);
     145    virtual void disable(bool isBeingDestroyed);
    135146
    136147    virtual String sourceMapURLForScript(const Script&);
     
    141152private:
    142153    Ref<JSON::ArrayOf<Protocol::Debugger::CallFrame>> currentCallFrames(const InjectedScript&);
    143 
    144     // JSC::ScriptDebugListener
    145     void didParseSource(JSC::SourceID, const Script&) final;
    146     void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage) final;
    147     void willRunMicrotask() final;
    148     void didRunMicrotask() final;
    149     void didPause(JSC::ExecState&, JSC::JSValue callFrames, JSC::JSValue exceptionOrCaughtValue) final;
    150     void didContinue() final;
    151     void breakpointActionSound(int breakpointActionIdentifier) final;
    152     void breakpointActionProbe(JSC::ExecState&, const ScriptBreakpointAction&, unsigned batchId, unsigned sampleId, JSC::JSValue sample) final;
    153154
    154155    void resolveBreakpoint(const Script&, JSC::Breakpoint&);
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp

    r249128 r249132  
    5050}
    5151
     52InspectorHeapAgent::~InspectorHeapAgent() = default;
     53
    5254void InspectorHeapAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
    5355{
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.h

    r243150 r249132  
    4848public:
    4949    InspectorHeapAgent(AgentContext&);
    50     virtual ~InspectorHeapAgent() = default;
     50    virtual ~InspectorHeapAgent();
    5151
    52     void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) override;
    53     void willDestroyFrontendAndBackend(DisconnectReason) override;
     52    // InspectorAgentBase
     53    void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) final;
     54    void willDestroyFrontendAndBackend(DisconnectReason) final;
    5455
    5556    // HeapBackendDispatcherHandler
     
    6364    void getRemoteObject(ErrorString&, int heapObjectId, const String* optionalObjectGroup, RefPtr<Protocol::Runtime::RemoteObject>& result) final;
    6465
    65     // HeapObserver
    66     void willGarbageCollect() override;
    67     void didGarbageCollect(JSC::CollectionScope) override;
     66    // JSC::HeapObserver
     67    void willGarbageCollect() final;
     68    void didGarbageCollect(JSC::CollectionScope) final;
    6869
    6970protected:
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h

    r248287 r249132  
    5454    virtual ~InspectorRuntimeAgent();
    5555
    56     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    57     void willDestroyFrontendAndBackend(DisconnectReason) override;
     56    // InspectorAgentBase
     57    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) final;
     58    void willDestroyFrontendAndBackend(DisconnectReason) final;
    5859
     60    // RuntimeBackendDispatcherHandler
    5961    void enable(ErrorString&) override { m_enabled = true; }
    6062    void disable(ErrorString&) override { m_enabled = false; }
     
    7173    void setSavedResultAlias(ErrorString&, const String* alias) final;
    7274    void releaseObjectGroup(ErrorString&, const String& objectGroup) final;
    73     void getRuntimeTypesForVariablesAtOffsets(ErrorString&, const JSON::Array& locations, RefPtr<JSON::ArrayOf<Protocol::Runtime::TypeDescription>>&) override;
    74     void enableTypeProfiler(ErrorString&) override;
    75     void disableTypeProfiler(ErrorString&) override;
    76     void enableControlFlowProfiler(ErrorString&) override;
    77     void disableControlFlowProfiler(ErrorString&) override;
    78     void getBasicBlocks(ErrorString&, const String& in_sourceID, RefPtr<JSON::ArrayOf<Protocol::Runtime::BasicBlock>>& out_basicBlocks) override;
     75    void getRuntimeTypesForVariablesAtOffsets(ErrorString&, const JSON::Array& locations, RefPtr<JSON::ArrayOf<Protocol::Runtime::TypeDescription>>&) final;
     76    void enableTypeProfiler(ErrorString&) final;
     77    void disableTypeProfiler(ErrorString&) final;
     78    void enableControlFlowProfiler(ErrorString&) final;
     79    void disableControlFlowProfiler(ErrorString&) final;
     80    void getBasicBlocks(ErrorString&, const String& in_sourceID, RefPtr<JSON::ArrayOf<Protocol::Runtime::BasicBlock>>& out_basicBlocks) final;
    7981
    8082protected:
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorScriptProfilerAgent.cpp

    r248846 r249132  
    4646}
    4747
    48 InspectorScriptProfilerAgent::~InspectorScriptProfilerAgent()
    49 {
    50 }
     48InspectorScriptProfilerAgent::~InspectorScriptProfilerAgent() = default;
    5149
    5250void InspectorScriptProfilerAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorScriptProfilerAgent.h

    r244195 r249132  
    4747    virtual ~InspectorScriptProfilerAgent();
    4848
    49     void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) override;
    50     void willDestroyFrontendAndBackend(DisconnectReason) override;
     49    // InspectorAgentBase
     50    void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*);
     51    void willDestroyFrontendAndBackend(DisconnectReason);
    5152
    5253    // ScriptProfilerBackendDispatcherHandler
    53     void startTracking(ErrorString&, const bool* includeSamples) override;
    54     void stopTracking(ErrorString&) override;
     54    void startTracking(ErrorString&, const bool* includeSamples);
     55    void stopTracking(ErrorString&);
    5556
    56     // Debugger::ProfilingClient
    57     bool isAlreadyProfiling() const override;
    58     Seconds willEvaluateScript() override;
    59     void didEvaluateScript(Seconds, JSC::ProfilingReason) override;
     57    // JSC::Debugger::ProfilingClient
     58    bool isAlreadyProfiling() const;
     59    Seconds willEvaluateScript();
     60    void didEvaluateScript(Seconds, JSC::ProfilingReason);
    6061
    6162private:
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp

    r249128 r249132  
    3737{
    3838}
     39
     40InspectorTargetAgent::~InspectorTargetAgent() = default;
    3941
    4042void InspectorTargetAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.h

    r238192 r249132  
    4141    WTF_MAKE_FAST_ALLOCATED;
    4242public:
    43     InspectorTargetAgent(FrontendRouter&, BackendDispatcher&);
    44     virtual ~InspectorTargetAgent() = default;
     43    virtual ~InspectorTargetAgent();
    4544
     45    // InspectorAgentBase
    4646    void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) final;
    4747    void willDestroyFrontendAndBackend(DisconnectReason) final;
    48 
    49     virtual FrontendChannel& frontendChannel() = 0;
    5048
    5149    // TargetBackendDispatcherHandler
     
    6058    void sendMessageFromTargetToFrontend(const String& targetId, const String& message);
    6159
     60protected:
     61    InspectorTargetAgent(FrontendRouter&, BackendDispatcher&);
     62
     63    virtual FrontendChannel& frontendChannel() = 0;
     64
    6265private:
    6366    void connectToTargets();
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectAuditAgent.cpp

    r249128 r249132  
    4545}
    4646
     47JSGlobalObjectAuditAgent::~JSGlobalObjectAuditAgent() = default;
     48
    4749InjectedScript JSGlobalObjectAuditAgent::injectedScriptForEval(ErrorString& errorString, const int* executionContextId)
    4850{
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectAuditAgent.h

    r239976 r249132  
    3838    WTF_MAKE_FAST_ALLOCATED;
    3939public:
    40     explicit JSGlobalObjectAuditAgent(JSAgentContext&);
     40    JSGlobalObjectAuditAgent(JSAgentContext&);
     41    virtual ~JSGlobalObjectAuditAgent();
    4142
    4243private:
    43     InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
     44    InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId);
    4445
    4546    JSC::JSGlobalObject& m_globalObject;
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp

    r249128 r249132  
    4646}
    4747
     48JSGlobalObjectDebuggerAgent::~JSGlobalObjectDebuggerAgent() = default;
     49
    4850InjectedScript JSGlobalObjectDebuggerAgent::injectedScriptForEval(ErrorString& errorString, const int* executionContextId)
    4951{
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h

    r248894 r249132  
    3737public:
    3838    JSGlobalObjectDebuggerAgent(JSAgentContext&, InspectorConsoleAgent*);
    39     virtual ~JSGlobalObjectDebuggerAgent() { }
     39    virtual ~JSGlobalObjectDebuggerAgent();
     40
     41    // ScriptDebugListener
     42    void breakpointActionLog(JSC::ExecState&, const String&);
    4043
    4144private:
    42     InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
    43 
    44     // JSC::ScriptDebugListener
    45     void breakpointActionLog(JSC::ExecState&, const String&) final;
     45    InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId);
    4646
    4747    // NOTE: JavaScript inspector does not yet need to mute a console because no messages
    4848    // are sent to the console outside of the API boundary or console object.
    49     void muteConsole() final { }
    50     void unmuteConsole() final { }
     49    void muteConsole() { }
     50    void unmuteConsole() { }
    5151
    5252    InspectorConsoleAgent* m_consoleAgent { nullptr };
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp

    r249128 r249132  
    4343}
    4444
     45JSGlobalObjectRuntimeAgent::~JSGlobalObjectRuntimeAgent() = default;
     46
    4547InjectedScript JSGlobalObjectRuntimeAgent::injectedScriptForEval(ErrorString& errorString, const int* executionContextId)
    4648{
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h

    r243243 r249132  
    4040public:
    4141    JSGlobalObjectRuntimeAgent(JSAgentContext&);
     42    virtual ~JSGlobalObjectRuntimeAgent();
    4243
    43     InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
     44private:
     45    InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId);
    4446
    4547    // NOTE: JavaScript inspector does not yet need to mute a console because no messages
    4648    // are sent to the console outside of the API boundary or console object.
    47     void muteConsole() override { }
    48     void unmuteConsole() override { }
     49    void muteConsole() { }
     50    void unmuteConsole() { }
    4951
    50 private:
    5152    std::unique_ptr<RuntimeFrontendDispatcher> m_frontendDispatcher;
    5253    RefPtr<RuntimeBackendDispatcher> m_backendDispatcher;
  • trunk/Source/WebCore/ChangeLog

    r249131 r249132  
     12019-08-26  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: use more C++ keywords for defining agents
     4        https://bugs.webkit.org/show_bug.cgi?id=200959
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8         - make constructors `protected` when the agent isn't meant to be constructed directly
     9         - add `virtual` destructors that are defined in the *.cpp so forward-declarations work
     10         - use `final` wherever possible
     11         - add comments to indicate where any virtual functions come from
     12
     13        * inspector/agents/InspectorApplicationCacheAgent.h:
     14        * inspector/agents/InspectorApplicationCacheAgent.cpp:
     15        * inspector/agents/InspectorCPUProfilerAgent.h:
     16        * inspector/agents/InspectorCPUProfilerAgent.cpp:
     17        * inspector/agents/InspectorCSSAgent.h:
     18        * inspector/agents/InspectorCSSAgent.cpp:
     19        * inspector/agents/InspectorCanvasAgent.h:
     20        * inspector/agents/InspectorCanvasAgent.cpp:
     21        * inspector/agents/InspectorDOMAgent.h:
     22        * inspector/agents/InspectorDOMAgent.cpp:
     23        * inspector/agents/InspectorDOMDebuggerAgent.h:
     24        * inspector/agents/InspectorDOMDebuggerAgent.cpp:
     25        * inspector/agents/InspectorDOMStorageAgent.h:
     26        * inspector/agents/InspectorDOMStorageAgent.cpp:
     27        * inspector/agents/InspectorDatabaseAgent.h:
     28        * inspector/agents/InspectorDatabaseAgent.cpp:
     29        * inspector/agents/InspectorIndexedDBAgent.h:
     30        * inspector/agents/InspectorIndexedDBAgent.cpp:
     31        * inspector/agents/InspectorLayerTreeAgent.h:
     32        * inspector/agents/InspectorLayerTreeAgent.cpp:
     33        * inspector/agents/InspectorMemoryAgent.h:
     34        * inspector/agents/InspectorMemoryAgent.cpp:
     35        * inspector/agents/InspectorNetworkAgent.h:
     36        * inspector/agents/InspectorNetworkAgent.cpp:
     37        * inspector/agents/InspectorPageAgent.h:
     38        * inspector/agents/InspectorPageAgent.cpp:
     39        * inspector/agents/InspectorTimelineAgent.h:
     40        * inspector/agents/InspectorTimelineAgent.cpp:
     41        * inspector/agents/InspectorWorkerAgent.h:
     42        * inspector/agents/InspectorWorkerAgent.cpp:
     43        * inspector/agents/WebConsoleAgent.h:
     44        * inspector/agents/WebConsoleAgent.cpp:
     45        * inspector/agents/WebDebuggerAgent.h:
     46        * inspector/agents/WebDebuggerAgent.cpp:
     47        * inspector/agents/WebHeapAgent.h:
     48        * inspector/agents/WebHeapAgent.cpp:
     49        * inspector/agents/page/PageAuditAgent.h:
     50        * inspector/agents/page/PageAuditAgent.cpp:
     51        * inspector/agents/page/PageConsoleAgent.h:
     52        * inspector/agents/page/PageConsoleAgent.cpp:
     53        * inspector/agents/page/PageDebuggerAgent.h:
     54        * inspector/agents/page/PageDebuggerAgent.cpp:
     55        * inspector/agents/page/PageHeapAgent.h:
     56        * inspector/agents/page/PageHeapAgent.cpp:
     57        * inspector/agents/page/PageNetworkAgent.h:
     58        * inspector/agents/page/PageNetworkAgent.cpp:
     59        * inspector/agents/page/PageRuntimeAgent.h:
     60        * inspector/agents/page/PageRuntimeAgent.cpp:
     61        * inspector/agents/worker/ServiceWorkerAgent.h:
     62        * inspector/agents/worker/ServiceWorkerAgent.cpp:
     63        * inspector/agents/worker/WorkerAuditAgent.h:
     64        * inspector/agents/worker/WorkerAuditAgent.cpp:
     65        * inspector/agents/worker/WorkerConsoleAgent.h:
     66        * inspector/agents/worker/WorkerConsoleAgent.cpp:
     67        * inspector/agents/worker/WorkerDebuggerAgent.h:
     68        * inspector/agents/worker/WorkerNetworkAgent.h:
     69        * inspector/agents/worker/WorkerNetworkAgent.cpp:
     70        * inspector/agents/worker/WorkerRuntimeAgent.h:
     71        * inspector/agents/worker/WorkerRuntimeAgent.cpp:
     72
    1732019-08-26  Myles C. Maxfield  <mmaxfield@apple.com>
    274
  • trunk/Source/WebCore/inspector/agents/InspectorApplicationCacheAgent.cpp

    r249128 r249132  
    5151}
    5252
     53InspectorApplicationCacheAgent::~InspectorApplicationCacheAgent() = default;
     54
    5355void InspectorApplicationCacheAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
    5456{
  • trunk/Source/WebCore/inspector/agents/InspectorApplicationCacheAgent.h

    r248179 r249132  
    4747public:
    4848    InspectorApplicationCacheAgent(PageAgentContext&);
    49     virtual ~InspectorApplicationCacheAgent() = default;
     49    virtual ~InspectorApplicationCacheAgent();
    5050
    51     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    52     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
     51    // InspectorAgentBase
     52    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     53    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
     54
     55    // ApplicationCacheBackendDispatcherHandler
     56    void enable(ErrorString&);
     57    void disable(ErrorString&);
     58    void getFramesWithManifests(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::ApplicationCache::FrameWithManifest>>& result);
     59    void getManifestForFrame(ErrorString&, const String& frameId, String* manifestURL);
     60    void getApplicationCacheForFrame(ErrorString&, const String& frameId, RefPtr<Inspector::Protocol::ApplicationCache::ApplicationCache>&);
    5361
    5462    // InspectorInstrumentation
    5563    void updateApplicationCacheStatus(Frame*);
    5664    void networkStateChanged();
    57 
    58     // ApplicationCacheBackendDispatcherHandler
    59     void enable(ErrorString&) override;
    60     void disable(ErrorString&) override;
    61     void getFramesWithManifests(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::ApplicationCache::FrameWithManifest>>& result) override;
    62     void getManifestForFrame(ErrorString&, const String& frameId, String* manifestURL) override;
    63     void getApplicationCacheForFrame(ErrorString&, const String& frameId, RefPtr<Inspector::Protocol::ApplicationCache::ApplicationCache>&) override;
    6465
    6566private:
  • trunk/Source/WebCore/inspector/agents/InspectorCPUProfilerAgent.cpp

    r248846 r249132  
    4444{
    4545}
     46
     47InspectorCPUProfilerAgent::~InspectorCPUProfilerAgent() = default;
    4648
    4749void InspectorCPUProfilerAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
  • trunk/Source/WebCore/inspector/agents/InspectorCPUProfilerAgent.h

    r240457 r249132  
    4242public:
    4343    InspectorCPUProfilerAgent(PageAgentContext&);
    44     virtual ~InspectorCPUProfilerAgent() = default;
     44    virtual ~InspectorCPUProfilerAgent();
    4545
    46     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    47     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
     46    // InspectorAgentBase
     47    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     48    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
    4849
    4950    // CPUProfilerBackendDispatcherHandler
    50     void startTracking(ErrorString&) override;
    51     void stopTracking(ErrorString&) override;
     51    void startTracking(ErrorString&);
     52    void stopTracking(ErrorString&);
    5253
    5354private:
  • trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp

    r249128 r249132  
    303303}
    304304
     305InspectorCSSAgent::~InspectorCSSAgent() = default;
     306
    305307void InspectorCSSAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
    306308{
  • trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.h

    r243273 r249132  
    5454class StyleRule;
    5555
    56 class InspectorCSSAgent final
    57     : public InspectorAgentBase
    58     , public Inspector::CSSBackendDispatcherHandler
    59     , public InspectorStyleSheet::Listener {
     56class InspectorCSSAgent final : public InspectorAgentBase , public Inspector::CSSBackendDispatcherHandler , public InspectorStyleSheet::Listener {
    6057    WTF_MAKE_NONCOPYABLE(InspectorCSSAgent);
    6158    WTF_MAKE_FAST_ALLOCATED;
    6259public:
     60    InspectorCSSAgent(WebAgentContext&);
     61    virtual ~InspectorCSSAgent();
     62
    6363    class InlineStyleOverrideScope {
    6464    public:
     
    7878    };
    7979
    80     InspectorCSSAgent(WebAgentContext&);
    81     virtual ~InspectorCSSAgent() = default;
    82 
    8380    static CSSStyleRule* asCSSStyleRule(CSSRule&);
    8481
    85     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    86     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
    87     void reset();
     82    // InspectorAgentBase
     83    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     84    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
     85
     86    // CSSBackendDispatcherHandler
     87    void enable(ErrorString&);
     88    void disable(ErrorString&);
     89    void getComputedStyleForNode(ErrorString&, int nodeId, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::CSSComputedStyleProperty>>&);
     90    void getInlineStylesForNode(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::CSS::CSSStyle>& inlineStyle, RefPtr<Inspector::Protocol::CSS::CSSStyle>& attributes);
     91    void getMatchedStylesForNode(ErrorString&, int nodeId, const bool* includePseudo, const bool* includeInherited, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::RuleMatch>>& matchedCSSRules, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::PseudoIdMatches>>&, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::InheritedStyleEntry>>& inheritedEntries);
     92    void getAllStyleSheets(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::CSSStyleSheetHeader>>& styleSheetInfos);
     93    void getStyleSheet(ErrorString&, const String& styleSheetId, RefPtr<Inspector::Protocol::CSS::CSSStyleSheetBody>& result);
     94    void getStyleSheetText(ErrorString&, const String& styleSheetId, String* result);
     95    void setStyleSheetText(ErrorString&, const String& styleSheetId, const String& text);
     96    void setStyleText(ErrorString&, const JSON::Object& styleId, const String& text, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result);
     97    void setRuleSelector(ErrorString&, const JSON::Object& ruleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result);
     98    void createStyleSheet(ErrorString&, const String& frameId, String* styleSheetId);
     99    void addRule(ErrorString&, const String& styleSheetId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result);
     100    void getSupportedCSSProperties(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::CSSPropertyInfo>>& result);
     101    void getSupportedSystemFontFamilyNames(ErrorString&, RefPtr<JSON::ArrayOf<String>>& result);
     102    void forcePseudoState(ErrorString&, int nodeId, const JSON::Array& forcedPseudoClasses);
     103
     104    // InspectorStyleSheet::Listener
     105    void styleSheetChanged(InspectorStyleSheet*);
    88106
    89107    // InspectorInstrumentation
     
    93111    bool forcePseudoState(const Element&, CSSSelector::PseudoClassType);
    94112
    95     // CSSBackendDispatcherHandler
    96     void enable(ErrorString&) override;
    97     void disable(ErrorString&) override;
    98     void getComputedStyleForNode(ErrorString&, int nodeId, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::CSSComputedStyleProperty>>&) override;
    99     void getInlineStylesForNode(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::CSS::CSSStyle>& inlineStyle, RefPtr<Inspector::Protocol::CSS::CSSStyle>& attributes) override;
    100     void getMatchedStylesForNode(ErrorString&, int nodeId, const bool* includePseudo, const bool* includeInherited, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::RuleMatch>>& matchedCSSRules, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::PseudoIdMatches>>&, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::InheritedStyleEntry>>& inheritedEntries) override;
    101     void getAllStyleSheets(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::CSSStyleSheetHeader>>& styleSheetInfos) override;
    102     void getStyleSheet(ErrorString&, const String& styleSheetId, RefPtr<Inspector::Protocol::CSS::CSSStyleSheetBody>& result) override;
    103     void getStyleSheetText(ErrorString&, const String& styleSheetId, String* result) override;
    104     void setStyleSheetText(ErrorString&, const String& styleSheetId, const String& text) override;
    105     void setStyleText(ErrorString&, const JSON::Object& styleId, const String& text, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result) override;
    106     void setRuleSelector(ErrorString&, const JSON::Object& ruleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result) override;
    107     void createStyleSheet(ErrorString&, const String& frameId, String* styleSheetId) override;
    108     void addRule(ErrorString&, const String& styleSheetId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result) override;
    109     void getSupportedCSSProperties(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::CSS::CSSPropertyInfo>>& result) override;
    110     void getSupportedSystemFontFamilyNames(ErrorString&, RefPtr<JSON::ArrayOf<String>>& result) override;
    111     void forcePseudoState(ErrorString&, int nodeId, const JSON::Array& forcedPseudoClasses) override;
    112 
    113113    // InspectorDOMAgent hooks
    114114    void didRemoveDOMNode(Node&, int nodeId);
    115115    void didModifyDOMAttr(Element&);
     116
     117    void reset();
    116118
    117119private:
     
    146148    RefPtr<Inspector::Protocol::CSS::CSSStyle> buildObjectForAttributesStyle(StyledElement&);
    147149
    148     // InspectorCSSAgent::Listener implementation
    149     void styleSheetChanged(InspectorStyleSheet*) override;
    150150
    151151    void resetPseudoStates();
  • trunk/Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp

    r249128 r249132  
    8080}
    8181
     82InspectorCanvasAgent::~InspectorCanvasAgent() = default;
     83
    8284void InspectorCanvasAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
    8385{
  • trunk/Source/WebCore/inspector/agents/InspectorCanvasAgent.h

    r249128 r249132  
    5757typedef String ErrorString;
    5858
    59 class InspectorCanvasAgent final : public InspectorAgentBase, public CanvasObserver, public Inspector::CanvasBackendDispatcherHandler {
     59class InspectorCanvasAgent final : public InspectorAgentBase, public Inspector::CanvasBackendDispatcherHandler, public CanvasObserver {
    6060    WTF_MAKE_NONCOPYABLE(InspectorCanvasAgent);
    6161    WTF_MAKE_FAST_ALLOCATED;
    6262public:
    63     explicit InspectorCanvasAgent(PageAgentContext&);
    64     virtual ~InspectorCanvasAgent() = default;
     63    InspectorCanvasAgent(PageAgentContext&);
     64    virtual ~InspectorCanvasAgent();
    6565
    66     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    67     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
    68     void discardAgent() override;
     66    // InspectorAgentBase
     67    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     68    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
     69    void discardAgent();
    6970
    7071    // CanvasBackendDispatcherHandler
    71     void enable(ErrorString&) override;
    72     void disable(ErrorString&) override;
    73     void requestNode(ErrorString&, const String& canvasId, int* nodeId) override;
    74     void requestContent(ErrorString&, const String& canvasId, String* content) override;
    75     void requestCSSCanvasClientNodes(ErrorString&, const String& canvasId, RefPtr<JSON::ArrayOf<int>>&) override;
    76     void resolveCanvasContext(ErrorString&, const String& canvasId, const String* objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>&) override;
    77     void setRecordingAutoCaptureFrameCount(ErrorString&, int count) override;
    78     void startRecording(ErrorString&, const String& canvasId, const int* frameCount, const int* memoryLimit) override;
    79     void stopRecording(ErrorString&, const String& canvasId) override;
    80     void requestShaderSource(ErrorString&, const String& programId, const String& shaderType, String*) override;
    81     void updateShader(ErrorString&, const String& programId, const String& shaderType, const String& source) override;
    82     void setShaderProgramDisabled(ErrorString&, const String& programId, bool disabled) override;
    83     void setShaderProgramHighlighted(ErrorString&, const String& programId, bool highlighted) override;
     72    void enable(ErrorString&);
     73    void disable(ErrorString&);
     74    void requestNode(ErrorString&, const String& canvasId, int* nodeId);
     75    void requestContent(ErrorString&, const String& canvasId, String* content);
     76    void requestCSSCanvasClientNodes(ErrorString&, const String& canvasId, RefPtr<JSON::ArrayOf<int>>&);
     77    void resolveCanvasContext(ErrorString&, const String& canvasId, const String* objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>&);
     78    void setRecordingAutoCaptureFrameCount(ErrorString&, int count);
     79    void startRecording(ErrorString&, const String& canvasId, const int* frameCount, const int* memoryLimit);
     80    void stopRecording(ErrorString&, const String& canvasId);
     81    void requestShaderSource(ErrorString&, const String& programId, const String& shaderType, String*);
     82    void updateShader(ErrorString&, const String& programId, const String& shaderType, const String& source);
     83    void setShaderProgramDisabled(ErrorString&, const String& programId, bool disabled);
     84    void setShaderProgramHighlighted(ErrorString&, const String& programId, bool highlighted);
     85
     86    // CanvasObserver
     87    void canvasChanged(CanvasBase&, const FloatRect&);
     88    void canvasResized(CanvasBase&) { }
     89    void canvasDestroyed(CanvasBase&);
    8490
    8591    // InspectorInstrumentation
     
    99105    bool isShaderProgramHighlighted(WebGLProgram&);
    100106#endif
    101 
    102     // CanvasObserver
    103     void canvasChanged(CanvasBase&, const FloatRect&) override;
    104     void canvasResized(CanvasBase&) override { }
    105     void canvasDestroyed(CanvasBase&) override;
    106107
    107108private:
  • trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp

    r249128 r249132  
    294294}
    295295
    296 InspectorDOMAgent::~InspectorDOMAgent()
    297 {
    298     reset();
    299     ASSERT(!m_searchingForNode);
    300 }
     296InspectorDOMAgent::~InspectorDOMAgent() = default;
    301297
    302298void InspectorDOMAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
  • trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h

    r246490 r249132  
    8888    static String toErrorString(Exception&&);
    8989
    90     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    91     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
    92 
    93     Vector<Document*> documents();
    94     void reset();
    95 
    96     // Methods called from the frontend for DOM nodes inspection.
    97     void querySelector(ErrorString&, int nodeId, const String& selectors, int* elementId) override;
    98     void querySelectorAll(ErrorString&, int nodeId, const String& selectors, RefPtr<JSON::ArrayOf<int>>& result) override;
    99     void getDocument(ErrorString&, RefPtr<Inspector::Protocol::DOM::Node>& root) override;
    100     void requestChildNodes(ErrorString&, int nodeId, const int* depth) override;
    101     void setAttributeValue(ErrorString&, int elementId, const String& name, const String& value) override;
    102     void setAttributesAsText(ErrorString&, int elementId, const String& text, const String* name) override;
    103     void removeAttribute(ErrorString&, int elementId, const String& name) override;
    104     void removeNode(ErrorString&, int nodeId) override;
    105     void setNodeName(ErrorString&, int nodeId, const String& name, int* newId) override;
    106     void getOuterHTML(ErrorString&, int nodeId, WTF::String* outerHTML) override;
    107     void setOuterHTML(ErrorString&, int nodeId, const String& outerHTML) override;
    108     void insertAdjacentHTML(ErrorString&, int nodeId, const String& position, const String& html) override;
    109     void setNodeValue(ErrorString&, int nodeId, const String& value) override;
    110     void getSupportedEventNames(ErrorString&, RefPtr<JSON::ArrayOf<String>>& eventNames) override;
    111     void getDataBindingsForNode(ErrorString&, int nodeId, RefPtr<JSON::ArrayOf<Inspector::Protocol::DOM::DataBinding>>& dataArray) override;
    112     void getAssociatedDataForNode(ErrorString&, int nodeId, Optional<String>& associatedData) override;
    113     void getEventListenersForNode(ErrorString&, int nodeId, RefPtr<JSON::ArrayOf<Inspector::Protocol::DOM::EventListener>>& listenersArray) override;
    114     void setEventListenerDisabled(ErrorString&, int eventListenerId, bool disabled) override;
    115     void setBreakpointForEventListener(ErrorString&, int eventListenerId) override;
    116     void removeBreakpointForEventListener(ErrorString&, int eventListenerId) override;
    117     void getAccessibilityPropertiesForNode(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::DOM::AccessibilityProperties>& axProperties) override;
    118     void performSearch(ErrorString&, const String& query, const JSON::Array* nodeIds, const bool* caseSensitive, String* searchId, int* resultCount) override;
    119     void getSearchResults(ErrorString&, const String& searchId, int fromIndex, int toIndex, RefPtr<JSON::ArrayOf<int>>&) override;
    120     void discardSearchResults(ErrorString&, const String& searchId) override;
    121     void resolveNode(ErrorString&, int nodeId, const String* objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result) override;
    122     void getAttributes(ErrorString&, int nodeId, RefPtr<JSON::ArrayOf<String>>& result) override;
    123     void setInspectModeEnabled(ErrorString&, bool enabled, const JSON::Object* highlightConfig, const bool* showRulers) override;
    124     void requestNode(ErrorString&, const String& objectId, int* nodeId) override;
    125     void pushNodeByPathToFrontend(ErrorString&, const String& path, int* nodeId) override;
    126     void hideHighlight(ErrorString&) override;
    127     void highlightRect(ErrorString&, int x, int y, int width, int height, const JSON::Object* color, const JSON::Object* outlineColor, const bool* usePageCoordinates) override;
    128     void highlightQuad(ErrorString&, const JSON::Array& quad, const JSON::Object* color, const JSON::Object* outlineColor, const bool* usePageCoordinates) override;
    129     void highlightSelector(ErrorString&, const JSON::Object& highlightConfig, const String& selectorString, const String* frameId) override;
    130     void highlightNode(ErrorString&, const JSON::Object& highlightConfig, const int* nodeId, const String* objectId) override;
    131     void highlightNodeList(ErrorString&, const JSON::Array& nodeIds, const JSON::Object& highlightConfig) override;
    132     void highlightFrame(ErrorString&, const String& frameId, const JSON::Object* color, const JSON::Object* outlineColor) override;
    133     void moveTo(ErrorString&, int nodeId, int targetNodeId, const int* anchorNodeId, int* newNodeId) override;
    134     void undo(ErrorString&) override;
    135     void redo(ErrorString&) override;
    136     void markUndoableState(ErrorString&) override;
    137     void focus(ErrorString&, int nodeId) override;
    138     void setInspectedNode(ErrorString&, int nodeId) override;
     90    static String documentURLString(Document*);
     91
     92    // We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently.
     93    // We also skip whitespace text nodes conditionally. Following methods encapsulate these specifics.
     94    static Node* innerFirstChild(Node*);
     95    static Node* innerNextSibling(Node*);
     96    static Node* innerPreviousSibling(Node*);
     97    static unsigned innerChildNodeCount(Node*);
     98    static Node* innerParentNode(Node*);
     99
     100    static Node* scriptValueAsNode(JSC::JSValue);
     101    static JSC::JSValue nodeAsScriptValue(JSC::ExecState&, Node*);
     102
     103    // InspectorAgentBase
     104    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     105    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
     106
     107    // DOMBackendDispatcherHandler
     108    void querySelector(ErrorString&, int nodeId, const String& selectors, int* elementId);
     109    void querySelectorAll(ErrorString&, int nodeId, const String& selectors, RefPtr<JSON::ArrayOf<int>>& result);
     110    void getDocument(ErrorString&, RefPtr<Inspector::Protocol::DOM::Node>& root);
     111    void requestChildNodes(ErrorString&, int nodeId, const int* depth);
     112    void setAttributeValue(ErrorString&, int elementId, const String& name, const String& value);
     113    void setAttributesAsText(ErrorString&, int elementId, const String& text, const String* name);
     114    void removeAttribute(ErrorString&, int elementId, const String& name);
     115    void removeNode(ErrorString&, int nodeId);
     116    void setNodeName(ErrorString&, int nodeId, const String& name, int* newId);
     117    void getOuterHTML(ErrorString&, int nodeId, WTF::String* outerHTML);
     118    void setOuterHTML(ErrorString&, int nodeId, const String& outerHTML);
     119    void insertAdjacentHTML(ErrorString&, int nodeId, const String& position, const String& html);
     120    void setNodeValue(ErrorString&, int nodeId, const String& value);
     121    void getSupportedEventNames(ErrorString&, RefPtr<JSON::ArrayOf<String>>& eventNames);
     122    void getDataBindingsForNode(ErrorString&, int nodeId, RefPtr<JSON::ArrayOf<Inspector::Protocol::DOM::DataBinding>>& dataArray);
     123    void getAssociatedDataForNode(ErrorString&, int nodeId, Optional<String>& associatedData);
     124    void getEventListenersForNode(ErrorString&, int nodeId, RefPtr<JSON::ArrayOf<Inspector::Protocol::DOM::EventListener>>& listenersArray);
     125    void setEventListenerDisabled(ErrorString&, int eventListenerId, bool disabled);
     126    void setBreakpointForEventListener(ErrorString&, int eventListenerId);
     127    void removeBreakpointForEventListener(ErrorString&, int eventListenerId);
     128    void getAccessibilityPropertiesForNode(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::DOM::AccessibilityProperties>& axProperties);
     129    void performSearch(ErrorString&, const String& query, const JSON::Array* nodeIds, const bool* caseSensitive, String* searchId, int* resultCount);
     130    void getSearchResults(ErrorString&, const String& searchId, int fromIndex, int toIndex, RefPtr<JSON::ArrayOf<int>>&);
     131    void discardSearchResults(ErrorString&, const String& searchId);
     132    void resolveNode(ErrorString&, int nodeId, const String* objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result);
     133    void getAttributes(ErrorString&, int nodeId, RefPtr<JSON::ArrayOf<String>>& result);
     134    void setInspectModeEnabled(ErrorString&, bool enabled, const JSON::Object* highlightConfig, const bool* showRulers);
     135    void requestNode(ErrorString&, const String& objectId, int* nodeId);
     136    void pushNodeByPathToFrontend(ErrorString&, const String& path, int* nodeId);
     137    void hideHighlight(ErrorString&);
     138    void highlightRect(ErrorString&, int x, int y, int width, int height, const JSON::Object* color, const JSON::Object* outlineColor, const bool* usePageCoordinates);
     139    void highlightQuad(ErrorString&, const JSON::Array& quad, const JSON::Object* color, const JSON::Object* outlineColor, const bool* usePageCoordinates);
     140    void highlightSelector(ErrorString&, const JSON::Object& highlightConfig, const String& selectorString, const String* frameId);
     141    void highlightNode(ErrorString&, const JSON::Object& highlightConfig, const int* nodeId, const String* objectId);
     142    void highlightNodeList(ErrorString&, const JSON::Array& nodeIds, const JSON::Object& highlightConfig);
     143    void highlightFrame(ErrorString&, const String& frameId, const JSON::Object* color, const JSON::Object* outlineColor);
     144    void moveTo(ErrorString&, int nodeId, int targetNodeId, const int* anchorNodeId, int* newNodeId);
     145    void undo(ErrorString&);
     146    void redo(ErrorString&);
     147    void markUndoableState(ErrorString&);
     148    void focus(ErrorString&, int nodeId);
     149    void setInspectedNode(ErrorString&, int nodeId);
    139150
    140151    // InspectorInstrumentation
     
    171182    int boundNodeId(const Node*);
    172183
    173     static String documentURLString(Document*);
    174 
    175184    RefPtr<Inspector::Protocol::Runtime::RemoteObject> resolveNode(Node*, const String& objectGroup);
    176185    bool handleMousePress();
     
    180189
    181190    InspectorHistory* history() { return m_history.get(); }
    182 
    183     // We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently.
    184     // We also skip whitespace text nodes conditionally. Following methods encapsulate these specifics.
    185     static Node* innerFirstChild(Node*);
    186     static Node* innerNextSibling(Node*);
    187     static Node* innerPreviousSibling(Node*);
    188     static unsigned innerChildNodeCount(Node*);
    189     static Node* innerParentNode(Node*);
     191    Vector<Document*> documents();
     192    void reset();
    190193
    191194    Node* assertNode(ErrorString&, int nodeId);
    192195    Element* assertElement(ErrorString&, int nodeId);
    193196    Document* assertDocument(ErrorString&, int nodeId);
    194 
    195     static Node* scriptValueAsNode(JSC::JSValue);
    196     static JSC::JSValue nodeAsScriptValue(JSC::ExecState&, Node*);
    197197
    198198    bool hasBreakpointForEventListener(EventTarget&, const AtomString& eventType, EventListener&, bool capture);
  • trunk/Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.cpp

    r249128 r249132  
    7575}
    7676
    77 InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent()
    78 {
    79     ASSERT(!m_debuggerAgent);
    80     ASSERT(!m_instrumentingAgents.inspectorDOMDebuggerAgent());
    81 }
     77InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent() = default;
    8278
    8379// Browser debugger agent enabled only when JS debugger is enabled.
  • trunk/Source/WebCore/inspector/agents/InspectorDOMDebuggerAgent.h

    r248201 r249132  
    5353typedef String ErrorString;
    5454
    55 class InspectorDOMDebuggerAgent final : public InspectorAgentBase, public Inspector::InspectorDebuggerAgent::Listener, public Inspector::DOMDebuggerBackendDispatcherHandler {
     55class InspectorDOMDebuggerAgent final : public InspectorAgentBase, public Inspector::DOMDebuggerBackendDispatcherHandler, public Inspector::InspectorDebuggerAgent::Listener {
    5656    WTF_MAKE_NONCOPYABLE(InspectorDOMDebuggerAgent);
    5757    WTF_MAKE_FAST_ALLOCATED;
     
    6060    virtual ~InspectorDOMDebuggerAgent();
    6161
    62     // DOMDebugger API
    63     void setURLBreakpoint(ErrorString&, const String& url, const bool* optionalIsRegex) final;
    64     void removeURLBreakpoint(ErrorString&, const String& url) final;
    65     void setEventBreakpoint(ErrorString&, const String& breakpointType, const String* eventName) final;
    66     void removeEventBreakpoint(ErrorString&, const String& breakpointType, const String* eventName) final;
    67     void setDOMBreakpoint(ErrorString&, int nodeId, const String& type) final;
    68     void removeDOMBreakpoint(ErrorString&, int nodeId, const String& type) final;
     62    // InspectorAgentBase
     63    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     64    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
     65    void discardAgent();
     66
     67    // DOMDebuggerBackendDispatcherHandler
     68    void setURLBreakpoint(ErrorString&, const String& url, const bool* optionalIsRegex);
     69    void removeURLBreakpoint(ErrorString&, const String& url);
     70    void setEventBreakpoint(ErrorString&, const String& breakpointType, const String* eventName);
     71    void removeEventBreakpoint(ErrorString&, const String& breakpointType, const String* eventName);
     72    void setDOMBreakpoint(ErrorString&, int nodeId, const String& type);
     73    void removeDOMBreakpoint(ErrorString&, int nodeId, const String& type);
     74
     75    // InspectorDebuggerAgent::Listener
     76    void debuggerWasEnabled();
     77    void debuggerWasDisabled();
    6978
    7079    // InspectorInstrumentation
     
    8493    void mainFrameDOMContentLoaded();
    8594
    86     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) final;
    87     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) final;
    88     void discardAgent() final;
     95    void disable();
    8996
    9097private:
    91     // Inspector::InspectorDebuggerAgent::Listener implementation.
    92     void debuggerWasEnabled() final;
    93     void debuggerWasDisabled() final;
    94     void disable();
    95 
    9698    enum class URLBreakpointSource { Fetch, XHR };
    9799    void breakOnURLIfNeeded(const String& url, URLBreakpointSource);
  • trunk/Source/WebCore/inspector/agents/InspectorDOMStorageAgent.cpp

    r249128 r249132  
    6363}
    6464
     65InspectorDOMStorageAgent::~InspectorDOMStorageAgent() = default;
     66
    6567void InspectorDOMStorageAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
    6668{
  • trunk/Source/WebCore/inspector/agents/InspectorDOMStorageAgent.h

    r243303 r249132  
    5353public:
    5454    InspectorDOMStorageAgent(PageAgentContext&);
    55     virtual ~InspectorDOMStorageAgent() = default;
     55    virtual ~InspectorDOMStorageAgent();
    5656
    57     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    58     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
     57    // InspectorAgentBase
     58    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     59    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
    5960
    60     // Called from the front-end.
    61     void enable(ErrorString&) override;
    62     void disable(ErrorString&) override;
    63     void getDOMStorageItems(ErrorString&, const JSON::Object& storageId, RefPtr<JSON::ArrayOf<JSON::ArrayOf<String>>>& items) override;
    64     void setDOMStorageItem(ErrorString&, const JSON::Object& storageId, const String& key, const String& value) override;
    65     void removeDOMStorageItem(ErrorString&, const JSON::Object& storageId, const String& key) override;
    66 
    67     // Called from the injected script.
    68     static String storageId(Storage&);
    69     static RefPtr<Inspector::Protocol::DOMStorage::StorageId> storageId(SecurityOrigin*, bool isLocalStorage);
     61    // DOMStorageBackendDispatcherHandler
     62    void enable(ErrorString&);
     63    void disable(ErrorString&);
     64    void getDOMStorageItems(ErrorString&, const JSON::Object& storageId, RefPtr<JSON::ArrayOf<JSON::ArrayOf<String>>>& items);
     65    void setDOMStorageItem(ErrorString&, const JSON::Object& storageId, const String& key, const String& value);
     66    void removeDOMStorageItem(ErrorString&, const JSON::Object& storageId, const String& key);
    7067
    7168    // InspectorInstrumentation
    7269    void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*);
     70
     71    // CommandLineAPI
     72    static String storageId(Storage&);
     73    static RefPtr<Inspector::Protocol::DOMStorage::StorageId> storageId(SecurityOrigin*, bool isLocalStorage);
    7374
    7475private:
  • trunk/Source/WebCore/inspector/agents/InspectorDatabaseAgent.cpp

    r249128 r249132  
    223223}
    224224
     225InspectorDatabaseAgent::~InspectorDatabaseAgent() = default;
     226
    225227void InspectorDatabaseAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
    226228{
  • trunk/Source/WebCore/inspector/agents/InspectorDatabaseAgent.h

    r243219 r249132  
    4848    WTF_MAKE_FAST_ALLOCATED;
    4949public:
    50     explicit InspectorDatabaseAgent(WebAgentContext&);
    51     virtual ~InspectorDatabaseAgent() = default;
     50    InspectorDatabaseAgent(WebAgentContext&);
     51    virtual ~InspectorDatabaseAgent();
    5252
    53     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    54     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
     53    // InspectorAgentBase
     54    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     55    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
    5556
    56 
    57     // Called from the front-end.
    58     void enable(ErrorString&) override;
    59     void disable(ErrorString&) override;
    60     void getDatabaseTableNames(ErrorString&, const String& databaseId, RefPtr<JSON::ArrayOf<String>>& names) override;
    61     void executeSQL(const String& databaseId, const String& query, Ref<ExecuteSQLCallback>&&) override;
    62 
    63     // Called from the injected script.
    64     String databaseId(Database&);
     57    // DatabaseBackendDispatcherHandler
     58    void enable(ErrorString&);
     59    void disable(ErrorString&);
     60    void getDatabaseTableNames(ErrorString&, const String& databaseId, RefPtr<JSON::ArrayOf<String>>& names);
     61    void executeSQL(const String& databaseId, const String& query, Ref<ExecuteSQLCallback>&&);
    6562
    6663    // InspectorInstrumentation
    6764    void didCommitLoad();
    6865    void didOpenDatabase(Database&);
     66
     67    // CommandLineAPI
     68    String databaseId(Database&);
    6969
    7070private:
  • trunk/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.cpp

    r249128 r249132  
    528528}
    529529
     530InspectorIndexedDBAgent::~InspectorIndexedDBAgent() = default;
     531
    530532void InspectorIndexedDBAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
    531533{
  • trunk/Source/WebCore/inspector/agents/InspectorIndexedDBAgent.h

    r243303 r249132  
    5353public:
    5454    InspectorIndexedDBAgent(PageAgentContext&);
    55     virtual ~InspectorIndexedDBAgent() = default;
     55    virtual ~InspectorIndexedDBAgent();
    5656
    57     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    58     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
     57    // InspectorAgentBase
     58    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     59    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
    5960
    6061    // IndexedDBBackendDispatcherHandler
    61     void enable(ErrorString&) override;
    62     void disable(ErrorString&) override;
    63     void requestDatabaseNames(const String& securityOrigin, Ref<RequestDatabaseNamesCallback>&&) override;
    64     void requestDatabase(const String& securityOrigin, const String& databaseName, Ref<RequestDatabaseCallback>&&) override;
    65     void requestData(const String& securityOrigin, const String& databaseName, const String& objectStoreName, const String& indexName, int skipCount, int pageSize, const JSON::Object* keyRange, Ref<RequestDataCallback>&&) override;
    66     void clearObjectStore(const String& in_securityOrigin, const String& in_databaseName, const String& in_objectStoreName, Ref<ClearObjectStoreCallback>&&) override;
     62    void enable(ErrorString&);
     63    void disable(ErrorString&);
     64    void requestDatabaseNames(const String& securityOrigin, Ref<RequestDatabaseNamesCallback>&&);
     65    void requestDatabase(const String& securityOrigin, const String& databaseName, Ref<RequestDatabaseCallback>&&);
     66    void requestData(const String& securityOrigin, const String& databaseName, const String& objectStoreName, const String& indexName, int skipCount, int pageSize, const JSON::Object* keyRange, Ref<RequestDataCallback>&&);
     67    void clearObjectStore(const String& securityOrigin, const String& databaseName, const String& objectStoreName, Ref<ClearObjectStoreCallback>&&);
    6768
    6869private:
  • trunk/Source/WebCore/inspector/agents/InspectorLayerTreeAgent.cpp

    r249128 r249132  
    5454}
    5555
    56 InspectorLayerTreeAgent::~InspectorLayerTreeAgent()
    57 {
    58     reset();
    59 }
     56InspectorLayerTreeAgent::~InspectorLayerTreeAgent() = default;
    6057
    6158void InspectorLayerTreeAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
     
    8683{
    8784    m_instrumentingAgents.setInspectorLayerTreeAgent(nullptr);
     85
     86    reset();
    8887}
    8988
  • trunk/Source/WebCore/inspector/agents/InspectorLayerTreeAgent.h

    r236777 r249132  
    4949    WTF_MAKE_FAST_ALLOCATED;
    5050public:
    51     explicit InspectorLayerTreeAgent(WebAgentContext&);
     51    InspectorLayerTreeAgent(WebAgentContext&);
    5252    virtual ~InspectorLayerTreeAgent();
    5353
    54     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    55     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
    56     void reset();
     54    // InspectorAgentBase
     55    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     56    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
     57
     58    // LayerTreeBackendDispatcherHandler
     59    void enable(ErrorString&);
     60    void disable(ErrorString&);
     61    void layersForNode(ErrorString&, int nodeId, RefPtr<JSON::ArrayOf<Inspector::Protocol::LayerTree::Layer>>&);
     62    void reasonsForCompositingLayer(ErrorString&, const String& layerId, RefPtr<Inspector::Protocol::LayerTree::CompositingReasons>&);
    5763
    5864    // InspectorInstrumentation
     
    6066    void renderLayerDestroyed(const RenderLayer&);
    6167    void pseudoElementDestroyed(PseudoElement&);
    62 
    63     // Called from the front-end.
    64     void enable(ErrorString&) override;
    65     void disable(ErrorString&) override;
    66     void layersForNode(ErrorString&, int nodeId, RefPtr<JSON::ArrayOf<Inspector::Protocol::LayerTree::Layer>>&) override;
    67     void reasonsForCompositingLayer(ErrorString&, const String& layerId, RefPtr<Inspector::Protocol::LayerTree::CompositingReasons>&) override;
     68    void reset();
    6869
    6970private:
  • trunk/Source/WebCore/inspector/agents/InspectorMemoryAgent.cpp

    r249128 r249132  
    4545{
    4646}
     47
     48InspectorMemoryAgent::~InspectorMemoryAgent() = default;
    4749
    4850void InspectorMemoryAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
  • trunk/Source/WebCore/inspector/agents/InspectorMemoryAgent.h

    r248286 r249132  
    4343public:
    4444    InspectorMemoryAgent(PageAgentContext&);
    45     virtual ~InspectorMemoryAgent() = default;
     45    virtual ~InspectorMemoryAgent();
    4646
    47     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    48     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
     47    // InspectorAgentBase
     48    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     49    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
    4950
    5051    // MemoryBackendDispatcherHandler
    51     void enable(ErrorString&) override;
    52     void disable(ErrorString&) override;
    53     void startTracking(ErrorString&) override;
    54     void stopTracking(ErrorString&) override;
     52    void enable(ErrorString&);
     53    void disable(ErrorString&);
     54    void startTracking(ErrorString&);
     55    void stopTracking(ErrorString&);
    5556
    5657    // InspectorInstrumentation
  • trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp

    r249128 r249132  
    180180}
    181181
     182InspectorNetworkAgent::~InspectorNetworkAgent() = default;
     183
    182184void InspectorNetworkAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
    183185{
     
    391393}
    392394
    393 InspectorNetworkAgent::~InspectorNetworkAgent()
    394 {
    395     if (m_enabled) {
    396         ErrorString ignored;
    397         disable(ignored);
    398     }
    399     ASSERT(!m_instrumentingAgents.inspectorNetworkAgent());
    400 }
    401 
    402395double InspectorNetworkAgent::timestamp()
    403396{
  • trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.h

    r239427 r249132  
    6969    WTF_MAKE_FAST_ALLOCATED;
    7070public:
    71     explicit InspectorNetworkAgent(WebAgentContext&);
    7271    virtual ~InspectorNetworkAgent();
    7372
     
    7776    static bool cachedResourceContent(CachedResource&, String* result, bool* base64Encoded);
    7877
    79     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    80     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
     78    // InspectorAgentBase
     79    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) final;
     80    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) final;
     81
     82    // NetworkBackendDispatcherHandler
     83    void enable(ErrorString&) final;
     84    void disable(ErrorString&) final;
     85    void setExtraHTTPHeaders(ErrorString&, const JSON::Object& headers) final;
     86    void getResponseBody(ErrorString&, const String& requestId, String* content, bool* base64Encoded) final;
     87    void setResourceCachingDisabled(ErrorString&, bool disabled) final;
     88    void loadResource(const String& frameId, const String& url, Ref<LoadResourceCallback>&&) final;
     89    void getSerializedCertificate(ErrorString&, const String& requestId, String* serializedCertificate) final;
     90    void resolveWebSocket(ErrorString&, const String& requestId, const String* objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>&) final;
    8191
    8292    // InspectorInstrumentation
     
    109119    void searchInRequest(ErrorString&, const String& requestId, const String& query, bool caseSensitive, bool isRegex, RefPtr<JSON::ArrayOf<Inspector::Protocol::GenericTypes::SearchMatch>>&);
    110120
    111     // Called from frontend.
    112     void enable(ErrorString&) final;
    113     void disable(ErrorString&) final;
    114     void setExtraHTTPHeaders(ErrorString&, const JSON::Object& headers) final;
    115     void getResponseBody(ErrorString&, const String& requestId, String* content, bool* base64Encoded) final;
    116     void setResourceCachingDisabled(ErrorString&, bool disabled) final;
    117     void loadResource(const String& frameId, const String& url, Ref<LoadResourceCallback>&&) final;
    118     void getSerializedCertificate(ErrorString&, const String& requestId, String* serializedCertificate) final;
    119     void resolveWebSocket(ErrorString&, const String& requestId, const String* objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>&) final;
     121protected:
     122    InspectorNetworkAgent(WebAgentContext&);
    120123
    121124    virtual String loaderIdentifier(DocumentLoader*) = 0;
  • trunk/Source/WebCore/inspector/agents/InspectorPageAgent.cpp

    r249128 r249132  
    342342}
    343343
     344InspectorPageAgent::~InspectorPageAgent() = default;
     345
    344346void InspectorPageAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
    345347{
  • trunk/Source/WebCore/inspector/agents/InspectorPageAgent.h

    r248943 r249132  
    5858public:
    5959    InspectorPageAgent(PageAgentContext&, InspectorClient*, InspectorOverlay*);
     60    virtual ~InspectorPageAgent();
    6061
    6162    enum ResourceType {
     
    8889    static DocumentLoader* assertDocumentLoader(ErrorString&, Frame*);
    8990
     91    // InspectorAgentBase
     92    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     93    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
     94
    9095    // PageBackendDispatcherHandler
    91     void enable(ErrorString&) final;
    92     void disable(ErrorString&) final;
    93     void reload(ErrorString&, const bool* optionalReloadFromOrigin, const bool* optionalRevalidateAllResources) final;
    94     void navigate(ErrorString&, const String& url) final;
    95     void overrideUserAgent(ErrorString&, const String* value) final;
    96     void overrideSetting(ErrorString&, const String& setting, const bool* value) final;
    97     void getCookies(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Page::Cookie>>& cookies) final;
    98     void deleteCookie(ErrorString&, const String& cookieName, const String& url) final;
    99     void getResourceTree(ErrorString&, RefPtr<Inspector::Protocol::Page::FrameResourceTree>&) final;
    100     void getResourceContent(ErrorString&, const String& frameId, const String& url, String* content, bool* base64Encoded) final;
    101     void searchInResource(ErrorString&, const String& frameId, const String& url, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, const String* optionalRequestId, RefPtr<JSON::ArrayOf<Inspector::Protocol::GenericTypes::SearchMatch>>&) final;
    102     void searchInResources(ErrorString&, const String&, const bool* caseSensitive, const bool* isRegex, RefPtr<JSON::ArrayOf<Inspector::Protocol::Page::SearchResult>>&) final;
    103     void setShowRulers(ErrorString&, bool) final;
    104     void setShowPaintRects(ErrorString&, bool show) final;
    105     void setEmulatedMedia(ErrorString&, const String&) final;
    106     void setForcedAppearance(ErrorString&, const String&) final;
    107     void getCompositingBordersVisible(ErrorString&, bool* out_param) final;
    108     void setCompositingBordersVisible(ErrorString&, bool) final;
    109     void snapshotNode(ErrorString&, int nodeId, String* outDataURL) final;
    110     void snapshotRect(ErrorString&, int x, int y, int width, int height, const String& coordinateSystem, String* outDataURL) final;
    111     void archive(ErrorString&, String* data) final;
     96    void enable(ErrorString&);
     97    void disable(ErrorString&);
     98    void reload(ErrorString&, const bool* optionalReloadFromOrigin, const bool* optionalRevalidateAllResources);
     99    void navigate(ErrorString&, const String& url);
     100    void overrideUserAgent(ErrorString&, const String* value);
     101    void overrideSetting(ErrorString&, const String& setting, const bool* value);
     102    void getCookies(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Page::Cookie>>& cookies);
     103    void deleteCookie(ErrorString&, const String& cookieName, const String& url);
     104    void getResourceTree(ErrorString&, RefPtr<Inspector::Protocol::Page::FrameResourceTree>&);
     105    void getResourceContent(ErrorString&, const String& frameId, const String& url, String* content, bool* base64Encoded);
     106    void searchInResource(ErrorString&, const String& frameId, const String& url, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, const String* optionalRequestId, RefPtr<JSON::ArrayOf<Inspector::Protocol::GenericTypes::SearchMatch>>&);
     107    void searchInResources(ErrorString&, const String&, const bool* caseSensitive, const bool* isRegex, RefPtr<JSON::ArrayOf<Inspector::Protocol::Page::SearchResult>>&);
     108    void setShowRulers(ErrorString&, bool);
     109    void setShowPaintRects(ErrorString&, bool show);
     110    void setEmulatedMedia(ErrorString&, const String&);
     111    void setForcedAppearance(ErrorString&, const String&);
     112    void getCompositingBordersVisible(ErrorString&, bool* out_param);
     113    void setCompositingBordersVisible(ErrorString&, bool);
     114    void snapshotNode(ErrorString&, int nodeId, String* outDataURL);
     115    void snapshotRect(ErrorString&, int x, int y, int width, int height, const String& coordinateSystem, String* outDataURL);
     116    void archive(ErrorString&, String* data);
    112117
    113118    // InspectorInstrumentation
     
    129134    void didRecalculateStyle();
    130135
    131     // Inspector Controller API
    132     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) final;
    133     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) final;
    134 
    135     // Cross-agents API
    136136    Frame* frameForId(const String& frameId);
    137137    WEBCORE_EXPORT String frameId(Frame*);
  • trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp

    r249128 r249132  
    619619}
    620620
    621 void InspectorTimelineAgent::didCommitLoad()
    622 {
    623     clearRecordStack();
    624 }
    625 
    626621void InspectorTimelineAgent::didRequestAnimationFrame(int callbackId, Frame* frame)
    627622{
  • trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.h

    r248894 r249132  
    8282};
    8383
    84 class InspectorTimelineAgent final
    85     : public InspectorAgentBase
    86     , public Inspector::TimelineBackendDispatcherHandler
    87     , public Inspector::ScriptDebugListener {
     84class InspectorTimelineAgent final : public InspectorAgentBase , public Inspector::TimelineBackendDispatcherHandler , public Inspector::ScriptDebugListener {
    8885    WTF_MAKE_NONCOPYABLE(InspectorTimelineAgent);
    8986    WTF_MAKE_FAST_ALLOCATED;
     
    9289    virtual ~InspectorTimelineAgent();
    9390
    94     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) final;
    95     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) final;
     91    // InspectorAgentBase
     92    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     93    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
    9694
    9795    // TimelineBackendDispatcherHandler
    98     void enable(ErrorString&) final;
    99     void disable(ErrorString&) final;
    100     void start(ErrorString&, const int* maxCallStackDepth = nullptr) final;
    101     void stop(ErrorString&) final;
    102     void setAutoCaptureEnabled(ErrorString&, bool) final;
    103     void setInstruments(ErrorString&, const JSON::Array&) final;
    104 
    105     int id() const { return m_id; }
    106 
    107     void didCommitLoad();
    108 
    109     // Methods called from WebCore.
    110     void startFromConsole(JSC::ExecState*, const String& title);
    111     void stopFromConsole(JSC::ExecState*, const String& title);
     96    void enable(ErrorString&);
     97    void disable(ErrorString&);
     98    void start(ErrorString&, const int* maxCallStackDepth = nullptr);
     99    void stop(ErrorString&);
     100    void setAutoCaptureEnabled(ErrorString&, bool);
     101    void setInstruments(ErrorString&, const JSON::Array&);
     102
     103    // ScriptDebugListener
     104    void didParseSource(JSC::SourceID, const Script&) { }
     105    void failedToParseSource(const String&, const String&, int, int, const String&) { }
     106    void willRunMicrotask() { }
     107    void didRunMicrotask() { }
     108    void didPause(JSC::ExecState&, JSC::JSValue, JSC::JSValue) { }
     109    void didContinue() { }
     110    void breakpointActionLog(JSC::ExecState&, const String&) { }
     111    void breakpointActionSound(int) { }
     112    void breakpointActionProbe(JSC::ExecState&, const Inspector::ScriptBreakpointAction&, unsigned batchId, unsigned sampleId, JSC::JSValue result);
    112113
    113114    // InspectorInstrumentation
     
    144145    void mainFrameNavigated();
    145146
     147    // Console
     148    void startFromConsole(JSC::ExecState*, const String& title);
     149    void stopFromConsole(JSC::ExecState*, const String& title);
     150
     151    int id() const { return m_id; }
     152
    146153private:
    147     // JSC::ScriptDebugListener
    148     void didParseSource(JSC::SourceID, const Script&) final { }
    149     void failedToParseSource(const String&, const String&, int, int, const String&) final { }
    150     void willRunMicrotask() final { }
    151     void didRunMicrotask() final { }
    152     void didPause(JSC::ExecState&, JSC::JSValue, JSC::JSValue) final { }
    153     void didContinue() final { }
    154     void breakpointActionLog(JSC::ExecState&, const String&) final { }
    155     void breakpointActionSound(int) final { }
    156     void breakpointActionProbe(JSC::ExecState&, const Inspector::ScriptBreakpointAction&, unsigned batchId, unsigned sampleId, JSC::JSValue result) final;
    157 
    158154    void startProgrammaticCapture();
    159155    void stopProgrammaticCapture();
  • trunk/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp

    r249128 r249132  
    4242{
    4343}
     44
     45InspectorWorkerAgent::~InspectorWorkerAgent() = default;
    4446
    4547void InspectorWorkerAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
  • trunk/Source/WebCore/inspector/agents/InspectorWorkerAgent.h

    r238771 r249132  
    4343public:
    4444    InspectorWorkerAgent(PageAgentContext&);
    45     virtual ~InspectorWorkerAgent() = default;
     45    virtual ~InspectorWorkerAgent();
    4646
    47     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
    48     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
     47    // InspectorAgentBase
     48    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     49    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
    4950
    5051    // WorkerBackendDispatcherHandler
    51     void enable(ErrorString&) override;
    52     void disable(ErrorString&) override;
    53     void initialized(ErrorString&, const String& workerId) override;
    54     void sendMessageToWorker(ErrorString&, const String& workerId, const String& message) override;
     52    void enable(ErrorString&);
     53    void disable(ErrorString&);
     54    void initialized(ErrorString&, const String& workerId);
     55    void sendMessageToWorker(ErrorString&, const String& workerId, const String& message);
    5556
    56     // PageChannel
    57     void sendMessageFromWorkerToFrontend(WorkerInspectorProxy*, const String& message) override;
     57    // WorkerInspectorProxy::PageChannel
     58    void sendMessageFromWorkerToFrontend(WorkerInspectorProxy*, const String& message);
    5859
    5960    // InspectorInstrumentation
  • trunk/Source/WebCore/inspector/agents/WebConsoleAgent.cpp

    r248846 r249132  
    4444using namespace Inspector;
    4545
    46 WebConsoleAgent::WebConsoleAgent(AgentContext& context)
     46WebConsoleAgent::WebConsoleAgent(WebAgentContext& context)
    4747    : InspectorConsoleAgent(context)
    4848{
    4949}
     50
     51WebConsoleAgent::~WebConsoleAgent() = default;
    5052
    5153void WebConsoleAgent::frameWindowDiscarded(DOMWindow* window)
  • trunk/Source/WebCore/inspector/agents/WebConsoleAgent.h

    r243328 r249132  
    3939    WTF_MAKE_FAST_ALLOCATED;
    4040public:
    41     WebConsoleAgent(Inspector::AgentContext&);
    42     virtual ~WebConsoleAgent() = default;
     41    WebConsoleAgent(WebAgentContext&);
     42    virtual ~WebConsoleAgent();
    4343
     44    // InspectorInstrumentation
    4445    void frameWindowDiscarded(DOMWindow*);
    45 
    4646    void didReceiveResponse(unsigned long requestIdentifier, const ResourceResponse&);
    4747    void didFailLoading(unsigned long requestIdentifier, const ResourceError&);
     48
     49protected:
    4850};
    4951
  • trunk/Source/WebCore/inspector/agents/WebDebuggerAgent.cpp

    r243192 r249132  
    4040}
    4141
     42WebDebuggerAgent::~WebDebuggerAgent() = default;
     43
    4244void WebDebuggerAgent::enable()
    4345{
  • trunk/Source/WebCore/inspector/agents/WebDebuggerAgent.h

    r228218 r249132  
    3838    WTF_MAKE_FAST_ALLOCATED;
    3939public:
    40     WebDebuggerAgent(WebAgentContext&);
    41     virtual ~WebDebuggerAgent() = default;
     40    virtual ~WebDebuggerAgent();
    4241
    4342protected:
     43    WebDebuggerAgent(WebAgentContext&);
     44
    4445    void enable() override;
    4546    void disable(bool isBeingDestroyed) override;
  • trunk/Source/WebCore/inspector/agents/WebHeapAgent.cpp

    r248846 r249132  
    102102}
    103103
    104 WebHeapAgent::~WebHeapAgent()
    105 {
    106     m_sendGarbageCollectionEventsTask->reset();
    107 }
     104WebHeapAgent::~WebHeapAgent() = default;
    108105
    109106void WebHeapAgent::enable(ErrorString& errorString)
  • trunk/Source/WebCore/inspector/agents/WebHeapAgent.h

    r243150 r249132  
    4444    virtual ~WebHeapAgent();
    4545
    46 protected:
     46    // HeapBackendDispatcherHandler
    4747    void enable(ErrorString&) override;
    4848    void disable(ErrorString&) override;
    4949
    50     void dispatchGarbageCollectedEvent(Inspector::Protocol::Heap::GarbageCollection::Type, Seconds startTime, Seconds endTime) override;
    51 
     50protected:
     51    void dispatchGarbageCollectedEvent(Inspector::Protocol::Heap::GarbageCollection::Type, Seconds startTime, Seconds endTime) final;
    5252    void dispatchGarbageCollectionEventsAfterDelay(Vector<GarbageCollectionData>&& collections);
    5353
  • trunk/Source/WebCore/inspector/agents/page/PageAuditAgent.cpp

    r249128 r249132  
    5454{
    5555}
     56
     57PageAuditAgent::~PageAuditAgent() = default;
    5658
    5759InjectedScript PageAuditAgent::injectedScriptForEval(const int* executionContextId)
  • trunk/Source/WebCore/inspector/agents/page/PageAuditAgent.h

    r240188 r249132  
    3737    WTF_MAKE_FAST_ALLOCATED;
    3838public:
    39     explicit PageAuditAgent(PageAgentContext&);
     39    PageAuditAgent(PageAgentContext&);
     40    virtual ~PageAuditAgent();
    4041
    4142private:
    4243    Inspector::InjectedScript injectedScriptForEval(const int* executionContextId);
    43     Inspector::InjectedScript injectedScriptForEval(Inspector::ErrorString&, const int* executionContextId) override;
     44    Inspector::InjectedScript injectedScriptForEval(Inspector::ErrorString&, const int* executionContextId);
    4445
    45     void populateAuditObject(JSC::ExecState*, JSC::Strong<JSC::JSObject>& auditObject) override;
     46    void populateAuditObject(JSC::ExecState*, JSC::Strong<JSC::JSObject>& auditObject);
    4647
    47     void muteConsole() override;
    48     void unmuteConsole() override;
     48    void muteConsole();
     49    void unmuteConsole();
    4950
    5051    Page& m_inspectedPage;
  • trunk/Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp

    r249128 r249132  
    5252{
    5353}
     54
     55PageConsoleAgent::~PageConsoleAgent() = default;
    5456
    5557void PageConsoleAgent::clearMessages(ErrorString& errorString)
  • trunk/Source/WebCore/inspector/agents/page/PageConsoleAgent.h

    r243328 r249132  
    4242public:
    4343    PageConsoleAgent(PageAgentContext&);
    44     virtual ~PageConsoleAgent() = default;
     44    virtual ~PageConsoleAgent();
    4545
    46     void getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Console::Channel>>&) final;
    47     void setLoggingChannelLevel(ErrorString&, const String& channel, const String& level) final;
     46    // ConsoleBackendDispatcherHandler
     47    void clearMessages(ErrorString&);
     48    void getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Console::Channel>>&);
     49    void setLoggingChannelLevel(ErrorString&, const String& channel, const String& level);
    4850
    4951private:
    50     void clearMessages(ErrorString&) override;
    51 
    5252    InstrumentingAgents& m_instrumentingAgents;
    5353    Page& m_inspectedPage;
  • trunk/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp

    r249128 r249132  
    6666}
    6767
     68PageDebuggerAgent::~PageDebuggerAgent() = default;
     69
    6870void PageDebuggerAgent::evaluateOnCallFrame(ErrorString& errorString, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* emulateUserGesture, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex)
    6971{
  • trunk/Source/WebCore/inspector/agents/page/PageDebuggerAgent.h

    r248894 r249132  
    4848public:
    4949    PageDebuggerAgent(PageAgentContext&);
    50     virtual ~PageDebuggerAgent() = default;
     50    virtual ~PageDebuggerAgent();
    5151
    5252    // DebuggerBackendDispatcherHandler
    53     void evaluateOnCallFrame(ErrorString&, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* emulateUserGesture, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) final;
     53    void evaluateOnCallFrame(ErrorString&, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* emulateUserGesture, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex);
     54
     55    // ScriptDebugListener
     56    void breakpointActionLog(JSC::ExecState&, const String&);
    5457
    5558    // InspectorInstrumentation
     
    6972    void didDispatchPostMessage(const TimerBase&);
    7073
    71 protected:
    72     void enable() override;
    73     void disable(bool isBeingDestroyed) override;
     74private:
     75    void enable();
     76    void disable(bool isBeingDestroyed);
    7477
    75     String sourceMapURLForScript(const Script&) override;
     78    String sourceMapURLForScript(const Script&);
    7679
    77     void didClearAsyncStackTraceData() override;
     80    void didClearAsyncStackTraceData();
    7881
    79 private:
    80     void muteConsole() override;
    81     void unmuteConsole() override;
     82    void muteConsole();
     83    void unmuteConsole();
    8284
    83     // JSC::ScriptDebugListener
    84     void breakpointActionLog(JSC::ExecState&, const String&) override;
    85 
    86     Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
     85    Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId);
    8786
    8887    Page& m_inspectedPage;
  • trunk/Source/WebCore/inspector/agents/page/PageHeapAgent.cpp

    r243150 r249132  
    3838}
    3939
     40PageHeapAgent::~PageHeapAgent() = default;
     41
    4042void PageHeapAgent::enable(ErrorString& errorString)
    4143{
  • trunk/Source/WebCore/inspector/agents/page/PageHeapAgent.h

    r224345 r249132  
    3939public:
    4040    PageHeapAgent(PageAgentContext&);
    41     virtual ~PageHeapAgent() = default;
     41    virtual ~PageHeapAgent();
    4242
    43     void enable(ErrorString&) override;
    44     void disable(ErrorString&) override;
     43    // HeapBackendDispatcherHandler
     44    void enable(ErrorString&);
     45    void disable(ErrorString&);
    4546
     47    // InspectorInstrumentation
    4648    void mainFrameNavigated();
    4749
  • trunk/Source/WebCore/inspector/agents/page/PageNetworkAgent.cpp

    r249128 r249132  
    4646{
    4747}
     48
     49PageNetworkAgent::~PageNetworkAgent() = default;
    4850
    4951String PageNetworkAgent::loaderIdentifier(DocumentLoader* loader)
  • trunk/Source/WebCore/inspector/agents/page/PageNetworkAgent.h

    r243303 r249132  
    3737public:
    3838    PageNetworkAgent(PageAgentContext&);
    39     virtual ~PageNetworkAgent() = default;
     39    virtual ~PageNetworkAgent();
    4040
    4141private:
    42     String loaderIdentifier(DocumentLoader*) final;
    43     String frameIdentifier(DocumentLoader*) final;
    44     Vector<WebSocket*> activeWebSockets(const LockHolder&) final;
    45     void setResourceCachingDisabled(bool) final;
    46     ScriptExecutionContext* scriptExecutionContext(ErrorString&, const String& frameId) final;
    47     bool shouldForceBufferingNetworkResourceData() const final { return false; }
     42    String loaderIdentifier(DocumentLoader*);
     43    String frameIdentifier(DocumentLoader*);
     44    Vector<WebSocket*> activeWebSockets(const LockHolder&);
     45    void setResourceCachingDisabled(bool);
     46    ScriptExecutionContext* scriptExecutionContext(ErrorString&, const String& frameId);
     47    bool shouldForceBufferingNetworkResourceData() const { return false; }
    4848
    4949    Page& m_inspectedPage;
  • trunk/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp

    r249128 r249132  
    6464{
    6565}
     66
     67PageRuntimeAgent::~PageRuntimeAgent() = default;
    6668
    6769void PageRuntimeAgent::enable(ErrorString& errorString)
  • trunk/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h

    r243243 r249132  
    5252public:
    5353    PageRuntimeAgent(PageAgentContext&);
    54     virtual ~PageRuntimeAgent() = default;
     54    virtual ~PageRuntimeAgent();
    5555
    5656    // RuntimeBackendDispatcherHandler
    57     void enable(ErrorString&) override;
    58     void disable(ErrorString&) override;
    59     void evaluate(ErrorString&, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* emulateUserGesture, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) final;
     57    void enable(ErrorString&);
     58    void disable(ErrorString&);
     59    void evaluate(ErrorString&, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, const bool* emulateUserGesture, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex);
    6060
    6161    // InspectorInstrumentation
     
    6363
    6464private:
    65     Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
    66     void muteConsole() override;
    67     void unmuteConsole() override;
     65    Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId);
     66    void muteConsole();
     67    void unmuteConsole();
    6868    void reportExecutionContextCreation();
    6969    void notifyContextCreated(const String& frameId, JSC::ExecState*, SecurityOrigin*, bool isPageContext);
  • trunk/Source/WebCore/inspector/agents/worker/ServiceWorkerAgent.cpp

    r233122 r249132  
    4545}
    4646
     47ServiceWorkerAgent::~ServiceWorkerAgent() = default;
     48
    4749void ServiceWorkerAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
    4850{
  • trunk/Source/WebCore/inspector/agents/worker/ServiceWorkerAgent.h

    r228218 r249132  
    4141    WTF_MAKE_FAST_ALLOCATED;
    4242public:
    43     explicit ServiceWorkerAgent(WorkerAgentContext&);
    44     virtual ~ServiceWorkerAgent() = default;
     43    ServiceWorkerAgent(WorkerAgentContext&);
     44    virtual ~ServiceWorkerAgent();
    4545
    46     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) final;
    47     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) final;
     46    // InspectorAgentBase
     47    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*);
     48    void willDestroyFrontendAndBackend(Inspector::DisconnectReason);
    4849
    4950    // ServiceWorkerBackendDispatcherHandler
    50     void getInitializationInfo(ErrorString&, RefPtr<Inspector::Protocol::ServiceWorker::Configuration>&) final;
     51    void getInitializationInfo(ErrorString&, RefPtr<Inspector::Protocol::ServiceWorker::Configuration>&);
    5152
    5253private:
  • trunk/Source/WebCore/inspector/agents/worker/WorkerAuditAgent.cpp

    r249128 r249132  
    4747}
    4848
     49WorkerAuditAgent::~WorkerAuditAgent() = default;
     50
    4951InjectedScript WorkerAuditAgent::injectedScriptForEval(ErrorString& errorString, const int* executionContextId)
    5052{
  • trunk/Source/WebCore/inspector/agents/worker/WorkerAuditAgent.h

    r239976 r249132  
    3737    WTF_MAKE_FAST_ALLOCATED;
    3838public:
    39     explicit WorkerAuditAgent(WorkerAgentContext&);
     39    WorkerAuditAgent(WorkerAgentContext&);
     40    virtual ~WorkerAuditAgent();
    4041
    4142private:
    42     Inspector::InjectedScript injectedScriptForEval(Inspector::ErrorString&, const int* executionContextId) override;
     43    Inspector::InjectedScript injectedScriptForEval(Inspector::ErrorString&, const int* executionContextId);
    4344
    4445    WorkerGlobalScope& m_workerGlobalScope;
  • trunk/Source/WebCore/inspector/agents/worker/WorkerConsoleAgent.cpp

    r243150 r249132  
    3939}
    4040
     41WorkerConsoleAgent::~WorkerConsoleAgent() = default;
     42
    4143} // namespace WebCore
  • trunk/Source/WebCore/inspector/agents/worker/WorkerConsoleAgent.h

    r243150 r249132  
    3636public:
    3737    WorkerConsoleAgent(WorkerAgentContext&);
    38     ~WorkerConsoleAgent() = default;
     38    virtual ~WorkerConsoleAgent();
    3939};
    4040
  • trunk/Source/WebCore/inspector/agents/worker/WorkerDebuggerAgent.h

    r248894 r249132  
    3737public:
    3838    WorkerDebuggerAgent(WorkerAgentContext&);
    39     ~WorkerDebuggerAgent();
     39    virtual ~WorkerDebuggerAgent();
     40
     41    // ScriptDebugListener
     42    void breakpointActionLog(JSC::ExecState&, const String&);
    4043
    4144private:
    4245    // We don't need to mute console for workers.
    43     void muteConsole() override { }
    44     void unmuteConsole() override { }
     46    void muteConsole() { }
     47    void unmuteConsole() { }
    4548
    46     // JSC::ScriptDebugListener
    47     void breakpointActionLog(JSC::ExecState&, const String&) override;
    48 
    49     Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
     49    Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId);
    5050
    5151    WorkerGlobalScope& m_workerGlobalScope;
  • trunk/Source/WebCore/inspector/agents/worker/WorkerNetworkAgent.cpp

    r224788 r249132  
    4242}
    4343
     44WorkerNetworkAgent::~WorkerNetworkAgent() = default;
     45
    4446String WorkerNetworkAgent::loaderIdentifier(DocumentLoader*)
    4547{
  • trunk/Source/WebCore/inspector/agents/worker/WorkerNetworkAgent.h

    r225708 r249132  
    3434    WTF_MAKE_FAST_ALLOCATED;
    3535public:
    36     explicit WorkerNetworkAgent(WorkerAgentContext&);
    37     virtual ~WorkerNetworkAgent() = default;
     36    WorkerNetworkAgent(WorkerAgentContext&);
     37    virtual ~WorkerNetworkAgent();
    3838
    3939private:
    40     String loaderIdentifier(DocumentLoader*) final;
    41     String frameIdentifier(DocumentLoader*) final;
    42     Vector<WebSocket*> activeWebSockets(const LockHolder&) final;
    43     void setResourceCachingDisabled(bool) final;
    44     ScriptExecutionContext* scriptExecutionContext(ErrorString&, const String& frameId) final;
    45     bool shouldForceBufferingNetworkResourceData() const final { return true; }
     40    String loaderIdentifier(DocumentLoader*);
     41    String frameIdentifier(DocumentLoader*);
     42    Vector<WebSocket*> activeWebSockets(const LockHolder&);
     43    void setResourceCachingDisabled(bool);
     44    ScriptExecutionContext* scriptExecutionContext(ErrorString&, const String& frameId);
     45    bool shouldForceBufferingNetworkResourceData() const { return true; }
    4646
    4747    WorkerGlobalScope& m_workerGlobalScope;
  • trunk/Source/WebCore/inspector/agents/worker/WorkerRuntimeAgent.cpp

    r249128 r249132  
    5050}
    5151
     52WorkerRuntimeAgent::~WorkerRuntimeAgent() = default;
     53
    5254InjectedScript WorkerRuntimeAgent::injectedScriptForEval(ErrorString& errorString, const int* executionContextId)
    5355{
  • trunk/Source/WebCore/inspector/agents/worker/WorkerRuntimeAgent.h

    r243243 r249132  
    4545public:
    4646    WorkerRuntimeAgent(WorkerAgentContext&);
    47     ~WorkerRuntimeAgent() = default;
     47    virtual ~WorkerRuntimeAgent();
    4848
    4949private:
    50     Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
     50    Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId);
    5151
    5252    // We don't need to mute console for workers.
    53     void muteConsole() override { }
    54     void unmuteConsole() override { }
     53    void muteConsole() { }
     54    void unmuteConsole() { }
    5555
    5656    RefPtr<Inspector::RuntimeBackendDispatcher> m_backendDispatcher;
  • trunk/Source/WebKit/ChangeLog

    r249126 r249132  
     12019-08-26  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: use more C++ keywords for defining agents
     4        https://bugs.webkit.org/show_bug.cgi?id=200959
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8         - make constructors `protected` when the agent isn't meant to be constructed directly
     9         - add `virtual` destructors that are defined in the *.cpp so forward-declarations work
     10         - use `final` wherever possible
     11         - add comments to indicate where any virtual functions come from
     12
     13        * UIProcess/WebPageInspectorTargetAgent.h:
     14        * UIProcess/WebPageInspectorTargetAgent.cpp:
     15
    1162019-08-26  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Source/WebKit/UIProcess/WebPageInspectorTargetAgent.cpp

    r238370 r249132  
    3535}
    3636
     37WebPageInspectorTargetAgent::~WebPageInspectorTargetAgent() = default;
     38
    3739Inspector::FrontendChannel& WebPageInspectorTargetAgent::frontendChannel()
    3840{
  • trunk/Source/WebKit/UIProcess/WebPageInspectorTargetAgent.h

    r244225 r249132  
    3434public:
    3535    WebPageInspectorTargetAgent(Inspector::FrontendRouter&, Inspector::BackendDispatcher&);
    36     virtual ~WebPageInspectorTargetAgent() = default;
     36    virtual ~WebPageInspectorTargetAgent();
     37
     38    // InspectorTargetAgent
     39    Inspector::FrontendChannel& frontendChannel();
     40
     41    // FrontendChannel
     42    Inspector::FrontendChannel::ConnectionType connectionType() const;
     43    void sendMessageToFrontend(const String&);
    3744
    3845private:
    39     // Inspector::InspectorTargetAgent
    40     Inspector::FrontendChannel& frontendChannel() final;
    41 
    42     // Inspector::FrontendChannel
    43     Inspector::FrontendChannel::ConnectionType connectionType() const final;
    44     void sendMessageToFrontend(const String&) final;
    45 
    4646    Inspector::FrontendRouter& m_router;
    4747};
Note: See TracChangeset for help on using the changeset viewer.