Commit e681cf4c authored by loislo@chromium.org's avatar loislo@chromium.org
Browse files

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  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: http://svn.webkit.org/repository/webkit/trunk@78717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bc1dcdf2
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.
......@@ -33,7 +33,7 @@ function test()
{
InspectorTest.evaluateInPage("makeRequests()", step2);
}
InspectorBackend.setMonitoringXHREnabled(true, callback);
ConsoleAgent.setMonitoringXHREnabled(true, callback);
}
function step2()
......@@ -42,7 +42,7 @@ function test()
{
InspectorTest.evaluateInPage("makeRequests()", step3);
}
InspectorBackend.setMonitoringXHREnabled(false, callback);
ConsoleAgent.setMonitoringXHREnabled(false, callback);
}
function step3()
......
......@@ -34,7 +34,7 @@ InspectorTest.dispatchOnMessage = function(messageId, callback, recurring)
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") :
......
......@@ -5,7 +5,7 @@ var resultsSynchronized = false;
InspectorTest.completeTest = function()
{
InspectorBackend.didEvaluateForTestInFrontend(InspectorTest.completeTestCallId, "");
InspectorAgent.didEvaluateForTestInFrontend(InspectorTest.completeTestCallId, "");
}
InspectorTest.evaluateInConsole = function(code, callback)
......@@ -40,7 +40,7 @@ InspectorTest.evaluateInPage = 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)
......@@ -109,7 +109,7 @@ InspectorTest.reloadPage = function(callback)
if (WebInspector.panels.network)
WebInspector.panels.network._reset();
InspectorBackend.reloadPage(false);
InspectorAgent.reloadPage(false);
}
InspectorTest.pageReloaded = function()
......
......@@ -12,7 +12,7 @@ function doit()
function test()
{
InspectorBackend.evaluate("window", "console", false, evalCallback);
RuntimeAgent.evaluate("window", "console", false, evalCallback);
function evalCallback(result)
{
......
......@@ -12,7 +12,7 @@ function test()
function startDebuggerTestCallback()
{
InspectorBackend.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
DebuggerAgent.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
InspectorTest.showScriptSource("debugger-autocontinue-on-syntax-error.html", reloadInspectedPage);
}
......
......@@ -20,7 +20,7 @@ var test = function()
function step1()
{
InspectorBackend.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
DebuggerAgent.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
InspectorTest.showScriptSource("debugger-pause-on-exception.html", step2);
}
......
......@@ -25,26 +25,26 @@ function test()
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'
......@@ -11,11 +11,11 @@ function test()
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": {}}');
......
......@@ -35,7 +35,7 @@ function test()
InspectorFrontendHost.sendMessageToBackend(messages[i]);
}
InspectorBackend.disableDebugger(fire);
InspectorAgent.disableDebugger(fire);
}
</script>
......
......@@ -47,7 +47,7 @@ function test()
function nodeCallback(node)
{
InspectorBackend.getStylesForNode(node.id, callback);
CSSAgent.getStylesForNode(node.id, callback);
}
InspectorTest.selectNodeWithId("mainBody", nodeCallback);
}
......@@ -67,7 +67,7 @@ function test()
function nodeCallback(node)
{
InspectorBackend.getStylesForNode(node.id, callback);
CSSAgent.getStylesForNode(node.id, callback);
}
InspectorTest.nodeWithId("thetable", nodeCallback);
}
......@@ -87,7 +87,7 @@ function test()
{
InspectorTest.addResult("");
InspectorTest.addResult("=== Last stylesheet patched ===");
InspectorBackend.setStyleSheetText(styleSheet.styleSheetId, newStyleSheetText,
CSSAgent.setStyleSheetText(styleSheet.styleSheetId, newStyleSheetText,
loadAndDumpStyleSheet.bind(null, styleSheet.styleSheetId, test_changeSelector));
}
......@@ -98,7 +98,7 @@ function test()
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)
......@@ -110,7 +110,7 @@ function test()
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)
......@@ -122,12 +122,12 @@ function test()
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()
......@@ -142,15 +142,15 @@ function test()
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()
......@@ -175,13 +175,13 @@ function test()
// 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;
......@@ -193,12 +193,12 @@ function test()
// 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);
}
......@@ -213,8 +213,8 @@ function test()
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
......@@ -258,7 +258,7 @@ function test()
continuation(styleSheet);
}
InspectorBackend.getStyleSheet(styleSheetId, styleSheetLoaded);
CSSAgent.getStyleSheet(styleSheetId, styleSheetLoaded);
}
}
......
......@@ -37,7 +37,7 @@ function test()
function step1(node)
{
InspectorBackend.getStylesForNode(node.id, step2);
CSSAgent.getStylesForNode(node.id, step2);
}
function step2(styles)
......
......@@ -18,7 +18,7 @@ function test()
var resourceId;
var scriptUrl = "timeline-network-resource.js";
InspectorBackend.startTimelineProfiler(step1);
InspectorAgent.startTimelineProfiler(step1);
function step1()
{
......@@ -28,7 +28,7 @@ function test()
function step2()
{
InspectorBackend.stopTimelineProfiler(step3);
InspectorAgent.stopTimelineProfiler(step3);
}
function step3()
......
......@@ -13,7 +13,7 @@ function performActions()
function test()
{
InspectorBackend.startTimelineProfiler(step1);
InspectorAgent.startTimelineProfiler(step1);
function step1()
{
InspectorTest.evaluateInPage("performActions()");
......@@ -22,7 +22,7 @@ function test()
function step2()
{
InspectorBackend.stopTimelineProfiler(step3);
InspectorAgent.stopTimelineProfiler(step3);
}
function step3()
......
......@@ -13,7 +13,7 @@ function performActions()
function test()
{
InspectorBackend.startTimelineProfiler(step1);
InspectorAgent.startTimelineProfiler(step1);
function step1()
{
InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
......@@ -22,7 +22,7 @@ function test()
function step2()
{
InspectorBackend.stopTimelineProfiler(step3);
InspectorAgent.stopTimelineProfiler(step3);
}
function step3()
......
......@@ -17,7 +17,7 @@ InspectorTest.timelineNonDeterministicProps = {
InspectorTest.performActionsAndPrint = function(actions, typeName)
{
InspectorBackend.startTimelineProfiler(step1);
InspectorAgent.startTimelineProfiler(step1);
function step1()
{
InspectorTest.evaluateInPage(actions, step2);
......@@ -25,7 +25,7 @@ InspectorTest.performActionsAndPrint = function(actions, typeName)
function step2()
{
InspectorBackend.stopTimelineProfiler(step3);
InspectorAgent.stopTimelineProfiler(step3);
}
function step3()
......
......@@ -10,7 +10,7 @@ function test() {
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.
......@@ -623,7 +623,10 @@ InspectorBackendStub.prototype = {
_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()
......@@ -633,12 +636,12 @@ InspectorBackendStub.prototype = {