Commit 2c950cf3 authored by loislo@chromium.org's avatar loislo@chromium.org

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  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: http://svn.webkit.org/repository/webkit/trunk@73916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d9e7cfb3
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.
......
......@@ -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)
......
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.
......
......@@ -33,62 +33,61 @@
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
......
......@@ -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);
}
......
......@@ -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()
......
......@@ -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 = {};
......
......@@ -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);
}
......@@ -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);
}
}
......
......@@ -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();
}
}
......
......@@ -30,36 +30,14 @@
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];