Web Inspector: strip unused InspectorController methods.
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Nov 2011 09:52:10 +0000 (09:52 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Nov 2011 09:52:10 +0000 (09:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72886

Source/WebCore:

This is a follow up to the https://bugs.webkit.org/show_bug.cgi?id=63009.
I am now able to remove following InspectorController methods:
::startUserInitiatedProfiling,
::isRecordingUserInitiatedProfile,
::stopUserInitiatedProfiling,
::showAndEnableDebugger,
::debuggerEnabled,
::disableDebugger,
::startTimelineProfiler,
::stopTimelineProfiler,
::timelineProfilerEnabled,
::showConsole.

Reviewed by Yury Semikhatsky.

* WebCore.exp.in:
* WebCore.order:
* inspector/Inspector.json:
* inspector/InspectorAgent.cpp:
(WebCore::InspectorAgent::setFrontend):
* inspector/InspectorAgent.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::connectFrontend):
* inspector/InspectorController.h:
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::enable):
(WebCore::InspectorDebuggerAgent::disable):
* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::resetState):
(WebCore::InspectorProfilerAgent::clearFrontend):
(WebCore::InspectorProfilerAgent::restore):
(WebCore::InspectorProfilerAgent::start):
(WebCore::InspectorProfilerAgent::stop):
* inspector/InspectorProfilerAgent.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::start):
(WebCore::InspectorTimelineAgent::stop):
* inspector/InspectorTimelineAgent.h:
* inspector/front-end/DebuggerModel.js:
(WebInspector.DebuggerModel.prototype.enableDebugger):
(WebInspector.DebuggerModel.prototype.disableDebugger):
* inspector/front-end/TimelineManager.js:
(WebInspector.TimelineManager.prototype.start):
(WebInspector.TimelineManager.prototype.stop):
(WebInspector.TimelineManager.prototype._started):
(WebInspector.TimelineManager.prototype._stopped):
* inspector/front-end/inspector.js:

Source/WebKit/gtk:

Reviewed by Yury Semikhatsky.

* webkit/webkitwebinspector.cpp:
(webkit_web_inspector_set_property):
(webkit_web_inspector_get_property):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100985 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.order
Source/WebCore/inspector/Inspector.json
Source/WebCore/inspector/InspectorAgent.cpp
Source/WebCore/inspector/InspectorAgent.h
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorDebuggerAgent.cpp
Source/WebCore/inspector/InspectorDebuggerAgent.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorProfilerAgent.cpp
Source/WebCore/inspector/InspectorProfilerAgent.h
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/InspectorTimelineAgent.h
Source/WebCore/inspector/front-end/DebuggerModel.js
Source/WebCore/inspector/front-end/TimelineManager.js
Source/WebCore/inspector/front-end/inspector.js
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/webkit/webkitwebinspector.cpp

index 1a0ef84..cf4eb77 100644 (file)
@@ -1,3 +1,60 @@
+2011-11-22  Pavel Feldman  <pfeldman@google.com>
+
+        Web Inspector: strip unused InspectorController methods.
+        https://bugs.webkit.org/show_bug.cgi?id=72886
+
+        This is a follow up to the https://bugs.webkit.org/show_bug.cgi?id=63009.
+        I am now able to remove following InspectorController methods:
+        ::startUserInitiatedProfiling,
+        ::isRecordingUserInitiatedProfile,
+        ::stopUserInitiatedProfiling,
+        ::showAndEnableDebugger,
+        ::debuggerEnabled,
+        ::disableDebugger,
+        ::startTimelineProfiler,
+        ::stopTimelineProfiler,
+        ::timelineProfilerEnabled,
+        ::showConsole.
+
+        Reviewed by Yury Semikhatsky.
+
+        * WebCore.exp.in:
+        * WebCore.order:
+        * inspector/Inspector.json:
+        * inspector/InspectorAgent.cpp:
+        (WebCore::InspectorAgent::setFrontend):
+        * inspector/InspectorAgent.h:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::connectFrontend):
+        * inspector/InspectorController.h:
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::enable):
+        (WebCore::InspectorDebuggerAgent::disable):
+        * inspector/InspectorDebuggerAgent.h:
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didCommitLoadImpl):
+        * inspector/InspectorProfilerAgent.cpp:
+        (WebCore::InspectorProfilerAgent::resetState):
+        (WebCore::InspectorProfilerAgent::clearFrontend):
+        (WebCore::InspectorProfilerAgent::restore):
+        (WebCore::InspectorProfilerAgent::start):
+        (WebCore::InspectorProfilerAgent::stop):
+        * inspector/InspectorProfilerAgent.h:
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::start):
+        (WebCore::InspectorTimelineAgent::stop):
+        * inspector/InspectorTimelineAgent.h:
+        * inspector/front-end/DebuggerModel.js:
+        (WebInspector.DebuggerModel.prototype.enableDebugger):
+        (WebInspector.DebuggerModel.prototype.disableDebugger):
+        * inspector/front-end/TimelineManager.js:
+        (WebInspector.TimelineManager.prototype.start):
+        (WebInspector.TimelineManager.prototype.stop):
+        (WebInspector.TimelineManager.prototype._started):
+        (WebInspector.TimelineManager.prototype._stopped):
+        * inspector/front-end/inspector.js:
+
 2011-11-17  Nat Duca  <nduca@chromium.org>
 
         [chromium] Route willDraw/setNeedsRedraw to CCInputHandler and fix double-drawing issues that result
index 6e8c35e..829b260 100644 (file)
@@ -1640,20 +1640,11 @@ __ZN7WebCore22GeolocationServiceMock8setErrorEN3WTF10PassRefPtrINS_13PositionErr
 #if ENABLE(INSPECTOR)
 __ZN7WebCore15InspectorClient31doDispatchMessageOnFrontendPageEPNS_4PageERKN3WTF6StringE
 __ZN7WebCore19InspectorController14enableProfilerEv
-__ZN7WebCore19InspectorController15debuggerEnabledEv
-__ZN7WebCore19InspectorController15disableDebuggerEv
 __ZN7WebCore19InspectorController15disableProfilerEv
 __ZN7WebCore19InspectorController15profilerEnabledEv
 __ZN7WebCore19InspectorController18disconnectFrontendEv
-__ZN7WebCore19InspectorController20stopTimelineProfilerEv
-__ZN7WebCore19InspectorController21showAndEnableDebuggerEv
-__ZN7WebCore19InspectorController11showConsoleEv
-__ZN7WebCore19InspectorController21startTimelineProfilerEv
-__ZN7WebCore19InspectorController23timelineProfilerEnabledEv
 __ZN7WebCore19InspectorController25evaluateForTestInFrontendElRKN3WTF6StringE
 __ZN7WebCore19InspectorController26setInspectorFrontendClientEN3WTF10PassOwnPtrINS_23InspectorFrontendClientEEE
-__ZN7WebCore19InspectorController26stopUserInitiatedProfilingEv
-__ZN7WebCore19InspectorController27startUserInitiatedProfilingEv
 __ZN7WebCore19InspectorController39setResourcesDataSizeLimitsFromInternalsEii
 __ZN7WebCore19InspectorController4showEv
 __ZN7WebCore19InspectorController5closeEv
@@ -1671,7 +1662,6 @@ __ZN7WebCore28InspectorFrontendClientLocal31constrainedAttachedWindowHeightEjj
 __ZN7WebCore28InspectorFrontendClientLocalC2EPNS_19InspectorControllerEPNS_4PageEN3WTF10PassOwnPtrINS0_8SettingsEEE
 __ZN7WebCore28InspectorFrontendClientLocalD2Ev
 __ZNK7WebCore19InspectorController13drawHighlightERNS_15GraphicsContextE
-__ZNK7WebCore19InspectorController31isRecordingUserInitiatedProfileEv
 #endif
 
 #if ENABLE(JAVA_BRIDGE)
index eaccfe5..20fbcc0 100644 (file)
@@ -2652,7 +2652,6 @@ __ZN7WebCore21InspectorConsoleAgent5resetEv
 __ZN7WebCore21InspectorConsoleAgent20clearConsoleMessagesEPN3WTF6StringE
 __ZN3WTF6VectorINS_6OwnPtrIN7WebCore14ConsoleMessageEEELm0EE14shrinkCapacityEm
 __ZN7WebCore17InspectorDOMAgent20releaseDanglingNodesEv
-__ZN7WebCore22InspectorProfilerAgent26stopUserInitiatedProfilingEb
 __ZN7WebCore22InspectorProfilerAgent10resetStateEv
 __ZN7WebCore22InspectorDatabaseAgent14clearResourcesEv
 __ZN7WebCore24InspectorDOMStorageAgent14clearResourcesEv
@@ -26357,8 +26356,6 @@ __ZN7WebCore24JSScriptProfilePrototypeD1Ev
 __ZN7WebCore28JSScriptProfileNodePrototypeD1Ev
 __ZN3WTF6RefPtrIN3JSC11ProfileNodeEED1Ev
 __ZN3JSC14CallIdentifierD1Ev
-__ZN7WebCore24InspectorInstrumentation38getCurrentUserInitiatedProfileNameImplEPNS_19InstrumentingAgentsEb
-__ZN7WebCore22InspectorProfilerAgent34getCurrentUserInitiatedProfileNameEb
 __ZN3WTF10makeStringIPKccNS_6StringEEES3_T_T0_T1_
 __ZN3WTF13tryMakeStringIPKccNS_6StringEEENS_10PassRefPtrINS_10StringImplEEET_T0_T1_
 __ZNK7WebCore15GraphicsContext25imageInterpolationQualityEv
index 9e8a964..e82e71e 100644 (file)
                 "name": "disconnectFromBackend"
             },
             {
-                "name": "showPanel",
-                "parameters": [
-                    { "name": "panel", "type": "string" }
-                ]
-            },
-            {
-                "name": "startUserInitiatedDebugging"
-            },
-            {
                 "name": "evaluateForTestInFrontend",
                 "parameters": [
                     { "name": "testCallId", "type": "integer" },
         ],
         "events": [
             {
-                "name": "started",
-                "description": "Fired when timeline has been started.",
-                "hidden": true
-            },
-            {
-                "name": "stopped",
-                "description": "Fired when timeline has been stopped.",
-                "hidden": true
-            },
-            {
                 "name": "eventRecorded",
                 "parameters": [
                     { "name": "record", "$ref": "TimelineEvent", "description": "Timeline event record data." }
         ],
         "events": [
             {
-                "name": "debuggerWasEnabled",
-                "description": "Fired when debugger gets enabled (deprecated).",
-                "hidden": true
-            },
-            {
-                "name": "debuggerWasDisabled",
-                "description": "Fired when debugger gets disabled (deprecated).",
-                "hidden": true
-            },
-            {
                 "name": "globalObjectCleared",
                 "description": "Called when global has been cleared and debugger client should reset its state. Happens upon navigation or reload."
             },
index 7e1554c..2e90707 100644 (file)
@@ -108,10 +108,6 @@ void InspectorAgent::setFrontend(InspectorFrontend* inspectorFrontend)
 {
     m_frontend = inspectorFrontend;
 
-    if (!m_showPanelAfterVisible.isEmpty()) {
-        m_frontend->inspector()->showPanel(m_showPanelAfterVisible);
-        m_showPanelAfterVisible = String();
-    }
 #if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(WORKERS)
     WorkersMap::iterator workersEnd = m_workers.end();
     for (WorkersMap::iterator it = m_workers.begin(); it != workersEnd; ++it) {
@@ -221,13 +217,6 @@ void InspectorAgent::didDestroyWorker(intptr_t id)
 }
 #endif // ENABLE(WORKERS)
 
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-void InspectorAgent::showProfilesPanel()
-{
-    showPanel(profilesPanelName);
-}
-#endif
-
 void InspectorAgent::evaluateForTestInFrontend(long callId, const String& script)
 {
     m_pendingEvaluateTestCommands.append(pair<long, String>(callId, script));
@@ -259,20 +248,6 @@ bool InspectorAgent::enabled() const
     return m_inspectedPage->settings()->developerExtrasEnabled();
 }
 
-void InspectorAgent::showConsole()
-{
-    showPanel(consolePanelName);
-}
-
-void InspectorAgent::showPanel(const String& panel)
-{
-    if (!m_frontend) {
-        m_showPanelAfterVisible = panel;
-        return;
-    }
-    m_frontend->inspector()->showPanel(panel);
-}
-
 void InspectorAgent::issueEvaluateForTestCommands()
 {
     if (m_frontend) {
index 073f8f6..49fdf6d 100644 (file)
@@ -63,7 +63,6 @@ public:
 
     KURL inspectedURL() const;
     KURL inspectedURLWithoutFragment() const;
-    void showConsole();
 
     void setFrontend(InspectorFrontend*);
     InspectorFrontend* frontend() const { return m_frontend; }
@@ -85,18 +84,12 @@ public:
 
     bool hasFrontend() const { return m_frontend; }
 
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    void showProfilesPanel();
-#endif
-
     // Generic code called from custom implementations.
     void evaluateForTestInFrontend(long testCallId, const String& script);
 
     void setInspectorExtensionAPI(const String& source);
 
 private:
-    void showPanel(const String& panel);
     void unbindAllResources();
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -112,7 +105,6 @@ private:
     InjectedScriptManager* m_injectedScriptManager;
 
     Vector<pair<long, String> > m_pendingEvaluateTestCommands;
-    String m_showPanelAfterVisible;
     String m_inspectorExtensionAPI;
 #if ENABLE(WORKERS)
     typedef HashMap<intptr_t, RefPtr<InspectorWorkerResource> > WorkersMap;
index 14a2af9..7362ac8 100644 (file)
@@ -121,7 +121,6 @@ InspectorController::InspectorController(Page* page, InspectorClient* inspectorC
     , m_page(page)
     , m_inspectorClient(inspectorClient)
     , m_openingFrontend(false)
-    , m_startUserInitiatedDebuggingWhenFrontedIsConnected(false)
 {
     ASSERT_ARG(inspectorClient, inspectorClient);
     m_injectedScriptManager->injectedScriptHost()->init(m_inspectorAgent.get()
@@ -176,18 +175,6 @@ void InspectorController::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWo
         m_inspectorFrontendClient->windowObjectCleared();
 }
 
-void InspectorController::startTimelineProfiler()
-{
-    ErrorString error;
-    m_timelineAgent->start(&error, 0);
-}
-
-void InspectorController::stopTimelineProfiler()
-{
-    ErrorString error;
-    m_timelineAgent->stop(&error);
-}
-
 void InspectorController::connectFrontend()
 {
     m_openingFrontend = false;
@@ -247,11 +234,6 @@ void InspectorController::connectFrontend()
         , m_workerAgent.get()
 #endif
     ));
-
-    if (m_startUserInitiatedDebuggingWhenFrontedIsConnected) {
-        m_inspectorFrontend->inspector()->startUserInitiatedDebugging();
-        m_startUserInitiatedDebuggingWhenFrontedIsConnected = false;
-    }
 }
 
 void InspectorController::disconnectFrontend()
@@ -359,14 +341,6 @@ void InspectorController::drawHighlight(GraphicsContext& context) const
     m_domAgent->drawHighlight(context);
 }
 
-void InspectorController::showConsole()
-{
-    if (!enabled())
-        return;
-    show();
-    m_inspectorAgent->showConsole();
-}
-
 void InspectorController::inspect(Node* node)
 {
     if (!enabled())
@@ -387,11 +361,6 @@ Page* InspectorController::inspectedPage() const
     return m_page;
 }
 
-bool InspectorController::timelineProfilerEnabled()
-{
-    return m_timelineAgent->started();
-}
-
 void InspectorController::setInspectorExtensionAPI(const String& source)
 {
     m_inspectorAgent->setInspectorExtensionAPI(source);
@@ -432,48 +401,6 @@ bool InspectorController::profilerEnabled()
     return m_profilerAgent->enabled();
 }
 
-bool InspectorController::debuggerEnabled()
-{
-    return m_debuggerAgent->enabled();
-}
-
-void InspectorController::showAndEnableDebugger()
-{
-    if (!enabled())
-        return;
-    show();
-
-    if (m_inspectorFrontend)
-        m_inspectorFrontend->inspector()->startUserInitiatedDebugging();
-    else
-        m_startUserInitiatedDebuggingWhenFrontedIsConnected = true;
-}
-
-void InspectorController::disableDebugger()
-{
-    ErrorString error;
-    m_debuggerAgent->disable(&error);
-}
-
-void InspectorController::startUserInitiatedProfiling()
-{
-    m_profilerAgent->startUserInitiatedProfiling();
-}
-
-void InspectorController::stopUserInitiatedProfiling()
-{
-    if (!enabled())
-        return;
-    show();
-    m_profilerAgent->stopUserInitiatedProfiling();
-    m_inspectorAgent->showProfilesPanel();
-}
-
-bool InspectorController::isRecordingUserInitiatedProfile() const
-{
-    return m_profilerAgent->isRecordingUserInitiatedProfile();
-}
-
 void InspectorController::resume()
 {
     if (m_debuggerAgent) {
index 765cadf..b05793b 100644 (file)
@@ -95,7 +95,6 @@ public:
     void restoreInspectorStateFromCookie(const String& inspectorCookie);
     void setProcessId(long);
 
-    void showConsole();
     void inspect(Node*);
     void drawHighlight(GraphicsContext&) const;
     void hideHighlight();
@@ -103,20 +102,11 @@ public:
 
     void evaluateForTestInFrontend(long callId, const String& script);
 
-    void startTimelineProfiler();
-    void stopTimelineProfiler();
-    bool timelineProfilerEnabled();
-
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     bool profilerEnabled();
     void enableProfiler();
-    void startUserInitiatedProfiling();
-    bool isRecordingUserInitiatedProfile() const;
-    void stopUserInitiatedProfiling();
     void disableProfiler();
-    void showAndEnableDebugger();
-    bool debuggerEnabled();
-    void disableDebugger();
+
     void resume();
 #endif
 
@@ -158,7 +148,6 @@ private:
     Page* m_page;
     InspectorClient* m_inspectorClient;
     bool m_openingFrontend;
-    bool m_startUserInitiatedDebuggingWhenFrontedIsConnected;
 };
 
 }
index f725da8..6f11cb0 100644 (file)
@@ -115,7 +115,6 @@ void InspectorDebuggerAgent::enable(ErrorString*)
     m_inspectorState->setBoolean(DebuggerAgentState::debuggerEnabled, true);
 
     ASSERT(m_frontend);
-    m_frontend->debuggerWasEnabled();
 }
 
 void InspectorDebuggerAgent::disable(ErrorString*)
@@ -125,9 +124,6 @@ void InspectorDebuggerAgent::disable(ErrorString*)
 
     disable();
     m_inspectorState->setBoolean(DebuggerAgentState::debuggerEnabled, false);
-
-    if (m_frontend)
-        m_frontend->debuggerWasDisabled();
 }
 
 void InspectorDebuggerAgent::restore()
index fe8f42c..532537e 100644 (file)
@@ -67,7 +67,6 @@ public:
     void getCapabilities(ErrorString*, RefPtr<InspectorArray>*);
     void enable(ErrorString*);
     void disable(ErrorString*);
-    bool enabled();
     void restore();
     void setFrontend(InspectorFrontend*);
     void clearFrontend();
@@ -123,6 +122,7 @@ protected:
 private:
     void enable();
     void disable();
+    bool enabled();
 
     PassRefPtr<InspectorArray> currentCallFrames();
 
index 4cb8dc7..7132943 100644 (file)
@@ -646,10 +646,8 @@ void InspectorInstrumentation::didCommitLoadImpl(InstrumentingAgents* instrument
         if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent())
             resourceAgent->mainFrameNavigated(loader);
 #if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
-        if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorProfilerAgent()) {
-            profilerAgent->stopUserInitiatedProfiling(true);
+        if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorProfilerAgent())
             profilerAgent->resetState();
-        }
 #endif
         if (InspectorCSSAgent* cssAgent = instrumentingAgents->inspectorCSSAgent())
             cssAgent->reset();
index 503442f..c96aed4 100644 (file)
@@ -242,7 +242,7 @@ void InspectorProfilerAgent::removeProfile(ErrorString*, const String& type, uns
 
 void InspectorProfilerAgent::resetState()
 {
-    stopUserInitiatedProfiling();
+    stop();
     m_profiles.clear();
     m_snapshots.clear();
     m_currentUserInitiatedProfileNumber = 1;
@@ -268,7 +268,7 @@ void InspectorProfilerAgent::setFrontend(InspectorFrontend* frontend)
 void InspectorProfilerAgent::clearFrontend()
 {
     m_frontend = 0;
-    stopUserInitiatedProfiling();
+    stop();
 }
 
 void InspectorProfilerAgent::restore()
@@ -279,7 +279,7 @@ void InspectorProfilerAgent::restore()
     // Revisit this.
     resetFrontendProfiles();
     if (m_inspectorState->getBoolean(ProfilerAgentState::userInitiatedProfiling))
-        startUserInitiatedProfiling();
+        start();
 }
 
 void InspectorProfilerAgent::restoreEnablement()
@@ -290,7 +290,7 @@ void InspectorProfilerAgent::restoreEnablement()
     }
 }
 
-void InspectorProfilerAgent::startUserInitiatedProfiling()
+void InspectorProfilerAgent::start(ErrorString*)
 {
     if (m_recordingUserInitiatedProfile)
         return;
@@ -311,7 +311,7 @@ void InspectorProfilerAgent::startUserInitiatedProfiling()
     m_inspectorState->setBoolean(ProfilerAgentState::userInitiatedProfiling, true);
 }
 
-void InspectorProfilerAgent::stopUserInitiatedProfiling(bool ignoreProfile)
+void InspectorProfilerAgent::stop(ErrorString*)
 {
     if (!m_recordingUserInitiatedProfile)
         return;
@@ -325,12 +325,8 @@ void InspectorProfilerAgent::stopUserInitiatedProfiling(bool ignoreProfile)
     ScriptState* scriptState = 0;
 #endif
     RefPtr<ScriptProfile> profile = ScriptProfiler::stop(scriptState, title);
-    if (profile) {
-        if (!ignoreProfile)
-            addProfile(profile, 0, String());
-        else
-            addProfileFinishedMessageToConsole(profile, 0, String());
-    }
+    if (profile)
+        addProfile(profile, 0, String());
     toggleRecordButton(false);
     m_inspectorState->setBoolean(ProfilerAgentState::userInitiatedProfiling, false);
 }
index eed7e21..4869371 100644 (file)
@@ -70,8 +70,8 @@ public:
     void enable(ErrorString*);
     void disable(ErrorString*);
     void isEnabled(ErrorString*, bool* result) { *result = enabled(); }
-    void start(ErrorString*) { startUserInitiatedProfiling(); }
-    void stop(ErrorString*) { stopUserInitiatedProfiling(); }
+    void start(ErrorString* = 0);
+    void stop(ErrorString* = 0);
 
     void disable();
     void enable(bool skipRecompile);
@@ -79,15 +79,12 @@ public:
     String getCurrentUserInitiatedProfileName(bool incrementProfileNumber = false);
     void getProfileHeaders(ErrorString* error, RefPtr<InspectorArray>* headers);
     void getProfile(ErrorString* error, const String& type, unsigned uid, RefPtr<InspectorObject>* profileObject);
-    bool isRecordingUserInitiatedProfile() { return m_recordingUserInitiatedProfile; }
     void removeProfile(ErrorString* error, const String& type, unsigned uid);
 
     void setFrontend(InspectorFrontend*);
     void clearFrontend();
     void restore();
 
-    void startUserInitiatedProfiling();
-    void stopUserInitiatedProfiling(bool ignoreProfile = false);
     void takeHeapSnapshot(ErrorString*);
     void toggleRecordButton(bool isProfiling);
 
index dd2936a..05fc66d 100644 (file)
@@ -147,17 +147,14 @@ void InspectorTimelineAgent::start(ErrorString*, int* maxCallStackDepth)
 
     m_instrumentingAgents->setInspectorTimelineAgent(this);
     ScriptGCEvent::addEventListener(this);
-    m_frontend->started();
     m_state->setBoolean(TimelineAgentState::timelineAgentEnabled, true);
 }
 
 void InspectorTimelineAgent::stop(ErrorString*)
 {
-    if (!started())
+    if (!m_state->getBoolean(TimelineAgentState::timelineAgentEnabled))
         return;
     m_instrumentingAgents->setInspectorTimelineAgent(0);
-    if (m_frontend)
-        m_frontend->stopped();
     ScriptGCEvent::removeEventListener(this);
 
     clearRecordStack();
@@ -166,11 +163,6 @@ void InspectorTimelineAgent::stop(ErrorString*)
     m_state->setBoolean(TimelineAgentState::timelineAgentEnabled, false);
 }
 
-bool InspectorTimelineAgent::started() const
-{
-    return m_state->getBoolean(TimelineAgentState::timelineAgentEnabled);
-}
-
 void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine)
 {
     pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall);
index ecb177f..f74580e 100644 (file)
@@ -68,7 +68,6 @@ public:
 
     void start(ErrorString*, int* maxCallStackDepth);
     void stop(ErrorString*);
-    bool started() const;
 
     int id() const { return m_id; }
 
index f6cf51e..517272b 100644 (file)
@@ -97,12 +97,12 @@ WebInspector.DebuggerModel.prototype = {
                 this._capabilitiesObject[capabilities[i]] = true;
         }
         DebuggerAgent.getCapabilities(callback.bind(this));
-        DebuggerAgent.enable();
+        DebuggerAgent.enable(this._debuggerWasEnabled.bind(this));
     },
 
     disableDebugger: function()
     {
-        DebuggerAgent.disable();
+        DebuggerAgent.disable(this._debuggerWasDisabled.bind(this));
     },
 
     /**
@@ -385,16 +385,6 @@ WebInspector.DebuggerDispatcher.prototype = {
         this._debuggerModel._resumedScript();
     },
 
-    debuggerWasEnabled: function()
-    {
-        this._debuggerModel._debuggerWasEnabled();
-    },
-
-    debuggerWasDisabled: function()
-    {
-        this._debuggerModel._debuggerWasDisabled();
-    },
-
     globalObjectCleared: function()
     {
         this._debuggerModel._globalObjectCleared();
index 1d29ee8..052bdfe 100644 (file)
@@ -50,7 +50,7 @@ WebInspector.TimelineManager.prototype = {
     {
         this._enablementCount++;
         if (this._enablementCount === 1)
-            TimelineAgent.start(maxCallStackDepth);
+            TimelineAgent.start(maxCallStackDepth, this._started.bind(this));
     },
 
     stop: function()
@@ -61,7 +61,17 @@ WebInspector.TimelineManager.prototype = {
         }
         this._enablementCount--;
         if (!this._enablementCount)
-            TimelineAgent.stop();
+            TimelineAgent.stop(this._stopped.bind(this));
+    },
+
+    _started: function()
+    {
+        this.dispatchEventToListeners(WebInspector.TimelineManager.EventTypes.TimelineStarted);
+    },
+
+    _stopped: function()
+    {
+        this.dispatchEventToListeners(WebInspector.TimelineManager.EventTypes.TimelineStopped);
     }
 }
 
@@ -78,16 +88,6 @@ WebInspector.TimelineDispatcher = function(manager)
 }
 
 WebInspector.TimelineDispatcher.prototype = {
-    started: function()
-    {
-        this._manager.dispatchEventToListeners(WebInspector.TimelineManager.EventTypes.TimelineStarted);
-    },
-
-    stopped: function()
-    {
-        this._manager.dispatchEventToListeners(WebInspector.TimelineManager.EventTypes.TimelineStopped);
-    },
-
     eventRecorded: function(record)
     {
         this._manager.dispatchEventToListeners(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, record);
index 578c798..3242c1a 100644 (file)
@@ -665,12 +665,6 @@ WebInspector.showPanel = function(panel)
     WebInspector.inspectorView.setCurrentPanel(this.panels[panel]);
 }
 
-WebInspector.startUserInitiatedDebugging = function()
-{
-    WebInspector.inspectorView.setCurrentPanel(this.panels.scripts);
-    WebInspector.debuggerModel.enableDebugger();
-}
-
 WebInspector.bringToFront = function()
 {
     InspectorFrontendHost.bringToFront();
index beb4693..a204aa3 100644 (file)
@@ -1,3 +1,14 @@
+2011-11-22  Pavel Feldman  <pfeldman@google.com>
+
+        Web Inspector: strip unused InspectorController methods.
+        https://bugs.webkit.org/show_bug.cgi?id=72886
+
+        Reviewed by Yury Semikhatsky.
+
+        * webkit/webkitwebinspector.cpp:
+        (webkit_web_inspector_set_property):
+        (webkit_web_inspector_get_property):
+
 2011-11-21  Yuta Kitamura  <yutak@chromium.org>
 
         [GTK] Enable WebSocket hybi tests
index 43caf1a..c93c2bd 100644 (file)
@@ -90,7 +90,7 @@ enum {
     PROP_WEB_VIEW,
     PROP_INSPECTED_URI,
     PROP_JAVASCRIPT_PROFILING_ENABLED,
-    PROP_TIMELINE_PROFILING_ENABLED    
+    PROP_TIMELINE_PROFILING_ENABLED
 };
 
 G_DEFINE_TYPE(WebKitWebInspector, webkit_web_inspector, G_TYPE_OBJECT)
@@ -364,12 +364,7 @@ static void webkit_web_inspector_set_property(GObject* object, guint prop_id, co
         break;
     }
     case PROP_TIMELINE_PROFILING_ENABLED: {
-        bool enabled = g_value_get_boolean(value);
-        WebCore::InspectorController* controller = priv->page->inspectorController();
-        if (enabled)
-            controller->startTimelineProfiler();
-        else
-            controller->stopTimelineProfiler();
+        g_message("PROP_TIMELINE_PROFILING_ENABLED has been deprecated\n");
         break;
     }
     default:
@@ -398,7 +393,7 @@ static void webkit_web_inspector_get_property(GObject* object, guint prop_id, GV
 #endif
         break;
     case PROP_TIMELINE_PROFILING_ENABLED:
-        g_value_set_boolean(value, priv->page->inspectorController()->timelineProfilerEnabled());
+        g_message("PROP_TIMELINE_PROFILING_ENABLED has been deprecated\n");
         break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);