2010-12-13 Ilya Tikhonovsky <loislo@chromium.org>
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 15:35:42 +0000 (15:35 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 15:35:42 +0000 (15:35 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: Protocol cleanup task. Assign domain attribute to Resources and Debugger specific functions.

        Debugger and Resources related notification functions of Inspector.idl were
        marked as such with help of "domain" attribute. The other changes in js files
        are reflecting this change. Some wrappers in WebInspector namespace were dropped,
        the others were moved to DebuggerModel class.

        https://bugs.webkit.org/show_bug.cgi?id=50906

        * inspector/Inspector.idl:
        * inspector/InspectorDebuggerAgent.cpp:
        (WebCore::InspectorDebuggerAgent::didParseSource):
        * inspector/InspectorProfilerAgent.cpp:
        (WebCore::InspectorProfilerAgent::resetState):
        * inspector/front-end/DOMAgent.js:
        (WebInspector.DOMAgent.prototype.didCommitLoad):
        * inspector/front-end/Database.js:
        * inspector/front-end/DebuggerModel.js:
        (WebInspector.DebuggerModel):
        (WebInspector.DebuggerModel.prototype.pausedScript):
        (WebInspector.DebuggerModel.prototype.resumedScript):
        (WebInspector.DebuggerModel.prototype.attachDebuggerWhenShown):
        (WebInspector.DebuggerModel.prototype.debuggerWasEnabled):
        (WebInspector.DebuggerModel.prototype.debuggerWasDisabled):
        (WebInspector.DebuggerModel.prototype.parsedScriptSource):
        (WebInspector.DebuggerModel.prototype.failedToParseScriptSource):
        (WebInspector.DebuggerModel.prototype.didCreateWorker):
        (WebInspector.DebuggerModel.prototype.didDestroyWorker):
        * inspector/front-end/ProfilesPanel.js:
        (WebInspector.ProfilesPanel):
        (WebInspector.ProfilesPanel.prototype.updateMainViewWidth):
        (WebInspector.ProfilesPanel.prototype.setRecordingProfile):
        * inspector/front-end/ResourceManager.js:
        (WebInspector.ResourceManager):
        (WebInspector.ResourceManager.prototype._unbindResourceURL):
        (WebInspector.ResourceManager.prototype.updateDOMStorage):
        (WebInspector.ResourceManager.prototype.updateApplicationCacheStatus):
        (WebInspector.ResourceManager.prototype.didGetFileSystemPath):
        (WebInspector.ResourceManager.prototype.didGetFileSystemError):
        (WebInspector.ResourceManager.prototype.didGetFileSystemDisabled):
        (WebInspector.ResourceManager.prototype.updateNetworkState):
        (WebInspector.ResourceManager.prototype.addDOMStorage):
        (WebInspector.ResourceManager.prototype.selectDOMStorage):
        (WebInspector.ResourceManager.prototype.addDatabase):
        (WebInspector.ResourceManager.prototype.selectDatabase):
        (WebInspector.ResourceManager.prototype.sqlTransactionSucceeded):
        (WebInspector.ResourceManager.prototype.sqlTransactionFailed):
        * inspector/front-end/WorkersSidebarPane.js:
        (WebInspector.Worker):
        * inspector/front-end/inspector.js:

2010-12-13  Ilya Tikhonovsky  <loislo@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: Protocol cleanup task. Assign domain attribute to Resources and Debugger specific functions.

        Debugger and Resources related notification functions of Inspector.idl were
        marked as such with help of "domain" attribute. The other changes in js files
        are reflecting this change. Some wrappers in WebInspector namespace were dropped,
        the others were moved to DebuggerModel class.

        https://bugs.webkit.org/show_bug.cgi?id=50906

        * src/js/Tests.js:
        (.TestSuite.prototype._waitForScriptPause):
        (.TestSuite.prototype._waitUntilScriptsAreParsed.waitForAllScripts):
        (.TestSuite.prototype._waitUntilScriptsAreParsed):

2010-12-13  Ilya Tikhonovsky  <loislo@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: Protocol cleanup task. Assign domain attribute to Resources and Debugger specific functions.

        Debugger and Resources related notification functions of Inspector.idl were
        marked as such with help of "domain" attribute. The other changes in js files
        are reflecting this change. Some wrappers in WebInspector namespace were dropped,
        the others were moved to DebuggerModel class.

        https://bugs.webkit.org/show_bug.cgi?id=50906

        * http/tests/inspector/debugger-test2.js:
        (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
        (initialize_DebuggerTest.InspectorTest.startDebuggerTest):
        (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.disableDebugger):
        (initialize_DebuggerTest.InspectorTest.showScriptSource):

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

15 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/debugger-test2.js
WebCore/ChangeLog
WebCore/inspector/Inspector.idl
WebCore/inspector/InspectorDebuggerAgent.cpp
WebCore/inspector/InspectorProfilerAgent.cpp
WebCore/inspector/front-end/DOMAgent.js
WebCore/inspector/front-end/Database.js
WebCore/inspector/front-end/DebuggerModel.js
WebCore/inspector/front-end/ProfilesPanel.js
WebCore/inspector/front-end/ResourceManager.js
WebCore/inspector/front-end/WorkersSidebarPane.js
WebCore/inspector/front-end/inspector.js
WebKit/chromium/ChangeLog
WebKit/chromium/src/js/Tests.js

index 551a284..311472c 100644 (file)
@@ -1,3 +1,22 @@
+2010-12-13  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: Protocol cleanup task. Assign domain attribute to Resources and Debugger specific functions.
+
+        Debugger and Resources related notification functions of Inspector.idl were
+        marked as such with help of "domain" attribute. The other changes in js files
+        are reflecting this change. Some wrappers in WebInspector namespace were dropped,
+        the others were moved to DebuggerModel class.
+
+        https://bugs.webkit.org/show_bug.cgi?id=50906
+
+        * http/tests/inspector/debugger-test2.js:
+        (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
+        (initialize_DebuggerTest.InspectorTest.startDebuggerTest):
+        (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.disableDebugger):
+        (initialize_DebuggerTest.InspectorTest.showScriptSource):
+
 2010-12-13  Yury Semikhatsky  <yurys@chromium.org>
 
         Reviewed by Adam Barth.
index 6c19ff9..9931d41 100644 (file)
@@ -7,15 +7,15 @@ InspectorTest.startDebuggerTest = function(callback)
     if (WebInspector.panels.scripts._debuggerEnabled)
         startTest();
     else {
-        InspectorTest._addSniffer(WebInspector, "debuggerWasEnabled", startTest);
+        InspectorTest._addSniffer(WebInspector.debuggerModel, "debuggerWasEnabled", startTest);
         WebInspector.panels.scripts._toggleDebugging(false);
     }
 
     function startTest()
     {
         InspectorTest.addResult("Debugger was enabled.");
-        InspectorTest._addSniffer(WebInspector, "pausedScript", InspectorTest._pausedScript, true);
-        InspectorTest._addSniffer(WebInspector, "resumedScript", InspectorTest._resumedScript, true);
+        InspectorTest._addSniffer(WebInspector.debuggerModel, "pausedScript", InspectorTest._pausedScript, true);
+        InspectorTest._addSniffer(WebInspector.debuggerModel, "resumedScript", InspectorTest._resumedScript, true);
         callback();
     }
 };
@@ -34,7 +34,7 @@ InspectorTest.completeDebuggerTest = function()
         if (!scriptsPanel._debuggerEnabled)
             completeTest();
         else {
-            InspectorTest._addSniffer(WebInspector, "debuggerWasDisabled", completeTest);
+            InspectorTest._addSniffer(WebInspector.debuggerModel, "debuggerWasDisabled", completeTest);
             scriptsPanel._toggleDebugging(false);
         }
     }
@@ -116,7 +116,7 @@ InspectorTest.showScriptSource = function(scriptName, callback)
     if (InspectorTest._scriptsAreParsed([scriptName]))
         InspectorTest._showScriptSource(scriptName, callback);
     else
-        InspectorTest._addSniffer(WebInspector, "parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
+        InspectorTest._addSniffer(WebInspector.debuggerModel, "parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
 };
 
 InspectorTest.waitUntilCurrentSourceFrameIsLoaded = function(callback)
index 9c6dda5..d9c5b08 100644 (file)
@@ -1,3 +1,58 @@
+2010-12-13  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: Protocol cleanup task. Assign domain attribute to Resources and Debugger specific functions.
+
+        Debugger and Resources related notification functions of Inspector.idl were
+        marked as such with help of "domain" attribute. The other changes in js files
+        are reflecting this change. Some wrappers in WebInspector namespace were dropped,
+        the others were moved to DebuggerModel class.
+
+        https://bugs.webkit.org/show_bug.cgi?id=50906
+
+        * inspector/Inspector.idl:
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::didParseSource):
+        * inspector/InspectorProfilerAgent.cpp:
+        (WebCore::InspectorProfilerAgent::resetState):
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.DOMAgent.prototype.didCommitLoad):
+        * inspector/front-end/Database.js:
+        * inspector/front-end/DebuggerModel.js:
+        (WebInspector.DebuggerModel):
+        (WebInspector.DebuggerModel.prototype.pausedScript):
+        (WebInspector.DebuggerModel.prototype.resumedScript):
+        (WebInspector.DebuggerModel.prototype.attachDebuggerWhenShown):
+        (WebInspector.DebuggerModel.prototype.debuggerWasEnabled):
+        (WebInspector.DebuggerModel.prototype.debuggerWasDisabled):
+        (WebInspector.DebuggerModel.prototype.parsedScriptSource):
+        (WebInspector.DebuggerModel.prototype.failedToParseScriptSource):
+        (WebInspector.DebuggerModel.prototype.didCreateWorker):
+        (WebInspector.DebuggerModel.prototype.didDestroyWorker):
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel):
+        (WebInspector.ProfilesPanel.prototype.updateMainViewWidth):
+        (WebInspector.ProfilesPanel.prototype.setRecordingProfile):
+        * inspector/front-end/ResourceManager.js:
+        (WebInspector.ResourceManager):
+        (WebInspector.ResourceManager.prototype._unbindResourceURL):
+        (WebInspector.ResourceManager.prototype.updateDOMStorage):
+        (WebInspector.ResourceManager.prototype.updateApplicationCacheStatus):
+        (WebInspector.ResourceManager.prototype.didGetFileSystemPath):
+        (WebInspector.ResourceManager.prototype.didGetFileSystemError):
+        (WebInspector.ResourceManager.prototype.didGetFileSystemDisabled):
+        (WebInspector.ResourceManager.prototype.updateNetworkState):
+        (WebInspector.ResourceManager.prototype.addDOMStorage):
+        (WebInspector.ResourceManager.prototype.selectDOMStorage):
+        (WebInspector.ResourceManager.prototype.addDatabase):
+        (WebInspector.ResourceManager.prototype.selectDatabase):
+        (WebInspector.ResourceManager.prototype.sqlTransactionSucceeded):
+        (WebInspector.ResourceManager.prototype.sqlTransactionFailed):
+        * inspector/front-end/WorkersSidebarPane.js:
+        (WebInspector.Worker):
+        * inspector/front-end/inspector.js:
+
 2010-12-13  Yury Semikhatsky  <yurys@chromium.org>
 
         Unreviewed. Qt build fix. 
index c214f74..c21377a 100644 (file)
 module core {
     interface [Conditional=INSPECTOR] Inspector {
         [notify, domain=Timeline] void addRecordToTimeline(out Object record);
-        [notify] void addNodesToSearchResult(out Array nodeIds);
+        [notify, domain=Inspector] void addNodesToSearchResult(out Array nodeIds);
         [notify, domain=DOM] void attributesUpdated(out long id, out Array attributes);
-        [notify] void bringToFront();
+        [notify, domain=Inspector] void bringToFront();
         [notify, domain=DOM] void characterDataModified(out long id, out String newValue);
         [notify, domain=DOM] void childNodeCountUpdated(out long id, out int newValue);
         [notify, domain=DOM] void childNodeInserted(out long parentId, out long prevId, out Object node);
         [notify, domain=DOM] void childNodeRemoved(out long parentId, out long id);
-        [notify] void didCommitLoad();
-        [notify] void evaluateForTestInFrontend(out long testCallId, out String script);
-        [notify] void disconnectFromBackend();
-        [notify] void domContentEventFired(out double time);
-        [notify] void inspectedURLChanged(out String url);
-        [notify] void loadEventFired(out double time);
-        [notify] void reset();
-        [notify] void resetProfilesPanel();
+        [notify, domain=DOM] void didCommitLoad();
+        [notify, domain=Inspector] void evaluateForTestInFrontend(out long testCallId, out String script);
+        [notify, domain=Inspector] void disconnectFromBackend();
+        [notify, domain=Inspector] void domContentEventFired(out double time);
+        [notify, domain=Inspector] void inspectedURLChanged(out String url);
+        [notify, domain=Inspector] void loadEventFired(out double time);
+        [notify, domain=Inspector] void reset();
+        [notify, domain=Profiler] void resetProfiles();
         [notify, domain=DOM] void setChildNodes(out long parentId, out Array nodes);
         [notify, domain=DOM] void setDetachedRoot(out Object root);
         [notify, domain=DOM] void setDocument(out Value root);
-        [notify] void showPanel(out String panel);
+        [notify, domain=Inspector] void showPanel(out String panel);
         [notify, domain=Timeline] void timelineProfilerWasStarted();
         [notify, domain=Timeline] void timelineProfilerWasStopped();
-        [notify] void updateFocusedNode(out long nodeId);
+        [notify, domain=Inspector] void updateFocusedNode(out long nodeId);
 
 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
-        [notify] void addProfileHeader(out Object header);
-        [notify] void addHeapSnapshotChunk(out unsigned long uid, out String chunk);
-        [notify] void attachDebuggerWhenShown();
-        [notify] void debuggerWasEnabled();
-        [notify] void debuggerWasDisabled();
-        [notify] void failedToParseScriptSource(out String url, out String data, out int firstLine, out int errorLine, out String errorMessage);
-        [notify] void finishHeapSnapshot(out unsigned long uid);
-        [notify] void parsedScriptSource(out String sourceID, out String url, out String data, out int firstLine, out int scriptWorldType);
-        [notify] void pausedScript(out Object details);
-        [notify] void profilerWasEnabled();
-        [notify] void profilerWasDisabled();
-        [notify] void restoredBreakpoint(out String sourceID, out String url, out int line, out boolean enabled, out String condition);
-        [notify] void resumedScript();
-        [notify] void setRecordingProfile(out boolean isProfiling);
-        [notify] void updatePauseOnExceptionsState(out long state);
+        [notify, domain=Profiler] void addProfileHeader(out Object header);
+        [notify, domain=Profiler] void addHeapSnapshotChunk(out unsigned long uid, out String chunk);
+        [notify, domain=Debugger] void attachDebuggerWhenShown();
+        [notify, domain=Debugger] void debuggerWasEnabled();
+        [notify, domain=Debugger] void debuggerWasDisabled();
+        [notify, domain=Debugger] void failedToParseScriptSource(out String url, out String data, out int firstLine, out int errorLine, out String errorMessage);
+        [notify, domain=Profiler] void finishHeapSnapshot(out unsigned long uid);
+        [notify, domain=Debugger] void parsedScriptSource(out String sourceID, out String url, out String data, out int firstLine, out int scriptWorldType);
+        [notify, domain=Debugger] void pausedScript(out Object details);
+        [notify, domain=Profiler] void profilerWasEnabled();
+        [notify, domain=Profiler] void profilerWasDisabled();
+        [notify, domain=Debugger] void breakpointRestored(out String sourceID, out String url, out int line, out boolean enabled, out String condition);
+        [notify, domain=Debugger] void resumedScript();
+        [notify, domain=Profiler] void setRecordingProfile(out boolean isProfiling);
 #endif
 #if defined(ENABLE_DATABASE) && ENABLE_DATABASE
-        [notify] void addDatabase(out Object database);
-        [notify] void selectDatabase(out int databaseId);
+        [notify, domain=Resources] void addDatabase(out Object database);
+        [notify, domain=Resources] void selectDatabase(out int databaseId);
 #endif
 #if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
-        [notify] void addDOMStorage(out Object storage);
-        [notify] void updateDOMStorage(out int storageId);
-        [notify] void selectDOMStorage(out int storageId);
+        [notify, domain=Resources] void addDOMStorage(out Object storage);
+        [notify, domain=Resources] void updateDOMStorage(out int storageId);
+        [notify, domain=Resources] void selectDOMStorage(out int storageId);
 #endif
 #if defined(ENABLE_OFFLINE_WEB_APPLICATIONS) && ENABLE_OFFLINE_WEB_APPLICATIONS
-        [notify] void updateApplicationCacheStatus(out int status);
-        [notify] void updateNetworkState(out boolean isNowOnline);
+        [notify, domain=Resources] void updateApplicationCacheStatus(out int status);
+        [notify, domain=Resources] void updateNetworkState(out boolean isNowOnline);
 #endif
 #if defined(ENABLE_WORKERS) && ENABLE_WORKERS
-        [notify] void didCreateWorker(out long id, out String url, out boolean isShared);
-        [notify] void didDestroyWorker(out long id);
+        [notify, domain=Debugger] void didCreateWorker(out long id, out String url, out boolean isShared);
+        [notify, domain=Debugger] void didDestroyWorker(out long id);
 #endif
 
         // This method is going to be broken down into smaller parts.
@@ -107,22 +106,22 @@ module core {
 
         [domain=Resources] void cachedResources(out Object resources);
         [domain=Resources] void resourceContent(in unsigned long frameId, in String url, in boolean base64Encode, out String content);
-        [notify] void identifierForInitialRequest(out long identifier, out String url, out Object loader, out Value callStack);
-        [notify] void willSendRequest(out long identifier, out double time, out Object request, out Object redirectResponse);
-        [notify] void markResourceAsCached(out long identifier);
-        [notify] void didReceiveResponse(out long identifier, out double time, out String resourceType, out Object response);
-        [notify] void didReceiveContentLength(out long identifier, out double time, out long lengthReceived);
-        [notify] void didFinishLoading(out long identifier, out double finishTime);
-        [notify] void didFailLoading(out long identifier, out double time, out String localizedDescription);
-        [notify] void didLoadResourceFromMemoryCache(out double time, out Object resource);
-        [notify] void setInitialContent(out long identifier, out String sourceString, out String type);
-        [notify] void didCommitLoadForFrame(out Object frame, out Object loader);
-        [notify] void frameDetachedFromParent(out unsigned long frameId);
-
-        [notify] void didCreateWebSocket(out unsigned long identifier, out String requestURL);
-        [notify] void willSendWebSocketHandshakeRequest(out unsigned long identifier, out double time, out Object request);
-        [notify] void didReceiveWebSocketHandshakeResponse(out unsigned long identifier, out double time, out Object response);
-        [notify] void didCloseWebSocket(out unsigned long identifier, out double time);
+        [notify, domain=Resources] void identifierForInitialRequest(out long identifier, out String url, out Object loader, out Value callStack);
+        [notify, domain=Resources] void willSendRequest(out long identifier, out double time, out Object request, out Object redirectResponse);
+        [notify, domain=Resources] void markResourceAsCached(out long identifier);
+        [notify, domain=Resources] void didReceiveResponse(out long identifier, out double time, out String resourceType, out Object response);
+        [notify, domain=Resources] void didReceiveContentLength(out long identifier, out double time, out long lengthReceived);
+        [notify, domain=Resources] void didFinishLoading(out long identifier, out double finishTime);
+        [notify, domain=Resources] void didFailLoading(out long identifier, out double time, out String localizedDescription);
+        [notify, domain=Resources] void didLoadResourceFromMemoryCache(out double time, out Object resource);
+        [notify, domain=Resources] void setInitialContent(out long identifier, out String sourceString, out String type);
+        [notify, domain=Resources] void didCommitLoadForFrame(out Object frame, out Object loader);
+        [notify, domain=Resources] void frameDetachedFromParent(out unsigned long frameId);
+
+        [notify, domain=Resources] void didCreateWebSocket(out unsigned long identifier, out String requestURL);
+        [notify, domain=Resources] void willSendWebSocketHandshakeRequest(out unsigned long identifier, out double time, out Object request);
+        [notify, domain=Resources] void didReceiveWebSocketHandshakeResponse(out unsigned long identifier, out double time, out Object response);
+        [notify, domain=Resources] void didCloseWebSocket(out unsigned long identifier, out double time);
 
 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
         [domain=Backend] void enableDebugger(in boolean always);
@@ -187,12 +186,12 @@ module core {
         [domain=DOM] void pushNodeByPathToFrontend(in String path, out long nodeId);
 
         [domain=Inspector] void setConsoleMessagesEnabled(in boolean enabled, out boolean newState);
-        [notify] void addConsoleMessage(out Object messageObj);
-        [notify] void updateConsoleMessageExpiredCount(out unsigned long count);
-        [notify] void updateConsoleMessageRepeatCount(out unsigned long count);
+        [notify, domain=Inspector] void addConsoleMessage(out Object messageObj);
+        [notify, domain=Inspector] void updateConsoleMessageExpiredCount(out unsigned long count);
+        [notify, domain=Inspector] void updateConsoleMessageRepeatCount(out unsigned long count);
 
         [domain=Inspector] void clearConsoleMessages();
-        [notify] void consoleMessagesCleared();
+        [notify, domain=Inspector] void consoleMessagesCleared();
 
         [domain=Inspector] void highlightDOMNode(in long nodeId);
         [domain=Inspector] void hideDOMNodeHighlight();
@@ -225,9 +224,9 @@ module core {
 #if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM
         [domain=FileSystem] void getFileSystemPathAsync(in unsigned int type, in String origin);
         [domain=FileSystem] void revealFolderInOS(in String path);
-        [notify] void didGetFileSystemPath(out String root, out int type, out String origin);
-        [notify] void didGetFileSystemError(out int type, out String origin);
-        [notify] void didGetFileSystemDisabled();
+        [notify, domain=Resources] void didGetFileSystemPath(out String root, out int type, out String origin);
+        [notify, domain=Resources] void didGetFileSystemError(out int type, out String origin);
+        [notify, domain=Resources] void didGetFileSystemDisabled();
 #endif
 
         [domain=Backend] void releaseWrapperObjectGroup(in long injectedScriptId, in String objectGroup);
@@ -236,8 +235,8 @@ module core {
 #if defined(ENABLE_DATABASE) && ENABLE_DATABASE
         [domain=Backend] void getDatabaseTableNames(in long databaseId, out Array tableNames);
         [domain=Backend] void executeSQL(in long databaseId, in String query, out boolean success, out long transactionId);
-        [notify] void sqlTransactionSucceeded(out long transactionId, out Value columnNames, out Value values);
-        [notify] void sqlTransactionFailed(out long transactionId, out Value sqlError);
+        [notify, domain=Resources] void sqlTransactionSucceeded(out long transactionId, out Value columnNames, out Value values);
+        [notify, domain=Resources] void sqlTransactionFailed(out long transactionId, out Value sqlError);
 #endif
 
 #if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
index b3caa2e..0b18b0c 100644 (file)
@@ -292,7 +292,7 @@ void InspectorDebuggerAgent::didParseSource(const String& sourceID, const String
             bool success = ScriptDebugServer::shared().setBreakpoint(sourceID, breakpointIt->second, lineNumber, &actualLineNumber);
             if (!success)
                 continue;
-            m_frontend->restoredBreakpoint(sourceID, url, actualLineNumber, breakpointIt->second.enabled, breakpointIt->second.condition);
+            m_frontend->breakpointRestored(sourceID, url, actualLineNumber, breakpointIt->second.enabled, breakpointIt->second.condition);
             String breakpointId = formatBreakpointId(sourceID, actualLineNumber);
             m_breakpointsMapping.set(breakpointId, lineNumber);
         }
index 6d5364f..ac67a1a 100644 (file)
@@ -211,7 +211,7 @@ void InspectorProfilerAgent::resetState()
     m_nextUserInitiatedProfileNumber = 1;
     m_nextUserInitiatedHeapSnapshotNumber = 1;
     if (m_frontend)
-        m_frontend->resetProfilesPanel();
+        m_frontend->resetProfiles();
 }
 
 void InspectorProfilerAgent::startUserInitiatedProfiling()
index 9ce08f9..432ac3f 100644 (file)
@@ -373,6 +373,12 @@ WebInspector.DOMAgent.prototype = {
         return this._idToDOMNode[nodeId];
     },
 
+    didCommitLoad: function()
+    {
+        // Cleanup elements panel early on inspected page refresh.
+        this.setDocument(null);
+    },
+
     setDocument: function(payload)
     {
         this._idToDOMNode = {};
index ca3e968..7aac7d1 100644 (file)
@@ -101,21 +101,3 @@ WebInspector.Database.prototype = {
         InspectorBackend.executeSQL(this._id, query, callback);
     }
 }
-
-WebInspector.sqlTransactionSucceeded = function(transactionId, columnNames, values)
-{
-    var callback = WebInspector.Database.successCallbacks[transactionId];
-    if (!callback)
-        return;
-    delete WebInspector.Database.successCallbacks[transactionId];
-    callback(columnNames, values);
-}
-
-WebInspector.sqlTransactionFailed = function(transactionId, errorObj)
-{
-    var callback = WebInspector.Database.errorCallbacks[transactionId];
-    if (!callback)
-        return;
-    delete WebInspector.Database.errorCallbacks[transactionId];
-    callback(errorObj);
-}
index a337f5c..ca74301 100644 (file)
@@ -31,6 +31,7 @@
 WebInspector.DebuggerModel = function()
 {
     this._breakpoints = {};
+    InspectorBackend.registerDomainDispatcher("Debugger", this);
 }
 
 WebInspector.DebuggerModel.prototype = {
@@ -127,7 +128,7 @@ WebInspector.DebuggerModel.prototype = {
         InspectorBackend.setBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.enabled, breakpoint.condition, didSetBreakpoint.bind(this));
     },
 
-    debuggerPaused: function(details)
+    pausedScript: function(details)
     {
         this.dispatchEventToListeners("debugger-paused", details.callFrames);
 
@@ -147,7 +148,7 @@ WebInspector.DebuggerModel.prototype = {
         this.dispatchEventToListeners("script-breakpoint-hit", breakpoint);
     },
 
-    debuggerResumed: function()
+    resumedScript: function()
     {
         this.dispatchEventToListeners("debugger-resumed");
 
@@ -155,6 +156,43 @@ WebInspector.DebuggerModel.prototype = {
             return;
         this._lastHitBreakpoint.hit = false;
         delete this._lastHitBreakpoint;
+    },
+
+    attachDebuggerWhenShown: function()
+    {
+        WebInspector.panels.scripts.attachDebuggerWhenShown();
+    },
+
+    debuggerWasEnabled: function()
+    {
+        WebInspector.panels.scripts.debuggerWasEnabled();
+    },
+
+    debuggerWasDisabled: function()
+    {
+        WebInspector.panels.scripts.debuggerWasDisabled();
+    },
+
+    parsedScriptSource: function(sourceID, sourceURL, source, startingLine, scriptWorldType)
+    {
+        WebInspector.panels.scripts.addScript(sourceID, sourceURL, source, startingLine, undefined, undefined, scriptWorldType);
+    },
+
+    failedToParseScriptSource: function(sourceURL, source, startingLine, errorLine, errorMessage)
+    {
+        WebInspector.panels.scripts.addScript(null, sourceURL, source, startingLine, errorLine, errorMessage);
+    },
+
+    didCreateWorker: function()
+    {
+        var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;
+        workersPane.addWorker.apply(workersPane, arguments);
+    },
+
+    didDestroyWorker: function()
+    {
+        var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;
+        workersPane.removeWorker.apply(workersPane, arguments);
     }
 }
 
index 86d8d90..3e31ba5 100644 (file)
@@ -124,6 +124,7 @@ WebInspector.ProfilesPanel = function()
     this._profiles = [];
     this._profilerEnabled = Preferences.profilerAlwaysEnabled;
     this._reset();
+    InspectorBackend.registerDomainDispatcher("Profiler", this);
 }
 
 WebInspector.ProfilesPanel.prototype = {
@@ -597,7 +598,7 @@ WebInspector.ProfilesPanel.prototype = {
             var profileHeadersLength = profileHeaders.length;
             for (var i = 0; i < profileHeadersLength; ++i)
                 if (!this.hasProfile(profileHeaders[i]))
-                    WebInspector.addProfileHeader(profileHeaders[i]);
+                    WebInspector.panels.profiles.addProfileHeader(profileHeaders[i]);
         }
 
         InspectorBackend.getProfileHeaders(populateCallback.bind(this));
@@ -611,6 +612,26 @@ WebInspector.ProfilesPanel.prototype = {
         this.profileViews.style.left = width + "px";
         this.profileViewStatusBarItemsContainer.style.left = Math.max(155, width) + "px";
         this.resize();
+    },
+
+    setRecordingProfile: function(isProfiling)
+    {
+        this.getProfileType(WebInspector.CPUProfileType.TypeId).setRecordingProfile(isProfiling);
+        if (this.hasTemporaryProfile(WebInspector.CPUProfileType.TypeId) !== isProfiling) {
+            if (!this._temporaryRecordingProfile) {
+                this._temporaryRecordingProfile = {
+                    typeId: WebInspector.CPUProfileType.TypeId,
+                    title: WebInspector.UIString("Recording"),
+                    uid: -1,
+                    isTemporary: true
+                };
+            }
+            if (isProfiling)
+                this.addProfileHeader(this._temporaryRecordingProfile);
+            else
+                this.removeProfileHeader(this._temporaryRecordingProfile);
+        }
+        this.updateProfileTypeButtons();
     }
 }
 
index 9f35ed2..5775c85 100644 (file)
 
 WebInspector.ResourceManager = function()
 {
-    this._registerNotifyHandlers(
-        "identifierForInitialRequest",
-        "willSendRequest",
-        "markResourceAsCached",
-        "didReceiveResponse",
-        "didReceiveContentLength",
-        "didFinishLoading",
-        "didFailLoading",
-        "didLoadResourceFromMemoryCache",
-        "setInitialContent",
-        "didCommitLoadForFrame",
-        "frameDetachedFromParent",
-        "didCreateWebSocket",
-        "willSendWebSocketHandshakeRequest",
-        "didReceiveWebSocketHandshakeResponse",
-        "didCloseWebSocket");
-
     this._resourcesById = {};
     this._resourcesByURL = {};
     this._resourceTreeModel = new WebInspector.ResourceTreeModel();
     InspectorBackend.cachedResources(this._processCachedResources.bind(this));
+    InspectorBackend.registerDomainDispatcher("Resources", this);
 }
 
 WebInspector.ResourceManager.prototype = {
-    _registerNotifyHandlers: function()
-    {
-        for (var i = 0; i < arguments.length; ++i)
-            WebInspector[arguments[i]] = this[arguments[i]].bind(this);
-    },
-
     identifierForInitialRequest: function(identifier, url, loader, callStack)
     {
         var resource = this._createResource(identifier, url, loader, callStack);
@@ -428,6 +406,89 @@ WebInspector.ResourceManager.prototype = {
         }
 
         delete this._resourcesByURL[resource.url];
+    },
+
+    updateDOMStorage: function(storageId)
+    {
+        WebInspector.panels.resources.updateDOMStorage(storageId);
+    },
+
+    updateApplicationCacheStatus: function(status)
+    {
+        WebInspector.panels.resources.updateApplicationCacheStatus(status);
+    },
+
+    didGetFileSystemPath: function(root, type, origin)
+    {
+        WebInspector.panels.resources.updateFileSystemPath(root, type, origin);
+    },
+
+    didGetFileSystemError: function(type, origin)
+    {
+        WebInspector.panels.resources.updateFileSystemError(type, origin);
+    },
+
+    didGetFileSystemDisabled: function()
+    {
+        WebInspector.panels.resources.setFileSystemDisabled();
+    },
+
+    updateNetworkState: function(isNowOnline)
+    {
+        WebInspector.panels.resources.updateNetworkState(isNowOnline);
+    },
+
+    addDOMStorage: function(payload)
+    {
+        if (!WebInspector.panels.resources)
+            return;
+        var domStorage = new WebInspector.DOMStorage(
+            payload.id,
+            payload.host,
+            payload.isLocalStorage);
+        WebInspector.panels.resources.addDOMStorage(domStorage);
+    },
+
+    selectDOMStorage: function(o)
+    {
+        WebInspector.showPanel("resources");
+        WebInspector.panels.resources.selectDOMStorage(o);
+    },
+
+    addDatabase: function(payload)
+    {
+        if (!WebInspector.panels.resources)
+            return;
+        var database = new WebInspector.Database(
+            payload.id,
+            payload.domain,
+            payload.name,
+            payload.version);
+        WebInspector.panels.resources.addDatabase(database);
+    },
+
+    selectDatabase: function(o)
+    {
+        WebInspector.showPanel("resources");
+        WebInspector.panels.resources.selectDatabase(o);
+    },
+
+    sqlTransactionSucceeded: function(transactionId, columnNames, values)
+    {
+        var callback = WebInspector.Database.successCallbacks[transactionId];
+        if (!callback)
+            return;
+        delete WebInspector.Database.successCallbacks[transactionId];
+        callback(columnNames, values);
+    },
+
+    sqlTransactionFailed: function(transactionId, errorObj)
+    {
+        var callback = WebInspector.Database.errorCallbacks[transactionId];
+        if (!callback)
+            return;
+        delete WebInspector.Database.errorCallbacks[transactionId];
+        callback(errorObj);
     }
 }
 
index 658d57c..b254f3c 100644 (file)
@@ -100,15 +100,3 @@ WebInspector.Worker = function(id, url, shared)
     this.url = url;
     this.shared = shared;
 }
-
-WebInspector.didCreateWorker = function()
-{
-    var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;
-    workersPane.addWorker.apply(workersPane, arguments);
-}
-
-WebInspector.didDestroyWorker = function()
-{
-    var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;
-    workersPane.removeWorker.apply(workersPane, arguments);
-}
index e0d8e65..9009242 100644 (file)
@@ -1173,23 +1173,11 @@ WebInspector.showPanel = function(panel)
     this.currentPanel = this.panels[panel];
 }
 
-WebInspector.selectDatabase = function(o)
-{
-    WebInspector.showPanel("resources");
-    WebInspector.panels.resources.selectDatabase(o);
-}
-
 WebInspector.consoleMessagesCleared = function()
 {
     WebInspector.console.clearMessages();
 }
 
-WebInspector.selectDOMStorage = function(o)
-{
-    WebInspector.showPanel("resources");
-    WebInspector.panels.resources.selectDOMStorage(o);
-}
-
 WebInspector.domContentEventFired = function(time)
 {
     this.panels.audits.mainResourceDOMContentTime = time;
@@ -1208,59 +1196,6 @@ WebInspector.loadEventFired = function(time)
     this.mainResourceLoadTime = time;
 }
 
-WebInspector.addDatabase = function(payload)
-{
-    if (!this.panels.resources)
-        return;
-    var database = new WebInspector.Database(
-        payload.id,
-        payload.domain,
-        payload.name,
-        payload.version);
-    this.panels.resources.addDatabase(database);
-}
-
-WebInspector.addDOMStorage = function(payload)
-{
-    if (!this.panels.resources)
-        return;
-    var domStorage = new WebInspector.DOMStorage(
-        payload.id,
-        payload.host,
-        payload.isLocalStorage);
-    this.panels.resources.addDOMStorage(domStorage);
-}
-
-WebInspector.updateDOMStorage = function(storageId)
-{
-    this.panels.resources.updateDOMStorage(storageId);
-}
-
-WebInspector.updateApplicationCacheStatus = function(status)
-{
-    this.panels.resources.updateApplicationCacheStatus(status);
-}
-
-WebInspector.didGetFileSystemPath = function(root, type, origin)
-{
-    this.panels.resources.updateFileSystemPath(root, type, origin);
-}
-
-WebInspector.didGetFileSystemError = function(type, origin)
-{
-    this.panels.resources.updateFileSystemError(type, origin);
-}
-
-WebInspector.didGetFileSystemDisabled = function()
-{
-    this.panels.resources.setFileSystemDisabled();
-}
-
-WebInspector.updateNetworkState = function(isNowOnline)
-{
-    this.panels.resources.updateNetworkState(isNowOnline);
-}
-
 WebInspector.searchingForNodeWasEnabled = function()
 {
     this.panels.elements.searchingForNodeWasEnabled();
@@ -1271,56 +1206,6 @@ WebInspector.searchingForNodeWasDisabled = function()
     this.panels.elements.searchingForNodeWasDisabled();
 }
 
-WebInspector.attachDebuggerWhenShown = function()
-{
-    this.panels.scripts.attachDebuggerWhenShown();
-}
-
-WebInspector.debuggerWasEnabled = function()
-{
-    this.panels.scripts.debuggerWasEnabled();
-}
-
-WebInspector.debuggerWasDisabled = function()
-{
-    this.panels.scripts.debuggerWasDisabled();
-}
-
-WebInspector.profilerWasEnabled = function()
-{
-    this.panels.profiles.profilerWasEnabled();
-}
-
-WebInspector.profilerWasDisabled = function()
-{
-    this.panels.profiles.profilerWasDisabled();
-}
-
-WebInspector.parsedScriptSource = function(sourceID, sourceURL, source, startingLine, scriptWorldType)
-{
-    this.panels.scripts.addScript(sourceID, sourceURL, source, startingLine, undefined, undefined, scriptWorldType);
-}
-
-WebInspector.restoredBreakpoint = function(sourceID, sourceURL, line, enabled, condition)
-{
-    this.debuggerModel.breakpointRestored(sourceID, sourceURL, line, enabled, condition);
-}
-
-WebInspector.failedToParseScriptSource = function(sourceURL, source, startingLine, errorLine, errorMessage)
-{
-    this.panels.scripts.addScript(null, sourceURL, source, startingLine, errorLine, errorMessage);
-}
-
-WebInspector.pausedScript = function(details)
-{
-    this.debuggerModel.debuggerPaused(details);
-}
-
-WebInspector.resumedScript = function()
-{
-    this.debuggerModel.debuggerResumed();
-}
-
 WebInspector.reset = function()
 {
     this.debuggerModel.reset();
@@ -1341,12 +1226,6 @@ WebInspector.reset = function()
     this.breakpointManager.restoreBreakpoints();
 }
 
-WebInspector.resetProfilesPanel = function()
-{
-    if (WebInspector.panels.profiles)
-        WebInspector.panels.profiles.resetProfiles();
-}
-
 WebInspector.bringToFront = function()
 {
     InspectorFrontendHost.bringToFront();
@@ -1363,12 +1242,6 @@ WebInspector.inspectedURLChanged = function(url)
     }
 }
 
-WebInspector.didCommitLoad = function()
-{
-    // Cleanup elements panel early on inspected page refresh.
-    WebInspector.domAgent.setDocument(null);
-}
-
 WebInspector.updateConsoleMessageExpiredCount = function(count)
 {
     var message = String.sprintf(WebInspector.UIString("%d console messages are not shown."), count);
@@ -1481,41 +1354,6 @@ WebInspector.log = function(message, messageLevel)
     logMessage(message);
 }
 
-WebInspector.addProfileHeader = function(profile)
-{
-    this.panels.profiles.addProfileHeader(profile);
-}
-
-WebInspector.setRecordingProfile = function(isProfiling)
-{
-    this.panels.profiles.getProfileType(WebInspector.CPUProfileType.TypeId).setRecordingProfile(isProfiling);
-    if (this.panels.profiles.hasTemporaryProfile(WebInspector.CPUProfileType.TypeId) !== isProfiling) {
-        if (!this._temporaryRecordingProfile) {
-            this._temporaryRecordingProfile = {
-                typeId: WebInspector.CPUProfileType.TypeId,
-                title: WebInspector.UIString("Recording…"),
-                uid: -1,
-                isTemporary: true
-            };
-        }
-        if (isProfiling)
-            this.panels.profiles.addProfileHeader(this._temporaryRecordingProfile);
-        else
-            this.panels.profiles.removeProfileHeader(this._temporaryRecordingProfile);
-    }
-    this.panels.profiles.updateProfileTypeButtons();
-}
-
-WebInspector.addHeapSnapshotChunk = function(uid, chunk)
-{
-    this.panels.profiles.addHeapSnapshotChunk(uid, chunk);
-}
-
-WebInspector.finishHeapSnapshot = function(uid)
-{
-    this.panels.profiles.finishHeapSnapshot(uid);
-}
-
 WebInspector.drawLoadingPieChart = function(canvas, percent) {
     var g = canvas.getContext("2d");
     var darkColor = "rgb(122, 168, 218)";
index 33b991b..9eec64a 100644 (file)
@@ -1,3 +1,21 @@
+2010-12-13  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: Protocol cleanup task. Assign domain attribute to Resources and Debugger specific functions.
+
+        Debugger and Resources related notification functions of Inspector.idl were
+        marked as such with help of "domain" attribute. The other changes in js files
+        are reflecting this change. Some wrappers in WebInspector namespace were dropped,
+        the others were moved to DebuggerModel class.
+
+        https://bugs.webkit.org/show_bug.cgi?id=50906
+
+        * src/js/Tests.js:
+        (.TestSuite.prototype._waitForScriptPause):
+        (.TestSuite.prototype._waitUntilScriptsAreParsed.waitForAllScripts):
+        (.TestSuite.prototype._waitUntilScriptsAreParsed):
+
 2010-12-13  Yury Semikhatsky  <yurys@chromium.org>
 
         Reviewed by Adam Barth.
index 2b264ee..55b24ea 100644 (file)
@@ -730,7 +730,7 @@ TestSuite.prototype._waitForScriptPause = function(expectations, callback)
     var test = this;
     // Wait until script is paused.
     test.addSniffer(
-        WebInspector,
+        WebInspector.debuggerModel,
         "pausedScript",
         function(details) {
             var callFrames = details.callFrames;
@@ -805,7 +805,7 @@ TestSuite.prototype._waitUntilScriptsAreParsed = function(expectedScripts, callb
         if (test._scriptsAreParsed(expectedScripts))
             callback();
         else
-            test.addSniffer(WebInspector, "parsedScriptSource", waitForAllScripts);
+            test.addSniffer(WebInspector.debuggerModel, "parsedScriptSource", waitForAllScripts);
     }
 
     waitForAllScripts();
@@ -852,7 +852,7 @@ TestSuite.prototype.testPauseInEval = function()
 
     devtools.tools.evaluateJavaScript("fib(10)");
 
-    this.addSniffer(WebInspector, "pausedScript",
+    this.addSniffer(WebInspector.debuggerModel, "pausedScript",
         function() {
             test.releaseControl();
         });