Reviewed by Yury Semikhatsky.
Web Inspector: split all the functions of Inspector backend API by domain.
https://bugs.webkit.org/show_bug.cgi?id=54558
We have a number of functions from different domains in single instance of InspectorBackend.
It'd be better to split the functions by their domains.
As example 'evaluate' will be moved from InspectorBackend to RuntimeAgent container.
* http/tests/inspector/console-xhr-logging.html:
* http/tests/inspector/extensions-test.js:
(initialize_ExtensionsTest.InspectorTest.runExtensionTests):
* http/tests/inspector/inspector-test.js:
(initialize_InspectorTest.InspectorTest.completeTest):
(initialize_InspectorTest.InspectorTest.evaluateInPage):
(initialize_InspectorTest.InspectorTest.reloadPage):
* inspector/console/console-dir-global.html:
* inspector/debugger/debugger-autocontinue-on-syntax-error.html:
* inspector/debugger/debugger-pause-on-exception.html:
* inspector/elements/elements-panel-search.html:
* inspector/report-API-errors-expected.txt:
* inspector/report-API-errors.html:
* inspector/report-protocol-errors.html:
* inspector/styles/styles-new-API.html:
* inspector/styles/styles-source-offsets.html:
* inspector/timeline/timeline-network-resource.html:
* inspector/timeline/timeline-script-tag-1.html:
* inspector/timeline/timeline-script-tag-2.html:
* inspector/timeline/timeline-test.js:
(initialize_Timeline.InspectorTest.performActionsAndPrint.step2):
* inspector/timeline/timeline-trivial.html:
2011-02-16 Ilya Tikhonovsky <loislo@chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: split all the functions of Inspector backend API by domain.
https://bugs.webkit.org/show_bug.cgi?id=54558
We have a number of functions from different domains in single instance of InspectorBackend.
It'd be better to split the functions by their domains.
As example 'evaluate' will be moved from InspectorBackend to RuntimeAgent container.
* inspector/CodeGeneratorInspector.pm:
* inspector/front-end/AuditRules.js:
(WebInspector.AuditRules.evaluateInTargetWindow):
(WebInspector.AuditRules.UnusedCssRule.prototype.doRun):
* inspector/front-end/AuditsPanel.js:
(WebInspector.AuditsPanel.prototype._reloadResources):
* inspector/front-end/BreakpointManager.js:
(WebInspector.BreakpointManager.prototype._projectChanged):
(WebInspector.BreakpointManager.prototype.restoreDOMBreakpoints):
(WebInspector.BreakpointManager.prototype._saveBreakpoints):
(WebInspector.DOMBreakpoint.prototype._enable):
(WebInspector.DOMBreakpoint.prototype._disable):
(WebInspector.EventListenerBreakpoint.prototype._enable):
(WebInspector.EventListenerBreakpoint.prototype._disable):
(WebInspector.XHRBreakpoint.prototype._enable):
(WebInspector.XHRBreakpoint.prototype._disable):
* inspector/front-end/CSSStyleModel.js:
(WebInspector.CSSStyleModel.prototype.getStylesAsync):
(WebInspector.CSSStyleModel.prototype.getComputedStyleAsync):
(WebInspector.CSSStyleModel.prototype.getInlineStyleAsync):
(WebInspector.CSSStyleModel.prototype.setRuleSelector.callback):
(WebInspector.CSSStyleModel.prototype.setRuleSelector):
(WebInspector.CSSStyleModel.prototype.addRule.callback):
(WebInspector.CSSStyleModel.prototype.addRule):
(WebInspector.CSSStyleModel.prototype._styleSheetChanged):
(WebInspector.CSSStyleModel.prototype._onRevert):
(WebInspector.CSSStyleDeclaration.prototype.insertPropertyAt):
(WebInspector.CSSProperty.prototype.setText):
(WebInspector.CSSProperty.prototype.setDisabled):
(WebInspector.CSSStyleSheet.createForId):
(WebInspector.CSSStyleSheet.prototype.setText):
* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleView.prototype.requestClearMessages):
(WebInspector.ConsoleView.prototype.completions):
(WebInspector.ConsoleView.prototype._handleContextMenuEvent.itemAction):
(WebInspector.ConsoleView.prototype._handleContextMenuEvent):
(WebInspector.ConsoleView.prototype.evalInInspectedWindow):
* inspector/front-end/CookieItemsView.js:
(WebInspector.CookieItemsView.prototype._deleteCookie):
* inspector/front-end/DOMAgent.js:
(WebInspector.DOMAgent.prototype.getChildNodesAsync):
(WebInspector.DOMAgent.prototype.setAttributeAsync):
(WebInspector.DOMAgent.prototype.removeAttributeAsync):
(WebInspector.DOMAgent.prototype.setTextNodeValueAsync):
(WebInspector.ApplicationCacheDispatcher.getApplicationCachesAsync):
(WebInspector.Cookies.getCookiesAsync):
(WebInspector.EventListeners.getEventListenersForNodeAsync):
* inspector/front-end/DOMStorage.js:
(WebInspector.DOMStorage.prototype.getEntries):
(WebInspector.DOMStorage.prototype.setItem):
(WebInspector.DOMStorage.prototype.removeItem):
* inspector/front-end/Database.js:
(WebInspector.Database.prototype.getTableNames):
(WebInspector.Database.prototype.executeSql):
* inspector/front-end/DebuggerModel.js:
(WebInspector.DebuggerModel.prototype.enableDebugger):
(WebInspector.DebuggerModel.prototype.disableDebugger):
(WebInspector.DebuggerModel.prototype.continueToLocation):
(WebInspector.DebuggerModel.prototype.setBreakpoint):
(WebInspector.DebuggerModel.prototype.setBreakpointBySourceId):
(WebInspector.DebuggerModel.prototype.removeBreakpoint):
(WebInspector.DebuggerModel.prototype.editScriptSource):
* inspector/front-end/ElementsPanel.js:
(WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged):
(WebInspector.ElementsPanel):
(WebInspector.ElementsPanel.prototype.setDocument):
(WebInspector.ElementsPanel.prototype.searchCanceled):
(WebInspector.ElementsPanel.prototype.performSearch):
(WebInspector.ElementsPanel.prototype.handleCopyEvent):
(WebInspector.ElementsPanel.prototype.setSearchingForNode):
* inspector/front-end/ElementsTreeOutline.js:
(WebInspector.ElementsTreeElement.prototype._createTooltipForNode):
(WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted):
():
* inspector/front-end/ExtensionPanel.js:
(WebInspector.ExtensionWatchSidebarPane.prototype.setExpression):
* inspector/front-end/ExtensionServer.js:
(WebInspector.ExtensionServer.prototype._onAddRequestHeaders):
(WebInspector.ExtensionServer.prototype._onReload):
(WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage):
* inspector/front-end/HeapSnapshotView.js:
(WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
* inspector/front-end/NetworkManager.js:
(WebInspector.NetworkManager):
(WebInspector.NetworkManager.prototype.reset):
(WebInspector.NetworkManager.prototype.requestContent):
* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkDataGridNode.prototype._openInNewTab):
* inspector/front-end/ProfileView.js:
(WebInspector.CPUProfileView):
(WebInspector.CPUProfileType.prototype.buttonClicked):
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype._clearProfiles):
(WebInspector.ProfilesPanel.prototype._removeProfileHeader):
(WebInspector.ProfilesPanel.prototype.loadHeapSnapshot):
(WebInspector.ProfilesPanel.prototype._toggleProfiling):
(WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
* inspector/front-end/PropertiesSidebarPane.js:
(WebInspector.PropertiesSidebarPane.prototype.update):
* inspector/front-end/RemoteObject.js:
(WebInspector.RemoteObject.resolveNode):
(WebInspector.RemoteObject.prototype.getProperties):
(WebInspector.RemoteObject.prototype.setPropertyValue):
(WebInspector.RemoteObject.prototype.pushNodeToFrontend):
* inspector/front-end/ResourcesPanel.js:
(WebInspector.FrameTreeElement.prototype.onselect):
(WebInspector.FrameTreeElement.prototype.set hovered):
(WebInspector.FrameResourceTreeElement.prototype.ondblclick):
* inspector/front-end/Script.js:
(WebInspector.Script.prototype.requestSource):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame):
(WebInspector.ScriptsPanel.prototype._setPauseOnExceptions):
(WebInspector.ScriptsPanel.prototype._togglePause):
(WebInspector.ScriptsPanel.prototype._stepOverClicked):
(WebInspector.ScriptsPanel.prototype._stepIntoClicked):
(WebInspector.ScriptsPanel.prototype._stepOutClicked):
(WebInspector.ScriptsPanel.prototype.toggleBreakpointsClicked):
* inspector/front-end/SourceFrame.js:
(WebInspector.SourceFrame.prototype._hidePopup):
* inspector/front-end/TestController.js:
(WebInspector.TestController.prototype.notifyDone):
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._toggleTimelineButtonClicked):
* inspector/front-end/WatchExpressionsSidebarPane.js:
(WebInspector.WatchExpressionsSection.prototype.update):
* inspector/front-end/WorkersSidebarPane.js:
(WebInspector.WorkersSidebarPane.prototype.setInstrumentation):
* inspector/front-end/inspector.js:
(WebInspector.highlightDOMNode):
(WebInspector.doLoadedDone):
(WebInspector.openResource):
(WebInspector.documentKeyDown):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78717
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-02-16 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: split all the functions of Inspector backend API by domain.
+ https://bugs.webkit.org/show_bug.cgi?id=54558
+
+ We have a number of functions from different domains in single instance of InspectorBackend.
+ It'd be better to split the functions by their domains.
+ As example 'evaluate' will be moved from InspectorBackend to RuntimeAgent container.
+
+ * http/tests/inspector/console-xhr-logging.html:
+ * http/tests/inspector/extensions-test.js:
+ (initialize_ExtensionsTest.InspectorTest.runExtensionTests):
+ * http/tests/inspector/inspector-test.js:
+ (initialize_InspectorTest.InspectorTest.completeTest):
+ (initialize_InspectorTest.InspectorTest.evaluateInPage):
+ (initialize_InspectorTest.InspectorTest.reloadPage):
+ * inspector/console/console-dir-global.html:
+ * inspector/debugger/debugger-autocontinue-on-syntax-error.html:
+ * inspector/debugger/debugger-pause-on-exception.html:
+ * inspector/elements/elements-panel-search.html:
+ * inspector/report-API-errors-expected.txt:
+ * inspector/report-API-errors.html:
+ * inspector/report-protocol-errors.html:
+ * inspector/styles/styles-new-API.html:
+ * inspector/styles/styles-source-offsets.html:
+ * inspector/timeline/timeline-network-resource.html:
+ * inspector/timeline/timeline-script-tag-1.html:
+ * inspector/timeline/timeline-script-tag-2.html:
+ * inspector/timeline/timeline-test.js:
+ (initialize_Timeline.InspectorTest.performActionsAndPrint.step2):
+ * inspector/timeline/timeline-trivial.html:
+
2011-02-16 Nikolas Zimmermann <nzimmermann@rim.com>
Not reviewed.
{
InspectorTest.evaluateInPage("makeRequests()", step2);
}
- InspectorBackend.setMonitoringXHREnabled(true, callback);
+ ConsoleAgent.setMonitoringXHREnabled(true, callback);
}
function step2()
{
InspectorTest.evaluateInPage("makeRequests()", step3);
}
- InspectorBackend.setMonitoringXHREnabled(false, callback);
+ ConsoleAgent.setMonitoringXHREnabled(false, callback);
}
function step3()
InspectorTest.runExtensionTests = function()
{
- InspectorBackend.evaluate("location.href", "console", false, function(result) {
+ RuntimeAgent.evaluate("location.href", "console", false, function(result) {
var pageURL = result.description;
var extensionURL = (/^https?:/.test(pageURL) ?
pageURL.replace(/^(https?:\/\/[^/]*\/).*$/,"$1") :
InspectorTest.completeTest = function()
{
- InspectorBackend.didEvaluateForTestInFrontend(InspectorTest.completeTestCallId, "");
+ InspectorAgent.didEvaluateForTestInFrontend(InspectorTest.completeTestCallId, "");
}
InspectorTest.evaluateInConsole = function(code, callback)
if (callback)
callback(WebInspector.RemoteObject.fromPayload(result));
}
- InspectorBackend.evaluate(code, "console", false, mycallback);
+ RuntimeAgent.evaluate(code, "console", false, mycallback);
}
InspectorTest.evaluateInPageWithTimeout = function(code, callback)
if (WebInspector.panels.network)
WebInspector.panels.network._reset();
- InspectorBackend.reloadPage(false);
+ InspectorAgent.reloadPage(false);
}
InspectorTest.pageReloaded = function()
function test()
{
- InspectorBackend.evaluate("window", "console", false, evalCallback);
+ RuntimeAgent.evaluate("window", "console", false, evalCallback);
function evalCallback(result)
{
function startDebuggerTestCallback()
{
- InspectorBackend.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
+ DebuggerAgent.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
InspectorTest.showScriptSource("debugger-autocontinue-on-syntax-error.html", reloadInspectedPage);
}
function step1()
{
- InspectorBackend.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
+ DebuggerAgent.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
InspectorTest.showScriptSource("debugger-pause-on-exception.html", step2);
}
if (node.nodeType === Node.TEXT_NODE)
searchResults.push(node.nodeValue);
else
- InspectorBackend.getOuterHTML(node.id, addSearchResult);
+ DOMAgent.getOuterHTML(node.id, addSearchResult);
}
}
// Plain text.
- InspectorBackend.performSearch("Foo" + "Bar", true);
+ DOMAgent.performSearch("Foo" + "Bar", true);
// Partial text.
- InspectorBackend.performSearch("oo" + "Ba", true);
+ DOMAgent.performSearch("oo" + "Ba", true);
// Start tag.
- InspectorBackend.performSearch("<inpu" + "t", true);
+ DOMAgent.performSearch("<inpu" + "t", true);
// Partial tag.
- InspectorBackend.performSearch("npu" + "t", true);
+ DOMAgent.performSearch("npu" + "t", true);
// Exact attribute name.
- InspectorBackend.performSearch("valu" + "e", true);
+ DOMAgent.performSearch("valu" + "e", true);
// Exact attribute val<>ue.
- InspectorBackend.performSearch("In" + "putVa" + "l", true);
+ DOMAgent.performSearch("In" + "putVa" + "l", true);
// Partial attribute val<>ue.
- InspectorBackend.performSearch("n" + "putVa" + "l", true);
+ DOMAgent.performSearch("n" + "putVa" + "l", true);
// Terminator.
- InspectorBackend.performSearch("ter" + "mi" + "nator", true);
+ DOMAgent.performSearch("ter" + "mi" + "nator", true);
}
</script>
</head>
Tests that InspectorBackendStub is catching incorrect arguments.
-Protocol Error: Invalid type of argument 'enabled' for 'InspectorBackend.setMonitoringXHREnabled' call. It should be 'boolean' but it is 'number'.
-Protocol Error: Invalid number of arguments for 'InspectorBackend.setMonitoringXHREnabled' call. It should have the next arguments '{"enabled":"boolean"}'.
-Protocol Error: Optional callback argument for 'InspectorBackend.setMonitoringXHREnabled' call should be a function but its type is 'string'.
+Protocol Error: Invalid type of argument 'enabled' for 'ConsoleAgent.setMonitoringXHREnabled' call. It should be 'boolean' but it is 'number'.
+Protocol Error: Invalid number of arguments for 'ConsoleAgent.setMonitoringXHREnabled' call. It should have the next arguments '{"enabled":"boolean"}'.
+Protocol Error: Optional callback argument for 'ConsoleAgent.setMonitoringXHREnabled' call should be a function but its type is 'string'.
Protocol Error: the message is for non-existing domain 'wrongDomain'
Protocol Error: Attempted to dispatch an unimplemented method 'Inspector.something-strange'
InspectorTest.addResult(String.sprintf.apply(this, arguments));
}
- InspectorBackend.setMonitoringXHREnabled(1);
- InspectorBackend.setMonitoringXHREnabled();
- InspectorBackend.setMonitoringXHREnabled(true, "not a function");
- InspectorBackend.setMonitoringXHREnabled(true, undefined);
- InspectorBackend.setMonitoringXHREnabled(false, undefined);
+ ConsoleAgent.setMonitoringXHREnabled(1);
+ ConsoleAgent.setMonitoringXHREnabled();
+ ConsoleAgent.setMonitoringXHREnabled(true, "not a function");
+ ConsoleAgent.setMonitoringXHREnabled(true, undefined);
+ ConsoleAgent.setMonitoringXHREnabled(false, undefined);
InspectorBackend.dispatch('{"type": "event", "domain": "wrongDomain", "event": "something-strange", "data": {}}');
InspectorBackend.dispatch('{"type": "event", "domain": "Inspector", "event": "something-strange", "data": {}}');
InspectorFrontendHost.sendMessageToBackend(messages[i]);
}
- InspectorBackend.disableDebugger(fire);
+ InspectorAgent.disableDebugger(fire);
}
</script>
function nodeCallback(node)
{
- InspectorBackend.getStylesForNode(node.id, callback);
+ CSSAgent.getStylesForNode(node.id, callback);
}
InspectorTest.selectNodeWithId("mainBody", nodeCallback);
}
function nodeCallback(node)
{
- InspectorBackend.getStylesForNode(node.id, callback);
+ CSSAgent.getStylesForNode(node.id, callback);
}
InspectorTest.nodeWithId("thetable", nodeCallback);
}
{
InspectorTest.addResult("");
InspectorTest.addResult("=== Last stylesheet patched ===");
- InspectorBackend.setStyleSheetText(styleSheet.styleSheetId, newStyleSheetText,
+ CSSAgent.setStyleSheetText(styleSheet.styleSheetId, newStyleSheetText,
loadAndDumpStyleSheet.bind(null, styleSheet.styleSheetId, test_changeSelector));
}
for (var i = 0; i < ids.length; ++i)
loadAndDumpStyleSheet(ids[i], (i < ids.length - 1) ? null : patchStyleSheet);
}
- InspectorBackend.getAllStyles(styleSheetIdsLoaded);
+ CSSAgent.getAllStyles(styleSheetIdsLoaded);
}
function test_changeSelector(styleSheet)
loadAndDumpStyleSheet(rule.ruleId.styleSheetId, test_setStyleText);
}
- InspectorBackend.setRuleSelector(styleSheet.rules[0].ruleId, "html *, body[foo=\"bar\"]", didSetSelector);
+ CSSAgent.setRuleSelector(styleSheet.rules[0].ruleId, "html *, body[foo=\"bar\"]", didSetSelector);
}
function test_setStyleText(styleSheet)
loadAndDumpStyleSheet(style.styleId.styleSheetId, test_addRule);
}
- InspectorBackend.setPropertyText(styleSheet.rules[0].style.styleId, 0, "", true);
- InspectorBackend.setPropertyText(styleSheet.rules[0].style.styleId, 0, "", true);
+ CSSAgent.setPropertyText(styleSheet.rules[0].style.styleId, 0, "", true);
+ CSSAgent.setPropertyText(styleSheet.rules[0].style.styleId, 0, "", true);
// This operation should not update the style as the new property text is not parsable.
- InspectorBackend.setPropertyText(styleSheet.rules[0].style.styleId, 0, "zzz;", false);
- InspectorBackend.setPropertyText(styleSheet.rules[0].style.styleId, 0, "color: white; background: black;", false, didSetStyleText);
+ CSSAgent.setPropertyText(styleSheet.rules[0].style.styleId, 0, "zzz;", false);
+ CSSAgent.setPropertyText(styleSheet.rules[0].style.styleId, 0, "color: white; background: black;", false, didSetStyleText);
}
function test_addRule()
function didSetStyleText(style)
{
- InspectorBackend.getStylesForNode(WebInspector.domAgent.document.body.id, didGetStyles);
+ CSSAgent.getStylesForNode(WebInspector.domAgent.document.body.id, didGetStyles);
}
function ruleAdded(rule)
{
- InspectorBackend.setPropertyText(rule.style.styleId, 0, "font-family: serif;", false, didSetStyleText);
+ CSSAgent.setPropertyText(rule.style.styleId, 0, "font-family: serif;", false, didSetStyleText);
}
- InspectorBackend.addRule(WebInspector.domAgent.document.body.id, "body", ruleAdded);
+ CSSAgent.addRule(WebInspector.domAgent.document.body.id, "body", ruleAdded);
}
function test_disableProperty()
// border-width: 0px;
var style = styles.matchedCSSRules[1].style;
- InspectorBackend.toggleProperty(style.styleId, 0, true); // height: 100%
- InspectorBackend.toggleProperty(style.styleId, 7, true); // border-width: 0px
- InspectorBackend.setPropertyText(style.styleId, 7, "font-size: 12px;", false);
- InspectorBackend.setPropertyText(style.styleId, 9, "font-size: 14px;", false);
- InspectorBackend.toggleProperty(style.styleId, 9, true); // font-size: 14px
- InspectorBackend.setPropertyText(style.styleId, 8, "border-width: 1px;", true);
- InspectorBackend.toggleProperty(style.styleId, 8, false); // border-width: 1px
+ CSSAgent.toggleProperty(style.styleId, 0, true); // height: 100%
+ CSSAgent.toggleProperty(style.styleId, 7, true); // border-width: 0px
+ CSSAgent.setPropertyText(style.styleId, 7, "font-size: 12px;", false);
+ CSSAgent.setPropertyText(style.styleId, 9, "font-size: 14px;", false);
+ CSSAgent.toggleProperty(style.styleId, 9, true); // font-size: 14px
+ CSSAgent.setPropertyText(style.styleId, 8, "border-width: 1px;", true);
+ CSSAgent.toggleProperty(style.styleId, 8, false); // border-width: 1px
// height : 100% ; [d]
// border: 1px solid;
// border-width: 2px;
// border-width: 1px;
// font-size: 14px; [d]
- InspectorBackend.setPropertyText(style.styleId, 3, "", true, didDisableProperty);
+ CSSAgent.setPropertyText(style.styleId, 3, "", true, didDisableProperty);
}
function nodeCallback(node)
{
- InspectorBackend.getStylesForNode(node.id, stylesCallback);
+ CSSAgent.getStylesForNode(node.id, stylesCallback);
}
InspectorTest.nodeWithId("toggle", nodeCallback);
}
InspectorTest.completeTest();
}
- InspectorBackend.toggleProperty(styleId, 6, false);
- InspectorBackend.toggleProperty(styleId, 8, false, didEnableProperty);
+ CSSAgent.toggleProperty(styleId, 6, false);
+ CSSAgent.toggleProperty(styleId, 8, false, didEnableProperty);
}
// Data dumping
continuation(styleSheet);
}
- InspectorBackend.getStyleSheet(styleSheetId, styleSheetLoaded);
+ CSSAgent.getStyleSheet(styleSheetId, styleSheetLoaded);
}
}
function step1(node)
{
- InspectorBackend.getStylesForNode(node.id, step2);
+ CSSAgent.getStylesForNode(node.id, step2);
}
function step2(styles)
var resourceId;
var scriptUrl = "timeline-network-resource.js";
- InspectorBackend.startTimelineProfiler(step1);
+ InspectorAgent.startTimelineProfiler(step1);
function step1()
{
function step2()
{
- InspectorBackend.stopTimelineProfiler(step3);
+ InspectorAgent.stopTimelineProfiler(step3);
}
function step3()
function test()
{
- InspectorBackend.startTimelineProfiler(step1);
+ InspectorAgent.startTimelineProfiler(step1);
function step1()
{
InspectorTest.evaluateInPage("performActions()");
function step2()
{
- InspectorBackend.stopTimelineProfiler(step3);
+ InspectorAgent.stopTimelineProfiler(step3);
}
function step3()
function test()
{
- InspectorBackend.startTimelineProfiler(step1);
+ InspectorAgent.startTimelineProfiler(step1);
function step1()
{
InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
function step2()
{
- InspectorBackend.stopTimelineProfiler(step3);
+ InspectorAgent.stopTimelineProfiler(step3);
}
function step3()
InspectorTest.performActionsAndPrint = function(actions, typeName)
{
- InspectorBackend.startTimelineProfiler(step1);
+ InspectorAgent.startTimelineProfiler(step1);
function step1()
{
InspectorTest.evaluateInPage(actions, step2);
function step2()
{
- InspectorBackend.stopTimelineProfiler(step3);
+ InspectorAgent.stopTimelineProfiler(step3);
}
function step3()
InspectorTest.addResult("Timeline started");
InspectorTest.completeTest();
}
- InspectorBackend.startTimelineProfiler(callback);
+ InspectorAgent.startTimelineProfiler(callback);
}
+2011-02-16 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: split all the functions of Inspector backend API by domain.
+ https://bugs.webkit.org/show_bug.cgi?id=54558
+
+ We have a number of functions from different domains in single instance of InspectorBackend.
+ It'd be better to split the functions by their domains.
+ As example 'evaluate' will be moved from InspectorBackend to RuntimeAgent container.
+
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/front-end/AuditRules.js:
+ (WebInspector.AuditRules.evaluateInTargetWindow):
+ (WebInspector.AuditRules.UnusedCssRule.prototype.doRun):
+ * inspector/front-end/AuditsPanel.js:
+ (WebInspector.AuditsPanel.prototype._reloadResources):
+ * inspector/front-end/BreakpointManager.js:
+ (WebInspector.BreakpointManager.prototype._projectChanged):
+ (WebInspector.BreakpointManager.prototype.restoreDOMBreakpoints):
+ (WebInspector.BreakpointManager.prototype._saveBreakpoints):
+ (WebInspector.DOMBreakpoint.prototype._enable):
+ (WebInspector.DOMBreakpoint.prototype._disable):
+ (WebInspector.EventListenerBreakpoint.prototype._enable):
+ (WebInspector.EventListenerBreakpoint.prototype._disable):
+ (WebInspector.XHRBreakpoint.prototype._enable):
+ (WebInspector.XHRBreakpoint.prototype._disable):
+ * inspector/front-end/CSSStyleModel.js:
+ (WebInspector.CSSStyleModel.prototype.getStylesAsync):
+ (WebInspector.CSSStyleModel.prototype.getComputedStyleAsync):
+ (WebInspector.CSSStyleModel.prototype.getInlineStyleAsync):
+ (WebInspector.CSSStyleModel.prototype.setRuleSelector.callback):
+ (WebInspector.CSSStyleModel.prototype.setRuleSelector):
+ (WebInspector.CSSStyleModel.prototype.addRule.callback):
+ (WebInspector.CSSStyleModel.prototype.addRule):
+ (WebInspector.CSSStyleModel.prototype._styleSheetChanged):
+ (WebInspector.CSSStyleModel.prototype._onRevert):
+ (WebInspector.CSSStyleDeclaration.prototype.insertPropertyAt):
+ (WebInspector.CSSProperty.prototype.setText):
+ (WebInspector.CSSProperty.prototype.setDisabled):
+ (WebInspector.CSSStyleSheet.createForId):
+ (WebInspector.CSSStyleSheet.prototype.setText):
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.requestClearMessages):
+ (WebInspector.ConsoleView.prototype.completions):
+ (WebInspector.ConsoleView.prototype._handleContextMenuEvent.itemAction):
+ (WebInspector.ConsoleView.prototype._handleContextMenuEvent):
+ (WebInspector.ConsoleView.prototype.evalInInspectedWindow):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView.prototype._deleteCookie):
+ * inspector/front-end/DOMAgent.js:
+ (WebInspector.DOMAgent.prototype.getChildNodesAsync):
+ (WebInspector.DOMAgent.prototype.setAttributeAsync):
+ (WebInspector.DOMAgent.prototype.removeAttributeAsync):
+ (WebInspector.DOMAgent.prototype.setTextNodeValueAsync):
+ (WebInspector.ApplicationCacheDispatcher.getApplicationCachesAsync):
+ (WebInspector.Cookies.getCookiesAsync):
+ (WebInspector.EventListeners.getEventListenersForNodeAsync):
+ * inspector/front-end/DOMStorage.js:
+ (WebInspector.DOMStorage.prototype.getEntries):
+ (WebInspector.DOMStorage.prototype.setItem):
+ (WebInspector.DOMStorage.prototype.removeItem):
+ * inspector/front-end/Database.js:
+ (WebInspector.Database.prototype.getTableNames):
+ (WebInspector.Database.prototype.executeSql):
+ * inspector/front-end/DebuggerModel.js:
+ (WebInspector.DebuggerModel.prototype.enableDebugger):
+ (WebInspector.DebuggerModel.prototype.disableDebugger):
+ (WebInspector.DebuggerModel.prototype.continueToLocation):
+ (WebInspector.DebuggerModel.prototype.setBreakpoint):
+ (WebInspector.DebuggerModel.prototype.setBreakpointBySourceId):
+ (WebInspector.DebuggerModel.prototype.removeBreakpoint):
+ (WebInspector.DebuggerModel.prototype.editScriptSource):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged):
+ (WebInspector.ElementsPanel):
+ (WebInspector.ElementsPanel.prototype.setDocument):
+ (WebInspector.ElementsPanel.prototype.searchCanceled):
+ (WebInspector.ElementsPanel.prototype.performSearch):
+ (WebInspector.ElementsPanel.prototype.handleCopyEvent):
+ (WebInspector.ElementsPanel.prototype.setSearchingForNode):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype._createTooltipForNode):
+ (WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted):
+ ():
+ * inspector/front-end/ExtensionPanel.js:
+ (WebInspector.ExtensionWatchSidebarPane.prototype.setExpression):
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onAddRequestHeaders):
+ (WebInspector.ExtensionServer.prototype._onReload):
+ (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage):
+ * inspector/front-end/HeapSnapshotView.js:
+ (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
+ * inspector/front-end/NetworkManager.js:
+ (WebInspector.NetworkManager):
+ (WebInspector.NetworkManager.prototype.reset):
+ (WebInspector.NetworkManager.prototype.requestContent):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkDataGridNode.prototype._openInNewTab):
+ * inspector/front-end/ProfileView.js:
+ (WebInspector.CPUProfileView):
+ (WebInspector.CPUProfileType.prototype.buttonClicked):
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfilesPanel.prototype._clearProfiles):
+ (WebInspector.ProfilesPanel.prototype._removeProfileHeader):
+ (WebInspector.ProfilesPanel.prototype.loadHeapSnapshot):
+ (WebInspector.ProfilesPanel.prototype._toggleProfiling):
+ (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
+ * inspector/front-end/PropertiesSidebarPane.js:
+ (WebInspector.PropertiesSidebarPane.prototype.update):
+ * inspector/front-end/RemoteObject.js:
+ (WebInspector.RemoteObject.resolveNode):
+ (WebInspector.RemoteObject.prototype.getProperties):
+ (WebInspector.RemoteObject.prototype.setPropertyValue):
+ (WebInspector.RemoteObject.prototype.pushNodeToFrontend):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.FrameTreeElement.prototype.onselect):
+ (WebInspector.FrameTreeElement.prototype.set hovered):
+ (WebInspector.FrameResourceTreeElement.prototype.ondblclick):
+ * inspector/front-end/Script.js:
+ (WebInspector.Script.prototype.requestSource):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame):
+ (WebInspector.ScriptsPanel.prototype._setPauseOnExceptions):
+ (WebInspector.ScriptsPanel.prototype._togglePause):
+ (WebInspector.ScriptsPanel.prototype._stepOverClicked):
+ (WebInspector.ScriptsPanel.prototype._stepIntoClicked):
+ (WebInspector.ScriptsPanel.prototype._stepOutClicked):
+ (WebInspector.ScriptsPanel.prototype.toggleBreakpointsClicked):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame.prototype._hidePopup):
+ * inspector/front-end/TestController.js:
+ (WebInspector.TestController.prototype.notifyDone):
+ * inspector/front-end/TimelinePanel.js:
+ (WebInspector.TimelinePanel.prototype._toggleTimelineButtonClicked):
+ * inspector/front-end/WatchExpressionsSidebarPane.js:
+ (WebInspector.WatchExpressionsSection.prototype.update):
+ * inspector/front-end/WorkersSidebarPane.js:
+ (WebInspector.WorkersSidebarPane.prototype.setInstrumentation):
+ * inspector/front-end/inspector.js:
+ (WebInspector.highlightDOMNode):
+ (WebInspector.doLoadedDone):
+ (WebInspector.openResource):
+ (WebInspector.documentKeyDown):
+
2011-02-16 Mario Sanchez Prada <msanchez@igalia.com>
Reviewed by Martin Robinson.
_registerDelegate: function(commandInfo)
{
var commandObject = JSON.parse(commandInfo);
- this[commandObject.command] = this.sendMessageToBackend.bind(this, commandInfo);
+ var agentName = commandObject.domain + "Agent";
+ if (!window[agentName])
+ window[agentName] = {};
+ window[agentName][commandObject.command] = this.sendMessageToBackend.bind(this, commandInfo);
},
sendMessageToBackend: function()
for (var key in request.arguments) {
if (args.length === 0) {
- console.error("Protocol Error: Invalid number of arguments for 'InspectorBackend.%s' call. It should have the next arguments '%s'.", request.command, JSON.stringify(request.arguments));
+ console.error("Protocol Error: Invalid number of arguments for '%sAgent.%s' call. It should have the next arguments '%s'.", request.domain, request.command, JSON.stringify(request.arguments));
return;
}
var value = args.shift();
if (request.arguments[key] && typeof value !== request.arguments[key]) {
- console.error("Protocol Error: Invalid type of argument '%s' for 'InspectorBackend.%s' call. It should be '%s' but it is '%s'.", key, request.command, request.arguments[key], typeof value);
+ console.error("Protocol Error: Invalid type of argument '%s' for '%sAgent.%s' call. It should be '%s' but it is '%s'.", key, request.domain, request.command, request.arguments[key], typeof value);
return;
}
request.arguments[key] = value;
if (args.length === 1) {
if (typeof args[0] !== "function" && typeof args[0] !== "undefined") {
- console.error("Protocol Error: Optional callback argument for 'InspectorBackend.%s' call should be a function but its type is '%s'.", request.command, typeof args[0]);
+ console.error("Protocol Error: Optional callback argument for '%sAgent.%s' call should be a function but its type is '%s'.", request.domain, request.command, typeof args[0]);
return;
}
request.seq = this._wrap(args[0]);
WebInspector.AuditRules.evaluateInTargetWindow = function(func, args, callback)
{
- InspectorBackend.evaluateOnSelf(func.toString(), args, callback);
+ InjectedScriptAgent.evaluateOnSelf(func.toString(), args, callback);
}
WebInspector.CSSStyleSheet.createForId(styleSheetIds[i], styleSheetCallback.bind(null, styleSheets, i == styleSheetIds.length - 1 ? evalCallback : null));
}
- InspectorBackend.getAllStyles(allStylesCallback);
+ CSSAgent.getAllStyles(allStylesCallback);
}
}
_reloadResources: function(callback)
{
this._pageReloadCallback = callback;
- InspectorBackend.reloadPage(false);
+ InspectorAgent.reloadPage(false);
},
_didMainResourceLoad: function()
}
if (!this._breakpointsPushedToFrontend) {
- InspectorBackend.setAllBrowserBreakpoints(this._stickyBreakpoints);
+ BrowserDebuggerAgent.setAllBrowserBreakpoints(this._stickyBreakpoints);
this._breakpointsPushedToFrontend = true;
}
},
continue;
pathToNodeId[path] = 0;
pendingCalls += 1;
- InspectorBackend.pushNodeByPathToFrontend(path, didPushNodeByPathToFrontend.bind(this, path));
+ DOMAgent.pushNodeByPathToFrontend(path, didPushNodeByPathToFrontend.bind(this, path));
}
if (!pendingCalls)
this._domBreakpointsRestored = true;
WebInspector.settings.nativeBreakpoints = breakpoints;
this._stickyBreakpoints[WebInspector.settings.projectId] = breakpoints;
- InspectorBackend.setAllBrowserBreakpoints(this._stickyBreakpoints);
+ BrowserDebuggerAgent.setAllBrowserBreakpoints(this._stickyBreakpoints);
},
_validateBreakpoints: function(persistentBreakpoints)
WebInspector.DOMBreakpoint.prototype = {
_enable: function()
{
- InspectorBackend.setDOMBreakpoint(this._nodeId, this._type);
+ BrowserDebuggerAgent.setDOMBreakpoint(this._nodeId, this._type);
},
_disable: function()
{
- InspectorBackend.removeDOMBreakpoint(this._nodeId, this._type);
+ BrowserDebuggerAgent.removeDOMBreakpoint(this._nodeId, this._type);
},
_serializeToJSON: function()
WebInspector.EventListenerBreakpoint.prototype = {
_enable: function()
{
- InspectorBackend.setEventListenerBreakpoint(this._eventName);
+ BrowserDebuggerAgent.setEventListenerBreakpoint(this._eventName);
},
_disable: function()
{
- InspectorBackend.removeEventListenerBreakpoint(this._eventName);
+ BrowserDebuggerAgent.removeEventListenerBreakpoint(this._eventName);
},
_serializeToJSON: function()
WebInspector.XHRBreakpoint.prototype = {
_enable: function()
{
- InspectorBackend.setXHRBreakpoint(this._url);
+ BrowserDebuggerAgent.setXHRBreakpoint(this._url);
},
_disable: function()
{
- InspectorBackend.removeXHRBreakpoint(this._url);
+ BrowserDebuggerAgent.removeXHRBreakpoint(this._url);
},
_serializeToJSON: function()
userCallback(result);
}
- InspectorBackend.getStylesForNode(nodeId, callback.bind(null, userCallback));
+ CSSAgent.getStylesForNode(nodeId, callback.bind(null, userCallback));
},
getComputedStyleAsync: function(nodeId, userCallback)
userCallback(WebInspector.CSSStyleDeclaration.parsePayload(stylePayload));
}
- InspectorBackend.getComputedStyleForNode(nodeId, callback.bind(null, userCallback));
+ CSSAgent.getComputedStyleForNode(nodeId, callback.bind(null, userCallback));
},
getInlineStyleAsync: function(nodeId, userCallback)
userCallback(WebInspector.CSSStyleDeclaration.parsePayload(stylePayload));
}
- InspectorBackend.getInlineStyleForNode(nodeId, callback.bind(null, userCallback));
+ CSSAgent.getInlineStyleForNode(nodeId, callback.bind(null, userCallback));
},
setRuleSelector: function(ruleId, nodeId, newSelector, successCallback, failureCallback)
if (!rulePayload)
failureCallback();
else
- InspectorBackend.querySelectorAll(nodeId, newSelector, checkAffectsCallback.bind(this, nodeId, successCallback, rulePayload));
+ CSSAgent.querySelectorAll(nodeId, newSelector, checkAffectsCallback.bind(this, nodeId, successCallback, rulePayload));
}
- InspectorBackend.setRuleSelector(ruleId, newSelector, callback.bind(this, nodeId, successCallback, failureCallback));
+ CSSAgent.setRuleSelector(ruleId, newSelector, callback.bind(this, nodeId, successCallback, failureCallback));
},
addRule: function(nodeId, selector, successCallback, failureCallback)
// Invalid syntax for a selector
failureCallback();
} else
- InspectorBackend.querySelectorAll(nodeId, selector, checkAffectsCallback.bind(this, nodeId, successCallback, rulePayload));
+ CSSAgent.querySelectorAll(nodeId, selector, checkAffectsCallback.bind(this, nodeId, successCallback, rulePayload));
}
- InspectorBackend.addRule(nodeId, selector, callback.bind(this, successCallback, failureCallback, selector));
+ CSSAgent.addRule(nodeId, selector, callback.bind(this, successCallback, failureCallback, selector));
},
_styleSheetChanged: function(styleSheetId, majorChange)
if (resource && resource.type === WebInspector.Resource.Type.Stylesheet)
resource.setContent(content, this._onRevert.bind(this, styleSheetId));
}
- InspectorBackend.getStyleSheetText(styleSheetId, callback.bind(this));
+ CSSAgent.getStyleSheetText(styleSheetId, callback.bind(this));
},
_onRevert: function(styleSheetId, contentToRevertTo)
this._styleSheetChanged(styleSheetId, true);
this.dispatchEventToListeners("stylesheet changed");
}
- InspectorBackend.setStyleSheetText(styleSheetId, contentToRevertTo, callback.bind(this));
+ CSSAgent.setStyleSheetText(styleSheetId, contentToRevertTo, callback.bind(this));
}
}
}
}
- InspectorBackend.setPropertyText(this.id, index, name + ": " + value + ";", false, callback.bind(null, userCallback));
+ CSSAgent.setPropertyText(this.id, index, name + ": " + value + ";", false, callback.bind(null, userCallback));
},
appendProperty: function(name, value, userCallback)
throw "No ownerStyle for property";
// An index past all the properties adds a new property to the style.
- InspectorBackend.setPropertyText(this.ownerStyle.id, this.index, propertyText, this.index < this.ownerStyle.pastLastSourcePropertyIndex(), callback.bind(this));
+ CSSAgent.setPropertyText(this.ownerStyle.id, this.index, propertyText, this.index < this.ownerStyle.pastLastSourcePropertyIndex(), callback.bind(this));
},
setValue: function(newValue, userCallback)
}
}
- InspectorBackend.toggleProperty(this.ownerStyle.id, this.index, disabled, callback.bind(this));
+ CSSAgent.toggleProperty(this.ownerStyle.id, this.index, disabled, callback.bind(this));
}
}
else
userCallback(new WebInspector.CSSStyleSheet(styleSheetPayload));
}
- InspectorBackend.getStyleSheet(styleSheetId, callback.bind(this));
+ CSSAgent.getStyleSheet(styleSheetId, callback.bind(this));
}
WebInspector.CSSStyleSheet.prototype = {
}
}
- InspectorBackend.setStyleSheetText(this.id, newText, callback.bind(this));
+ CSSAgent.setStyleSheetText(this.id, newText, callback.bind(this));
}
}
requestClearMessages: function()
{
- InspectorBackend.clearConsoleMessages();
+ ConsoleAgent.clearConsoleMessages();
},
clearMessages: function()
var includeCommandLineAPI = (!dotNotation && !bracketNotation);
var injectedScriptAccess;
if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused)
- InspectorBackend.getCompletionsOnCallFrame(WebInspector.panels.scripts.selectedCallFrameId(), expressionString, includeCommandLineAPI, reportCompletions);
+ DebuggerAgent.getCompletionsOnCallFrame(WebInspector.panels.scripts.selectedCallFrameId(), expressionString, includeCommandLineAPI, reportCompletions);
else
- InspectorBackend.getCompletions(expressionString, includeCommandLineAPI, reportCompletions);
+ RuntimeAgent.getCompletions(expressionString, includeCommandLineAPI, reportCompletions);
},
_reportCompletions: function(bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix, result, isException) {
var itemAction = function () {
WebInspector.settings.monitoringXHREnabled = !WebInspector.settings.monitoringXHREnabled;
- InspectorBackend.setMonitoringXHREnabled(WebInspector.settings.monitoringXHREnabled);
+ ConsoleAgent.setMonitoringXHREnabled(WebInspector.settings.monitoringXHREnabled);
}.bind(this);
var contextMenu = new WebInspector.ContextMenu();
contextMenu.appendCheckboxItem(WebInspector.UIString("XMLHttpRequest logging"), itemAction, WebInspector.settings.monitoringXHREnabled)
{
callback(WebInspector.RemoteObject.fromPayload(result));
}
- InspectorBackend.evaluate(expression, objectGroup, includeCommandLineAPI, evalCallback);
+ RuntimeAgent.evaluate(expression, objectGroup, includeCommandLineAPI, evalCallback);
},
_enterKeyPressed: function(event)
_deleteCookie: function(cookie)
{
- InspectorBackend.deleteCookie(cookie.name, this._cookieDomain);
+ InspectorAgent.deleteCookie(cookie.name, this._cookieDomain);
this._update();
},
function mycallback() {
callback(parent.children);
}
- InspectorBackend.getChildNodes(parent.id, mycallback);
+ DOMAgent.getChildNodes(parent.id, mycallback);
},
setAttributeAsync: function(node, name, value, callback)
{
var mycallback = this._didApplyDomChange.bind(this, node, callback);
- InspectorBackend.setAttribute(node.id, name, value, mycallback);
+ DOMAgent.setAttribute(node.id, name, value, mycallback);
},
removeAttributeAsync: function(node, name, callback)
{
var mycallback = this._didApplyDomChange.bind(this, node, callback);
- InspectorBackend.removeAttribute(node.id, name, mycallback);
+ DOMAgent.removeAttribute(node.id, name, mycallback);
},
setTextNodeValueAsync: function(node, text, callback)
{
var mycallback = this._didApplyDomChange.bind(this, node, callback);
- InspectorBackend.setTextNodeValue(node.id, text, mycallback);
+ DOMAgent.setTextNodeValue(node.id, text, mycallback);
},
_didApplyDomChange: function(node, callback, success)
callback(applicationCaches);
}
- InspectorBackend.getApplicationCaches(mycallback);
+ ApplicationCacheAgent.getApplicationCaches(mycallback);
}
WebInspector.ApplicationCacheDispatcher.prototype = {
callback(cookies, true);
}
- InspectorBackend.getCookies(mycallback);
+ InspectorAgent.getCookies(mycallback);
}
WebInspector.Cookies.buildCookiesFromString = function(rawCookieString)
{
if (!node)
return;
- InspectorBackend.getEventListenersForNode(node.id, callback);
+ DOMAgent.getEventListenersForNode(node.id, callback);
}
getEntries: function(callback)
{
- InspectorBackend.getDOMStorageEntries(this._id, callback);
+ DOMStorageAgent.getDOMStorageEntries(this._id, callback);
},
setItem: function(key, value, callback)
{
- InspectorBackend.setDOMStorageItem(this._id, key, value, callback);
+ DOMStorageAgent.setDOMStorageItem(this._id, key, value, callback);
},
removeItem: function(key, callback)
{
- InspectorBackend.removeDOMStorageItem(this._id, key, callback);
+ DOMStorageAgent.removeDOMStorageItem(this._id, key, callback);
}
}
{
callback(names.sort());
}
- InspectorBackend.getDatabaseTableNames(this._id, sortingCallback);
+ DatabaseAgent.getDatabaseTableNames(this._id, sortingCallback);
},
executeSql: function(query, onSuccess, onError)
}
WebInspector.DatabaseDispatcher._callbacks[transactionId] = {"onSuccess": onSuccess, "onError": onError};
}
- InspectorBackend.executeSQL(this._id, query, callback);
+ DatabaseAgent.executeSQL(this._id, query, callback);
}
}
WebInspector.DebuggerModel.prototype = {
enableDebugger: function()
{
- InspectorBackend.enableDebugger();
+ InspectorAgent.enableDebugger();
if (this._breakpointsPushedToBackend)
return;
var breakpoints = WebInspector.settings.breakpoints;
disableDebugger: function()
{
- InspectorBackend.disableDebugger();
+ InspectorAgent.disableDebugger();
},
continueToLocation: function(sourceID, lineNumber, columnNumber)
{
- InspectorBackend.continueToLocation(sourceID, lineNumber, columnNumber);
+ DebuggerAgent.continueToLocation(sourceID, lineNumber, columnNumber);
},
setBreakpoint: function(url, lineNumber, columnNumber, condition, enabled)
this._saveBreakpoints();
this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointAdded, breakpoint);
}
- InspectorBackend.setJavaScriptBreakpoint(url, lineNumber, columnNumber, condition, enabled, didSetBreakpoint.bind(this, this._breakpointsPushedToBackend));
+ DebuggerAgent.setJavaScriptBreakpoint(url, lineNumber, columnNumber, condition, enabled, didSetBreakpoint.bind(this, this._breakpointsPushedToBackend));
},
setBreakpointBySourceId: function(sourceID, lineNumber, columnNumber, condition, enabled)
this._breakpoints[breakpointId] = breakpoint;
this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointAdded, breakpoint);
}
- InspectorBackend.setJavaScriptBreakpointBySourceId(sourceID, lineNumber, columnNumber, condition, enabled, didSetBreakpoint.bind(this));
+ DebuggerAgent.setJavaScriptBreakpointBySourceId(sourceID, lineNumber, columnNumber, condition, enabled, didSetBreakpoint.bind(this));
},
removeBreakpoint: function(breakpointId)
{
- InspectorBackend.removeJavaScriptBreakpoint(breakpointId);
+ DebuggerAgent.removeJavaScriptBreakpoint(breakpointId);
var breakpoint = this._breakpoints[breakpointId];
delete this._breakpoints[breakpointId];
this._saveBreakpoints();
} else
WebInspector.log(newBodyOrErrorMessage, WebInspector.ConsoleMessage.MessageLevel.Warning);
}
- InspectorBackend.editScriptSource(sourceID, scriptSource, didEditScriptSource.bind(this));
+ DebuggerAgent.editScriptSource(sourceID, scriptSource, didEditScriptSource.bind(this));
},
_updateScriptSource: function(sourceID, scriptSource)
this.panel.updateEventListeners();
if (this._focusedDOMNode) {
- InspectorBackend.addInspectedNode(this._focusedDOMNode.id);
+ DOMAgent.addInspectedNode(this._focusedDOMNode.id);
WebInspector.extensionServer.notifyObjectSelected(this.panel.name);
}
};
}
if (this._selectedPathOnReset)
- InspectorBackend.pushNodeByPathToFrontend(this._selectedPathOnReset, selectLastSelectedNode.bind(this));
+ DOMAgent.pushNodeByPathToFrontend(this._selectedPathOnReset, selectLastSelectedNode.bind(this));
else
selectNode.call(this);
delete this._selectedPathOnReset;
this._currentSearchResultIndex = 0;
this._searchResults = [];
- InspectorBackend.searchCanceled();
+ DOMAgent.searchCanceled();
},
performSearch: function(query)
this._matchesCountUpdateTimeout = null;
this._searchQuery = query;
- InspectorBackend.performSearch(whitespaceTrimmedQuery, false);
+ DOMAgent.performSearch(whitespaceTrimmedQuery, false);
},
populateHrefContextMenu: function(contextMenu, event, anchorElement)
return;
event.clipboardData.clearData();
event.preventDefault();
- InspectorBackend.copyNode(this.focusedDOMNode.id);
+ DOMAgent.copyNode(this.focusedDOMNode.id);
},
rightSidebarResizerDragStart: function(event)
setSearchingForNode: function(enabled)
{
- InspectorBackend.setSearchingForNode(enabled, this._setSearchingForNode.bind(this));
+ InspectorAgent.setSearchingForNode(enabled, this._setSearchingForNode.bind(this));
},
toggleSearchingForNode: function()
else
this.tooltip = WebInspector.UIString("%d Ă— %d pixels (Natural: %d Ă— %d pixels)", properties.offsetWidth, properties.offsetHeight, properties.naturalWidth, properties.naturalHeight);
}
- InspectorBackend.getNodeProperties(node.id, ["naturalHeight", "naturalWidth", "offsetHeight", "offsetWidth"], setTooltip.bind(this));
+ DOMAgent.getNodeProperties(node.id, ["naturalHeight", "naturalWidth", "offsetHeight", "offsetWidth"], setTooltip.bind(this));
},
updateSelection: function()
moveToNextAttributeIfNeeded.call(newTreeItem);
}
- InspectorBackend.changeTagName(this.representedObject.id, newText, changeTagNameCallback);
+ DOMAgent.changeTagName(this.representedObject.id, newText, changeTagNameCallback);
},
_textNodeEditingCommitted: function(element, newText)
parentElement.adjustCollapsedRange(true);
}
- InspectorBackend.removeNode(this.representedObject.id, removeNodeCallback);
+ DOMAgent.removeNode(this.representedObject.id, removeNodeCallback);
},
_editAsHTML: function()
function commitChange(value)
{
- InspectorBackend.setOuterHTML(node.id, value, selectNode);
+ DOMAgent.setOuterHTML(node.id, value, selectNode);
}
- InspectorBackend.getOuterHTML(node.id, this._startEditingAsHTML.bind(this, commitChange));
+ DOMAgent.getOuterHTML(node.id, this._startEditingAsHTML.bind(this, commitChange));
},
_copyHTML: function()
{
- InspectorBackend.copyNode(this.representedObject.id);
+ DOMAgent.copyNode(this.representedObject.id);
},
_highlightSearchResults: function()
setExpression: function(expression, title)
{
- InspectorBackend.evaluate(expression, "extension-watch", false, this._onEvaluate.bind(this, title));
+ RuntimeAgent.evaluate(expression, "extension-watch", false, this._onEvaluate.bind(this, title));
},
_onEvaluate: function(title, result)
allHeaders[name] = headers[name];
}
}
- InspectorBackend.setExtraHeaders(allHeaders);
+ NetworkAgent.setExtraHeaders(allHeaders);
},
_onCreatePanel: function(message, port)
_onReload: function(message)
{
if (typeof message.userAgent === "string")
- InspectorBackend.setUserAgentOverride(message.userAgent);
+ InspectorAgent.setUserAgentOverride(message.userAgent);
- InspectorBackend.reloadPage(false);
+ InspectorAgent.reloadPage(false);
return this._status.OK();
},
this._dispatchCallback(message.requestId, port, result);
}
var evalExpression = "JSON.stringify(eval(unescape('" + escape(message.expression) + "')));";
- InspectorBackend.evaluate(evalExpression, "none", true, callback.bind(this));
+ RuntimeAgent.evaluate(evalExpression, "none", true, callback.bind(this));
},
_onRevealAndSelect: function(message)
buttonClicked: function()
{
- InspectorBackend.takeHeapSnapshot(false);
+ ProfilerAgent.takeHeapSnapshot(false);
},
get welcomeMessage()
WebInspector.Object.call(this);
this._resourceTreeModel = resourceTreeModel;
this._dispatcher = new WebInspector.NetworkDispatcher(resourceTreeModel, this);
- InspectorBackend.cachedResources(this._processCachedResources.bind(this));
+ NetworkAgent.cachedResources(this._processCachedResources.bind(this));
}
WebInspector.NetworkManager.EventTypes = {
{
WebInspector.panels.network.clear();
this._resourceTreeModel.reset();
- InspectorBackend.cachedResources(this._processCachedResources.bind(this));
+ NetworkAgent.cachedResources(this._processCachedResources.bind(this));
},
requestContent: function(resource, base64Encode, callback)
{
callback(success ? content : null);
}
- InspectorBackend.resourceContent(resource.loader.frameId, resource.url, base64Encode, callbackWrapper);
+ NetworkAgent.resourceContent(resource.loader.frameId, resource.url, base64Encode, callbackWrapper);
},
_processCachedResources: function(mainFramePayload)
_openInNewTab: function()
{
- InspectorBackend.openInInspectedWindow(this._resource.url);
+ InspectorAgent.openInInspectedWindow(this._resource.url);
},
get selectable()
self._updatePercentButton();
}
- InspectorBackend.getProfile(this.profile.typeId, this.profile.uid, profileCallback);
+ ProfilerAgent.getProfile(this.profile.typeId, this.profile.uid, profileCallback);
}
WebInspector.CPUProfileView.prototype = {
this._recording = !this._recording;
if (this._recording)
- InspectorBackend.startProfiling();
+ InspectorAgent.startProfiling();
else
- InspectorBackend.stopProfiling();
+ InspectorAgent.stopProfiling();
},
get welcomeMessage()
_clearProfiles: function()
{
- InspectorBackend.clearProfiles();
+ ProfilerAgent.clearProfiles();
this._reset();
},
sidebarParent.removeChild(profile._profilesTreeElement);
if (!profile.isTemporary)
- InspectorBackend.removeProfile(profile.typeId, profile.uid);
+ ProfilerAgent.removeProfile(profile.typeId, profile.uid);
// No other item will be selected if there aren't any other profiles, so
// make sure that view gets cleared when the last profile is removed.
profile._callbacks = [callback];
profile._json = "";
profile.sideBarElement.subtitle = WebInspector.UIString("Loading…");
- InspectorBackend.getProfile(profile.typeId, profile.uid);
+ ProfilerAgent.getProfile(profile.typeId, profile.uid);
}
},
{
if (this._profilerEnabled) {
WebInspector.settings.profilerEnabled = false;
- InspectorBackend.disableProfiler(true);
+ InspectorAgent.disableProfiler(true);
} else {
WebInspector.settings.profilerEnabled = !!optionalAlways;
- InspectorBackend.enableProfiler();
+ InspectorAgent.enableProfiler();
}
},
this._addProfileHeader(profileHeaders[i]);
}
- InspectorBackend.getProfileHeaders(populateCallback.bind(this));
+ ProfilerAgent.getProfileHeaders(populateCallback.bind(this));
this._profilesWereRequested = true;
},
}
this._addProfileHeader(this._temporaryTakingSnapshot);
}
- InspectorBackend.takeHeapSnapshot(detailed);
+ ProfilerAgent.takeHeapSnapshot(detailed);
},
_reportHeapSnapshotProgress: function(done, total)
body.appendChild(section.element);
}
}
- InspectorBackend.getNodePrototypes(node.id, callback.bind(this));
+ DOMAgent.getNodePrototypes(node.id, callback.bind(this));
}
}
{
callback(object ? WebInspector.RemoteObject.fromPayload(object) : null);
}
- InspectorBackend.resolveNode(node.id, mycallback);
+ DOMAgent.resolveNode(node.id, mycallback);
}
WebInspector.RemoteObject.fromPayload = function(payload)
properties[i].value = WebInspector.RemoteObject.fromPayload(properties[i].value);
callback(properties);
}
- InspectorBackend.getProperties(this._objectId, !!ignoreHasOwnProperty, abbreviate, remoteObjectBinder);
+ RuntimeAgent.getProperties(this._objectId, !!ignoreHasOwnProperty, abbreviate, remoteObjectBinder);
},
setPropertyValue: function(name, value, callback)
callback(false);
return;
}
- InspectorBackend.setPropertyValue(this._objectId, name, value, callback);
+ RuntimeAgent.setPropertyValue(this._objectId, name, value, callback);
},
pushNodeToFrontend: function(callback)
{
- InspectorBackend.pushNodeToFrontend(this._objectId, callback);
+ DOMAgent.pushNodeToFrontend(this._objectId, callback);
}
}
this._storagePanel.showCategoryView(this._displayName);
this.listItemElement.removeStyleClass("hovered");
- InspectorBackend.hideFrameHighlight();
+ InspectorAgent.hideFrameHighlight();
},
get displayName()
{
if (hovered) {
this.listItemElement.addStyleClass("hovered");
- InspectorBackend.highlightFrame(this._frameId);
+ InspectorAgent.highlightFrame(this._frameId);
} else {
this.listItemElement.removeStyleClass("hovered");
- InspectorBackend.hideFrameHighlight();
+ InspectorAgent.hideFrameHighlight();
}
}
}
ondblclick: function(event)
{
- InspectorBackend.openInInspectedWindow(this._resource.url);
+ InspectorAgent.openInInspectedWindow(this._resource.url);
},
onattach: function()
this._source = source;
callback(this._source);
}
- InspectorBackend.getScriptSource(this.sourceID, didGetScriptSource.bind(this));
+ DebuggerAgent.getScriptSource(this.sourceID, didGetScriptSource.bind(this));
}
}
this.sidebarPanes.scopechain.update(selectedCallFrame);
}
}
- InspectorBackend.evaluateOnCallFrame(selectedCallFrame.id, code, objectGroup, includeCommandLineAPI, updatingCallbackWrapper.bind(this));
+ DebuggerAgent.evaluateOnCallFrame(selectedCallFrame.id, code, objectGroup, includeCommandLineAPI, updatingCallbackWrapper.bind(this));
},
_debuggerPaused: function(event)
this._pauseOnExceptionButton.state = pauseOnExceptionsState;
WebInspector.settings.pauseOnExceptionState = pauseOnExceptionsState;
}
- InspectorBackend.setPauseOnExceptionsState(pauseOnExceptionsState, callback.bind(this));
+ DebuggerAgent.setPauseOnExceptionsState(pauseOnExceptionsState, callback.bind(this));
},
_updateDebuggerButtons: function()
if (this._paused) {
this._paused = false;
this._waitingToPause = false;
- InspectorBackend.resume();
+ DebuggerAgent.resume();
} else {
this._stepping = false;
this._waitingToPause = true;
- InspectorBackend.pause();
+ DebuggerAgent.pause();
}
this._clearInterface();
this._clearInterface();
- InspectorBackend.stepOver();
+ DebuggerAgent.stepOver();
},
_stepIntoClicked: function()
this._clearInterface();
- InspectorBackend.stepInto();
+ DebuggerAgent.stepInto();
},
_stepOutClicked: function()
this._clearInterface();
- InspectorBackend.stepOut();
+ DebuggerAgent.stepOut();
},
toggleBreakpointsClicked: function()
{
this.toggleBreakpointsButton.toggled = !this.toggleBreakpointsButton.toggled;
if (this.toggleBreakpointsButton.toggled) {
- InspectorBackend.activateBreakpoints();
+ DebuggerAgent.activateBreakpoints();
this.toggleBreakpointsButton.title = WebInspector.UIString("Deactivate all breakpoints.");
document.getElementById("main-panels").removeStyleClass("breakpoints-deactivated");
} else {
- InspectorBackend.deactivateBreakpoints();
+ DebuggerAgent.deactivateBreakpoints();
this.toggleBreakpointsButton.title = WebInspector.UIString("Activate all breakpoints.");
document.getElementById("main-panels").addStyleClass("breakpoints-deactivated");
}
this._popup.hide();
delete this._popup;
- InspectorBackend.releaseWrapperObjectGroup(0, this._popoverObjectGroup);
+ RuntimeAgent.releaseWrapperObjectGroup(0, this._popoverObjectGroup);
},
_mouseHover: function(element)
if (typeof result === "undefined" && this.results.length)
result = this.results;
var message = typeof result === "undefined" ? "\"<undefined>\"" : JSON.stringify(result);
- InspectorBackend.didEvaluateForTestInFrontend(this._callId, message);
+ InspectorAgent.didEvaluateForTestInFrontend(this._callId, message);
},
runAfterPendingDispatches: function(callback)
_toggleTimelineButtonClicked: function()
{
if (this.toggleTimelineButton.toggled)
- InspectorBackend.stopTimelineProfiler();
+ InspectorAgent.stopTimelineProfiler();
else {
this._clearPanel();
- InspectorBackend.startTimelineProfiler();
+ InspectorAgent.startTimelineProfiler();
}
},
}
// TODO: pass exact injected script id.
- InspectorBackend.releaseWrapperObjectGroup(0, this._watchObjectGroupId)
+ RuntimeAgent.releaseWrapperObjectGroup(0, this._watchObjectGroupId)
var properties = [];
// Count the properties, so we known when to call this.updateProperties()
setInstrumentation: function(enabled)
{
- InspectorBackend.removeAllScriptsToEvaluateOnLoad();
+ InspectorAgent.removeAllScriptsToEvaluateOnLoad();
if (enabled)
- InspectorBackend.addScriptToEvaluateOnLoad("(" + InjectedFakeWorker + ")");
+ InspectorAgent.addScriptToEvaluateOnLoad("(" + InjectedFakeWorker + ")");
},
reset: function()
this._highlightedDOMNodeId = nodeId;
if (nodeId)
- InspectorBackend.highlightDOMNode(nodeId);
+ InspectorAgent.highlightDOMNode(nodeId);
else
- InspectorBackend.hideDOMNodeHighlight();
+ InspectorAgent.hideDOMNodeHighlight();
},
highlightDOMNodeForTwoSeconds: function(nodeId)
if (!WebInspector.currentPanel)
WebInspector.showPanel(WebInspector.settings.lastActivePanel);
}
- InspectorBackend.populateScriptObjects(onPopulateScriptObjects);
+ InspectorAgent.populateScriptObjects(onPopulateScriptObjects);
if (Preferences.debuggerAlwaysEnabled || WebInspector.settings.debuggerEnabled)
this.debuggerModel.enableDebugger();
if (Preferences.profilerAlwaysEnabled || WebInspector.settings.profilerEnabled)
- InspectorBackend.enableProfiler();
+ InspectorAgent.enableProfiler();
if (WebInspector.settings.monitoringXHREnabled)
- InspectorBackend.setMonitoringXHREnabled(true);
+ ConsoleAgent.setMonitoringXHREnabled(true);
- InspectorBackend.setConsoleMessagesEnabled(true);
+ ConsoleAgent.setConsoleMessagesEnabled(true);
function propertyNamesCallback(names)
{
WebInspector.cssNameCompletions = new WebInspector.CSSCompletions(names);
}
// As a DOMAgent method, this needs to happen after the frontend has loaded and the agent is available.
- InspectorBackend.getSupportedCSSProperties(propertyNamesCallback);
+ CSSAgent.getSupportedCSSProperties(propertyNamesCallback);
}
WebInspector.addPanelToolbarIcon = function(toolbarElement, panel, previousToolbarItem)
WebInspector.panels.resources.showResource(resource);
WebInspector.showPanel("resources");
} else
- InspectorBackend.openInInspectedWindow(resource ? resource.url : resourceURL);
+ InspectorAgent.openInInspectedWindow(resource ? resource.url : resourceURL);
}
WebInspector._registerShortcuts = function()
case "U+0052": // R key
if ((event.metaKey && isMac) || (event.ctrlKey && !isMac)) {
- InspectorBackend.reloadPage(event.shiftKey);
+ InspectorAgent.reloadPage(event.shiftKey);
event.preventDefault();
}
break;
case "F5":
if (!isMac)
- InspectorBackend.reloadPage(event.ctrlKey || event.shiftKey);
+ InspectorAgent.reloadPage(event.ctrlKey || event.shiftKey);
break;
}
}