Changeset 93769 in webkit
- Timestamp:
- Aug 25, 2011 3:01:27 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 63 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r93765 r93769 1 2011-08-24 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: split ConsoleView into the View and the Model. 4 https://bugs.webkit.org/show_bug.cgi?id=66861 5 6 Reviewed by Yury Semikhatsky. 7 8 * http/tests/inspector/change-iframe-src.html: 9 * http/tests/inspector/console-cd-completions.html: 10 * http/tests/inspector/console-cd.html: 11 * http/tests/inspector/console-resource-errors.html: 12 * http/tests/inspector/console-test.js: 13 (initialize_ConsoleTest.InspectorTest.dumpConsoleMessages): 14 (initialize_ConsoleTest.InspectorTest.dumpConsoleMessagesWithClasses): 15 (initialize_ConsoleTest.InspectorTest.expandConsoleMessages): 16 (initialize_ConsoleTest): 17 * http/tests/inspector/inspector-test.js: 18 (initialize_InspectorTest.InspectorTest.evaluateInConsole): 19 (initialize_InspectorTest): 20 * http/tests/inspector/network/disabled-cache-crash.html: 21 * http/tests/inspector/network/network-cachedresources-with-same-urls.html: 22 * http/tests/inspector/network/network-clear-cache.html-disabled: 23 * http/tests/inspector/network/network-clear-cookies.html-disabled: 24 * http/tests/inspector/network/network-content-replacement-embed.html: 25 * http/tests/inspector/network/network-content-replacement-xhr.html: 26 * http/tests/inspector/network/network-disable-cache-memory.html: 27 * http/tests/inspector/network/network-disable-cache-xhrs.html: 28 * http/tests/inspector/network/network-embed.html: 29 * http/tests/inspector/network/network-iframe-load-and-delete.html: 30 * http/tests/inspector/network/network-initiator-from-console.html: 31 * http/tests/inspector/network/network-initiator.html: 32 * http/tests/inspector/network/network-request-revision-content.html: 33 * http/tests/inspector/network/network-shared-worker.html: 34 * http/tests/inspector/network/network-sidebar-width.html: 35 * http/tests/inspector/network/network-size-chunked.html: 36 * http/tests/inspector/network/network-size-sync.html: 37 * http/tests/inspector/network/network-size.html: 38 * http/tests/inspector/network/network-timing.html: 39 * http/tests/inspector/network/network-worker.html: 40 * http/tests/inspector/network/network-xhr-async.html: 41 * http/tests/inspector/network/network-xhr-sync.html: 42 * http/tests/inspector/resource-tree/resource-tree-frame-add.html: 43 * http/tests/inspector/resource-tree/resource-tree-frame-navigate.html: 44 * http/tests/inspector/resource-tree/resource-tree-no-xhrs.html: 45 * inspector/console/console-assert.html: 46 * inspector/console/console-trace-in-eval.html: 47 * inspector/console/console-trace.html: 48 * inspector/console/console-uncaught-exception.html: 49 * inspector/debugger/debugger-autocontinue-on-syntax-error.html: 50 * inspector/debugger/debugger-completions-on-call-frame.html: 51 * inspector/styles/styles-iframe.html: 52 * inspector/timeline/timeline-network-resource.html: 53 * inspector/timeline/timeline-script-tag-1.html: 54 * inspector/timeline/timeline-script-tag-2.html: 55 1 56 2011-08-25 Pavel Podivilov <podivilov@chromium.org> 2 57 -
trunk/LayoutTests/http/tests/inspector/change-iframe-src.html
r86672 r93769 22 22 { 23 23 node.setAttribute("src", "src=\"http://localhost:8000/inspector/resources/iframe-from-different-domain-data.html\""); 24 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);24 InspectorTest.addConsoleSniffer(step2); 25 25 } 26 26 -
trunk/LayoutTests/http/tests/inspector/console-cd-completions.html
r92122 r93769 8 8 { 9 9 InspectorTest.showConsolePanel(); 10 var selector = WebInspector.console ._contextSelectElement;10 var selector = WebInspector.consoleView._contextSelectElement; 11 11 var option = selector.firstChild; 12 12 while (option) { … … 23 23 24 24 25 WebInspector.console ._completions("", "myGlob", false, checkCompletions.bind(this));25 WebInspector.consoleView._completions("", "myGlob", false, checkCompletions.bind(this)); 26 26 function checkCompletions(completions) 27 27 { -
trunk/LayoutTests/http/tests/inspector/console-cd.html
r91839 r93769 9 9 { 10 10 InspectorTest.showConsolePanel(); 11 var selector = WebInspector.console ._contextSelectElement;11 var selector = WebInspector.consoleView._contextSelectElement; 12 12 var option = selector.firstChild; 13 13 while (option) { -
trunk/LayoutTests/http/tests/inspector/console-resource-errors.html
r86672 r93769 28 28 function test() 29 29 { 30 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",addMessage, true);30 InspectorTest.addConsoleSniffer(addMessage, true); 31 31 32 32 var messageCount = 0; -
trunk/LayoutTests/http/tests/inspector/console-test.js
r91839 r93769 10 10 { 11 11 var result = []; 12 var messages = WebInspector.console .messages;12 var messages = WebInspector.consoleView.messages; 13 13 for (var i = 0; i < messages.length; ++i) { 14 14 var element = messages[i].toMessageElement(); … … 20 20 InspectorTest.dumpConsoleMessagesWithClasses = function(sortMessages) { 21 21 var result = []; 22 var messages = WebInspector.console .messages;22 var messages = WebInspector.consoleView.messages; 23 23 for (var i = 0; i < messages.length; ++i) { 24 24 var element = messages[i].toMessageElement(); … … 33 33 InspectorTest.expandConsoleMessages = function() 34 34 { 35 var messages = WebInspector.console .messages;35 var messages = WebInspector.consoleView.messages; 36 36 for (var i = 0; i < messages.length; ++i) { 37 37 var element = messages[i].toMessageElement(); -
trunk/LayoutTests/http/tests/inspector/inspector-test.js
r91567 r93769 30 30 callback = InspectorTest.safeWrap(callback); 31 31 32 WebInspector.console .visible = true;33 WebInspector.console .prompt.text = code;32 WebInspector.consoleView.visible = true; 33 WebInspector.consoleView.prompt.text = code; 34 34 var event = document.createEvent("KeyboardEvent"); 35 35 event.initKeyboardEvent("keydown", true, true, null, "Enter", ""); 36 WebInspector.console .promptElement.dispatchEvent(event);37 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",36 WebInspector.consoleView.promptElement.dispatchEvent(event); 37 InspectorTest.addConsoleSniffer( 38 38 function(commandResult) { 39 39 callback(commandResult.toMessageElement().textContent); … … 316 316 } 317 317 318 InspectorTest.addConsoleSniffer = function(override, opt_sticky) 319 { 320 InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "_appendConsoleMessage", override, opt_sticky); 321 } 322 318 323 InspectorTest.override = function(receiver, methodName, override, opt_sticky) 319 324 { -
trunk/LayoutTests/http/tests/inspector/network/disabled-cache-crash.html
r92143 r93769 38 38 function step1(msg) 39 39 { 40 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);40 InspectorTest.addConsoleSniffer(step2); 41 41 InspectorTest.evaluateInPage("openWindow1()"); 42 42 } … … 44 44 function step2(msg) 45 45 { 46 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step3);46 InspectorTest.addConsoleSniffer(step3); 47 47 InspectorTest.evaluateInPage("openWindow2()"); 48 48 } -
trunk/LayoutTests/http/tests/inspector/network/network-cachedresources-with-same-urls.html
r89349 r93769 26 26 function test() 27 27 { 28 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2, true);28 InspectorTest.addConsoleSniffer(step2, true); 29 29 InspectorTest.evaluateInPage("loadImages()"); 30 30 -
trunk/LayoutTests/http/tests/inspector/network/network-clear-cache.html-disabled
r90557 r93769 37 37 function step1() 38 38 { 39 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);39 InspectorTest.addConsoleSniffer(step2); 40 40 InspectorTest.evaluateInPage("loadData()"); 41 41 } … … 51 51 function step3(msg) 52 52 { 53 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step4);53 InspectorTest.addConsoleSniffer(step4); 54 54 InspectorTest.evaluateInPage("cacheCleared()"); 55 55 } -
trunk/LayoutTests/http/tests/inspector/network/network-clear-cookies.html-disabled
r90557 r93769 37 37 function step1() 38 38 { 39 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);39 InspectorTest.addConsoleSniffer(step2); 40 40 InspectorTest.evaluateInPage("loadData()"); 41 41 } … … 51 51 function step3(msg) 52 52 { 53 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step4);53 InspectorTest.addConsoleSniffer(step4); 54 54 InspectorTest.evaluateInPage("cookiesCleared()"); 55 55 } -
trunk/LayoutTests/http/tests/inspector/network/network-content-replacement-embed.html
r90389 r93769 63 63 function test() 64 64 { 65 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step1);65 InspectorTest.addConsoleSniffer(step1); 66 66 InspectorTest.evaluateInPage("onSnifferInstalled()"); 67 67 -
trunk/LayoutTests/http/tests/inspector/network/network-content-replacement-xhr.html
r90389 r93769 42 42 function test() 43 43 { 44 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step1);44 InspectorTest.addConsoleSniffer(step1); 45 45 InspectorTest.evaluateInPage("loadData()"); 46 46 -
trunk/LayoutTests/http/tests/inspector/network/network-disable-cache-memory.html
r91858 r93769 23 23 function loadScriptAndGetContent(callback) 24 24 { 25 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",scriptLoaded);25 InspectorTest.addConsoleSniffer(scriptLoaded); 26 26 InspectorTest.evaluateInPage("scheduleScriptLoad()"); 27 27 -
trunk/LayoutTests/http/tests/inspector/network/network-disable-cache-xhrs.html
r91408 r93769 42 42 function step1() 43 43 { 44 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);44 InspectorTest.addConsoleSniffer(step2); 45 45 InspectorTest.evaluateInPage("loadData()"); 46 46 } … … 53 53 function step3(msg) 54 54 { 55 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step4);55 InspectorTest.addConsoleSniffer(step4); 56 56 InspectorTest.evaluateInPage("cacheDisabled()"); 57 57 } -
trunk/LayoutTests/http/tests/inspector/network/network-embed.html
r90640 r93769 67 67 function step1() 68 68 { 69 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);69 InspectorTest.addConsoleSniffer(step2); 70 70 InspectorTest.evaluateInPage("onSnifferInstalled()"); 71 71 } -
trunk/LayoutTests/http/tests/inspector/network/network-iframe-load-and-delete.html
r89163 r93769 39 39 function test() 40 40 { 41 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);41 InspectorTest.addConsoleSniffer(step2); 42 42 InspectorTest.evaluateInPage("loadIframe()"); 43 43 -
trunk/LayoutTests/http/tests/inspector/network/network-initiator-from-console.html
r92194 r93769 19 19 function step1() 20 20 { 21 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);21 InspectorTest.addConsoleSniffer(step2); 22 22 WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceStarted, onResource); 23 23 var str = ""; … … 25 25 str += "s.src = \"resources/script.js\";"; 26 26 str += "document.head.appendChild(s);"; 27 WebInspector.console .evalInInspectedWindow(str, "console", true, undefined, undefined, function(){})27 WebInspector.consoleView.evalInInspectedWindow(str, "console", true, undefined, undefined, function(){}) 28 28 } 29 29 -
trunk/LayoutTests/http/tests/inspector/network/network-initiator.html
r92213 r93769 66 66 return; 67 67 68 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step3);68 InspectorTest.addConsoleSniffer(step3); 69 69 InspectorTest.evaluateInPage("loadData()"); 70 70 } -
trunk/LayoutTests/http/tests/inspector/network/network-request-revision-content.html
r90022 r93769 12 12 function test() 13 13 { 14 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2, true);14 InspectorTest.addConsoleSniffer(step2, true); 15 15 InspectorTest.evaluateInPage("loadScript()"); 16 16 -
trunk/LayoutTests/http/tests/inspector/network/network-shared-worker.html
r92781 r93769 23 23 function step1() 24 24 { 25 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);25 InspectorTest.addConsoleSniffer(step2); 26 26 InspectorTest.evaluateInPage("loadData()"); 27 27 } -
trunk/LayoutTests/http/tests/inspector/network/network-sidebar-width.html
r92114 r93769 16 16 function test() 17 17 { 18 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);18 InspectorTest.addConsoleSniffer(step2); 19 19 InspectorTest.evaluateInPage("loadData()"); 20 20 -
trunk/LayoutTests/http/tests/inspector/network/network-size-chunked.html
r86672 r93769 18 18 function test() 19 19 { 20 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);20 InspectorTest.addConsoleSniffer(step2); 21 21 InspectorTest.evaluateInPage("loadImages()"); 22 22 -
trunk/LayoutTests/http/tests/inspector/network/network-size-sync.html
r88480 r93769 16 16 function test() 17 17 { 18 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);18 InspectorTest.addConsoleSniffer(step2); 19 19 InspectorTest.evaluateInPage("loadData()"); 20 20 -
trunk/LayoutTests/http/tests/inspector/network/network-size.html
r90010 r93769 26 26 function test() 27 27 { 28 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);28 InspectorTest.addConsoleSniffer(step2); 29 29 InspectorTest.evaluateInPage("loadImages()"); 30 30 -
trunk/LayoutTests/http/tests/inspector/network/network-timing.html
r90745 r93769 25 25 function test() 26 26 { 27 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);27 InspectorTest.addConsoleSniffer(step2); 28 28 InspectorTest.evaluateInPage("loadScripts()"); 29 29 -
trunk/LayoutTests/http/tests/inspector/network/network-worker.html
r92781 r93769 23 23 function step1() 24 24 { 25 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);25 InspectorTest.addConsoleSniffer(step2); 26 26 InspectorTest.evaluateInPage("loadData()"); 27 27 } -
trunk/LayoutTests/http/tests/inspector/network/network-xhr-async.html
r90557 r93769 22 22 function step1() 23 23 { 24 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);24 InspectorTest.addConsoleSniffer(step2); 25 25 InspectorTest.evaluateInPage("loadData()"); 26 26 } -
trunk/LayoutTests/http/tests/inspector/network/network-xhr-sync.html
r90557 r93769 22 22 function step1() 23 23 { 24 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);24 InspectorTest.addConsoleSniffer(step2); 25 25 InspectorTest.evaluateInPage("loadData()"); 26 26 } -
trunk/LayoutTests/http/tests/inspector/protocol-test.js
r81570 r93769 102 102 var domainMessagesHandler = InspectorBackend._domainDispatchers[domain]; 103 103 for (var eventName in domainMessagesHandler) { 104 if (typeof domainMessagesHandler[eventName] !== "function") 105 continue; 104 106 this._agentCoverage[eventName] = "not checked"; 105 107 domainMessagesHandler[eventName] = InspectorTest._dumpEvent.bind(domainMessagesHandler, eventName, domainMessagesHandler[eventName]); -
trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-add.html
r86672 r93769 31 31 InspectorTest.addResult("===================================="); 32 32 InspectorTest.dumpResourceTreeEverything(); 33 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);33 InspectorTest.addConsoleSniffer(step2); 34 34 InspectorTest.evaluateInPage("createIframe()"); 35 35 } -
trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-navigate.html
r86672 r93769 32 32 InspectorTest.addResult("===================================="); 33 33 InspectorTest.dumpResourceTreeEverything(); 34 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);34 InspectorTest.addConsoleSniffer(step2); 35 35 InspectorTest.evaluateInPage("navigateIframe()"); 36 36 } -
trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-no-xhrs.html
r92698 r93769 16 16 function test() 17 17 { 18 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);18 InspectorTest.addConsoleSniffer(step2); 19 19 InspectorTest.evaluateInPage("sendXHR()"); 20 20 -
trunk/LayoutTests/inspector/console/console-assert.html
r86672 r93769 28 28 } 29 29 InspectorTest.evaluateInPage("setTimeout(a, 0)"); 30 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",callback, true);30 InspectorTest.addConsoleSniffer(callback, true); 31 31 } 32 32 -
trunk/LayoutTests/inspector/console/console-trace-in-eval.html
r86672 r93769 36 36 } 37 37 InspectorTest.evaluateInPage("doEvalSource()"); 38 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",callback);38 InspectorTest.addConsoleSniffer(callback); 39 39 } 40 40 -
trunk/LayoutTests/inspector/console/console-trace.html
r86672 r93769 23 23 } 24 24 InspectorTest.evaluateInPage("setTimeout(a, 0)"); 25 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",callback);25 InspectorTest.addConsoleSniffer(callback); 26 26 } 27 27 -
trunk/LayoutTests/inspector/console/console-uncaught-exception.html
r86672 r93769 7 7 function test() 8 8 { 9 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",addMessage, true);9 InspectorTest.addConsoleSniffer(addMessage, true); 10 10 InspectorTest.evaluateInPage("loadIframe()"); 11 11 function addMessage(message) -
trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html
r86672 r93769 20 20 { 21 21 DebuggerAgent.setPauseOnExceptions(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions); 22 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);22 InspectorTest.addConsoleSniffer(step2); 23 23 InspectorTest.evaluateInPage("loadIframe()"); 24 24 } -
trunk/LayoutTests/inspector/debugger/debugger-completions-on-call-frame.html
r92768 r93769 24 24 function step2() 25 25 { 26 WebInspector.console ._completions("", "var", false, checkAgainstGolden.bind(this, [ "var1", "var2" ], [], step3));26 WebInspector.consoleView._completions("", "var", false, checkAgainstGolden.bind(this, [ "var1", "var2" ], [], step3)); 27 27 } 28 28 29 29 function step3() 30 30 { 31 WebInspector.console ._completions("", "di", false, checkAgainstGolden.bind(this, [ "dir", "dirxml" ], [], step4));31 WebInspector.consoleView._completions("", "di", false, checkAgainstGolden.bind(this, [ "dir", "dirxml" ], [], step4)); 32 32 } 33 33 34 34 function step4() 35 35 { 36 WebInspector.console ._completions("", "win", false, checkAgainstGolden.bind(this, [ "window" ], [], step5));36 WebInspector.consoleView._completions("", "win", false, checkAgainstGolden.bind(this, [ "window" ], [], step5)); 37 37 } 38 38 39 39 function step5() 40 40 { 41 WebInspector.console ._completions("", "t", false, checkAgainstGolden.bind(this, [ "this" ], [], step6));41 WebInspector.consoleView._completions("", "t", false, checkAgainstGolden.bind(this, [ "this" ], [], step6)); 42 42 } 43 43 44 44 function step6() 45 45 { 46 WebInspector.console ._completions("var1", "toExp", false, checkAgainstGolden.bind(this, [ "toExponential" ], [], step7));46 WebInspector.consoleView._completions("var1", "toExp", false, checkAgainstGolden.bind(this, [ "toExponential" ], [], step7)); 47 47 } 48 48 49 49 function step7() 50 50 { 51 WebInspector.console ._completions("123", "toExp", false, checkAgainstGolden.bind(this, [], [ "toExponential" ], step8));51 WebInspector.consoleView._completions("123", "toExp", false, checkAgainstGolden.bind(this, [], [ "toExponential" ], step8)); 52 52 } 53 53 -
trunk/LayoutTests/inspector/styles/styles-iframe.html
r89804 r93769 20 20 { 21 21 InspectorTest.evaluateInPage("loadIframe()"); 22 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step0);22 InspectorTest.addConsoleSniffer(step0); 23 23 24 24 function step0() -
trunk/LayoutTests/inspector/timeline/timeline-network-resource.html
r92953 r93769 24 24 { 25 25 InspectorTest.evaluateInPage("performActions()"); 26 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);26 InspectorTest.addConsoleSniffer(step2); 27 27 } 28 28 -
trunk/LayoutTests/inspector/timeline/timeline-script-tag-1.html
r86672 r93769 17 17 function step1() 18 18 { 19 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);19 InspectorTest.addConsoleSniffer(step2); 20 20 InspectorTest.evaluateInPage("performActions()"); 21 21 } -
trunk/LayoutTests/inspector/timeline/timeline-script-tag-2.html
r86672 r93769 17 17 function step1() 18 18 { 19 InspectorTest.add Sniffer(WebInspector.ConsoleView.prototype, "addMessage",step2);19 InspectorTest.addConsoleSniffer(step2); 20 20 InspectorTest.evaluateInPage("performActions()"); 21 21 } -
trunk/Source/WebCore/ChangeLog
r93768 r93769 1 2011-08-24 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: split ConsoleView into the View and the Model. 4 https://bugs.webkit.org/show_bug.cgi?id=66861 5 6 Reviewed by Yury Semikhatsky. 7 8 * WebCore.gypi: 9 * WebCore.vcproj/WebCore.vcproj: 10 * inspector/compile-front-end.sh: 11 * inspector/front-end/BreakpointManager.js: 12 * inspector/front-end/ConsoleMessage.js: 13 (WebInspector.ConsoleMessage.prototype._format): 14 * inspector/front-end/ConsoleModel.js: Added. 15 (WebInspector.ConsoleModel): 16 (WebInspector.ConsoleModel.prototype._setConsoleMessageExpiredCount): 17 (WebInspector.ConsoleModel.prototype.addMessage): 18 (WebInspector.ConsoleModel.prototype._incrementErrorWarningCount): 19 (WebInspector.ConsoleModel.prototype.requestClearMessages): 20 (WebInspector.ConsoleModel.prototype.clearMessages): 21 (WebInspector.ConsoleDispatcher): 22 (WebInspector.ConsoleDispatcher.prototype.messageAdded): 23 (WebInspector.ConsoleDispatcher.prototype.messageRepeatCountUpdated): 24 * inspector/front-end/ConsolePanel.js: 25 (WebInspector.ConsolePanel): 26 (WebInspector.ConsolePanel.prototype.performSearch): 27 * inspector/front-end/ConsoleView.js: 28 (WebInspector.ConsoleView): 29 (WebInspector.ConsoleView.prototype._consoleMessageAdded): 30 (WebInspector.ConsoleView.prototype._appendConsoleCommand): 31 (WebInspector.ConsoleView.prototype._appendConsoleCommandResult): 32 (WebInspector.ConsoleView.prototype._appendConsoleMessage): 33 (WebInspector.ConsoleView.prototype._consoleCleared): 34 (WebInspector.ConsoleView.prototype._registerShortcuts): 35 (WebInspector.ConsoleView.prototype._requestClearMessages): 36 * inspector/front-end/DebuggerModel.js: 37 * inspector/front-end/DebuggerPresentationModel.js: 38 (WebInspector.DebuggerPresentationModel): 39 (WebInspector.DebuggerPresentationModel.prototype.addSourceMappingListener): 40 (WebInspector.DebuggerPresentationModel.prototype.removeSourceMappingListener): 41 * inspector/front-end/NetworkLog.js: Copied from Source/WebCore/inspector/front-end/externs.js. 42 (WebInspector.NetworkLog): 43 (WebInspector.NetworkLog.prototype.get resources): 44 (WebInspector.NetworkLog.prototype._frameNavigated): 45 (WebInspector.NetworkLog.prototype._onResourceStarted): 46 * inspector/front-end/NetworkManager.js: 47 (WebInspector.NetworkDispatcher.prototype._updateResourceWithResponse): 48 (WebInspector.NetworkDispatcher.prototype._mimeTypeIsConsistentWithType): 49 * inspector/front-end/Resource.js: 50 (WebInspector.Resource.prototype.set finished): 51 * inspector/front-end/ResourceTreeModel.js: 52 (WebInspector.ResourceTreeModel): 53 * inspector/front-end/SourceFile.js: 54 (WebInspector.RawSourceCode.prototype._scriptForRawLocation): 55 (WebInspector.ScriptContentProvider.prototype.requestContent): 56 (WebInspector.ConcatenatedScriptsContentProvider.prototype._concatenateScriptsContent.appendChunk): 57 (WebInspector.ConcatenatedScriptsContentProvider.prototype._concatenateScriptsContent): 58 * inspector/front-end/UISourceCode.js: 59 (WebInspector.ContentProvider): 60 (WebInspector.ContentProvider.prototype.requestContent): 61 * inspector/front-end/WatchExpressionsSidebarPane.js: 62 (WebInspector.WatchExpressionsSection.prototype.update): 63 * inspector/front-end/WebKit.qrc: 64 * inspector/front-end/externs.js: 65 (WebInspector.linkifyURLAsNode): 66 (WebInspector.formatLinkText): 67 * inspector/front-end/inspector.html: 68 * inspector/front-end/inspector.js: 69 (WebInspector._createGlobalStatusBarItems): 70 (WebInspector._updateErrorAndWarningCounts): 71 (WebInspector.showConsole): 72 1 73 2011-08-24 Alexander Pavlov <apavlov@chromium.org> 2 74 -
trunk/Source/WebCore/WebCore.gypi
r93764 r93769 6294 6294 'inspector/front-end/Color.js', 6295 6295 'inspector/front-end/ConsoleMessage.js', 6296 'inspector/front-end/ConsoleModel.js', 6296 6297 'inspector/front-end/ConsolePanel.js', 6297 6298 'inspector/front-end/ConsoleView.js', … … 6346 6347 'inspector/front-end/NetworkItemView.js', 6347 6348 'inspector/front-end/NetworkManager.js', 6349 'inspector/front-end/NetworkLog.js', 6348 6350 'inspector/front-end/NetworkPanel.js', 6349 6351 'inspector/front-end/Object.js', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r93713 r93769 68774 68774 </File> 68775 68775 <File 68776 RelativePath="..\inspector\front-end\ConsoleModel.js" 68777 > 68778 </File> 68779 <File 68776 68780 RelativePath="..\inspector\front-end\ConsoleView.js" 68777 68781 > … … 69015 69019 <File 69016 69020 RelativePath="..\inspector\front-end\NetworkManager.js" 69021 > 69022 </File> 69023 <File 69024 RelativePath="..\inspector\front-end\NetworkLog.js" 69017 69025 > 69018 69026 </File> -
trunk/Source/WebCore/inspector/compile-front-end.sh
r93706 r93769 35 35 --externs Source/WebCore/inspector/front-end/externs.js \ 36 36 --externs Source/WebCore/inspector/front-end/protocol-externs.js \ 37 --module jsmodule_ core:2 \37 --module jsmodule_util:2 \ 38 38 --js Source/WebCore/inspector/front-end/utilities.js \ 39 39 --js Source/WebCore/inspector/front-end/treeoutline.js \ 40 --module jsmodule_env:3 \ 40 --module jsmodule_host:1 \ 41 --js Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js \ 42 --module jsmodule_common:4:jsmodule_util,jsmodule_host \ 43 --js Source/WebCore/inspector/front-end/BinarySearch.js \ 44 --js Source/WebCore/inspector/front-end/Object.js \ 41 45 --js Source/WebCore/inspector/front-end/Settings.js \ 42 46 --js Source/WebCore/inspector/front-end/UserMetrics.js \ 43 --js Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js \ 44 --module jsmodule_sdk:8:jsmodule_core,jsmodule_env \ 45 --js Source/WebCore/inspector/front-end/BinarySearch.js \ 47 --module jsmodule_sdk:15:jsmodule_common,jsmodule_host \ 48 --js Source/WebCore/inspector/front-end/DebuggerModel.js \ 49 --js Source/WebCore/inspector/front-end/BreakpointManager.js \ 50 --js Source/WebCore/inspector/front-end/ConsoleMessage.js \ 51 --js Source/WebCore/inspector/front-end/ConsoleModel.js \ 52 --js Source/WebCore/inspector/front-end/DebuggerPresentationModel.js \ 46 53 --js Source/WebCore/inspector/front-end/CookieParser.js \ 47 54 --js Source/WebCore/inspector/front-end/DOMAgent.js \ 48 --js Source/WebCore/inspector/front-end/DebuggerModel.js \ 49 --js Source/WebCore/inspector/front-end/Object.js \ 55 --js Source/WebCore/inspector/front-end/NetworkManager.js \ 50 56 --js Source/WebCore/inspector/front-end/Script.js \ 57 --js Source/WebCore/inspector/front-end/ScriptFormatter.js \ 58 --js Source/WebCore/inspector/front-end/SourceFile.js \ 51 59 --js Source/WebCore/inspector/front-end/RemoteObject.js \ 60 --js Source/WebCore/inspector/front-end/Resource.js \ 52 61 --js Source/WebCore/inspector/front-end/ResourceCategory.js \ 62 --js Source/WebCore/inspector/front-end/UISourceCode.js \ 53 63 --module jsmodule_misc:10:jsmodule_sdk \ 54 64 --js Source/WebCore/inspector/front-end/Checkbox.js \ -
trunk/Source/WebCore/inspector/front-end/BreakpointManager.js
r93706 r93769 236 236 } 237 237 238 /** 239 * @constructor 240 */ 238 241 WebInspector.Breakpoint = function(uiSourceCodeId, lineNumber, condition, enabled, persistent) 239 242 { -
trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js
r93706 r93769 216 216 formattedResult.appendChild(document.createTextNode(parameters[i].description)); 217 217 else 218 formattedResult.appendChild(WebInspector.console ._format(parameters[i]));218 formattedResult.appendChild(WebInspector.consoleView._format(parameters[i])); 219 219 if (i < parameters.length - 1) 220 220 formattedResult.appendChild(document.createTextNode(" ")); … … 230 230 { 231 231 return function(obj) { 232 return WebInspector.console ._format(obj, force);232 return WebInspector.consoleView._format(obj, force); 233 233 }; 234 234 } -
trunk/Source/WebCore/inspector/front-end/ConsolePanel.js
r86539 r93769 30 30 { 31 31 WebInspector.Panel.call(this, "console"); 32 WebInspector.console .addEventListener(WebInspector.ConsoleView.Events.EntryAdded, this._consoleMessageAdded, this);33 WebInspector.console .addEventListener(WebInspector.ConsoleView.Events.ConsoleCleared, this._consoleCleared, this);32 WebInspector.consoleView.addEventListener(WebInspector.ConsoleView.Events.EntryAdded, this._consoleMessageAdded, this); 33 WebInspector.consoleView.addEventListener(WebInspector.ConsoleView.Events.ConsoleCleared, this._consoleCleared, this); 34 34 } 35 35 … … 99 99 100 100 this._searchResults = []; 101 var messages = WebInspector.console .messages;101 var messages = WebInspector.consoleView.messages; 102 102 for (var i = 0; i < messages.length; i++) { 103 103 if (messages[i].matchesRegex(this._searchRegex)) { -
trunk/Source/WebCore/inspector/front-end/ConsoleView.js
r93706 r93769 39 39 this.clearButton = document.getElementById("clear-console-status-bar-item"); 40 40 this.clearButton.title = WebInspector.UIString("Clear console log."); 41 this.clearButton.addEventListener("click", this._ clearButtonClicked.bind(this), false);41 this.clearButton.addEventListener("click", this._requestClearMessages.bind(this), false); 42 42 43 43 this._contextSelectElement = document.getElementById("console-context"); … … 101 101 }; 102 102 103 this._registerConsoleDomainDispatcher();104 105 103 WebInspector.settings.monitoringXHREnabled.addChangeListener(this._monitoringXHREnabledSettingChanged.bind(this)); 104 105 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._consoleMessageAdded, this); 106 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); 106 107 } 107 108 … … 109 110 ConsoleCleared: "console-cleared", 110 111 EntryAdded: "console-entry-added", 111 MessageAdded: "console-message-added"112 112 } 113 113 114 114 WebInspector.ConsoleView.prototype = { 115 _registerConsoleDomainDispatcher: function() {116 var console = this;117 var dispatcher = {118 messageAdded: function(payload)119 {120 var consoleMessage = new WebInspector.ConsoleMessage(121 payload.source,122 payload.type,123 payload.level,124 payload.line,125 payload.url,126 payload.repeatCount,127 payload.text,128 payload.parameters,129 payload.stackTrace,130 payload.networkRequestId ? WebInspector.networkResourceById(payload.networkRequestId) : undefined);131 console.addMessage(consoleMessage);132 },133 134 messageRepeatCountUpdated: function(count)135 {136 var msg = console.previousMessage;137 var prevRepeatCount = msg.totalRepeatCount;138 139 if (!console.commandSincePreviousMessage) {140 msg.repeatDelta = count - prevRepeatCount;141 msg.repeatCount = msg.repeatCount + msg.repeatDelta;142 msg.totalRepeatCount = count;143 msg._updateRepeatCount();144 console._incrementErrorWarningCount(msg);145 console.dispatchEventToListeners(WebInspector.ConsoleView.Events.MessageAdded, msg);146 } else {147 var msgCopy = new WebInspector.ConsoleMessage(msg.source, msg.type, msg.level, msg.line, msg.url, count - prevRepeatCount, msg._messageText, msg._parameters, msg._stackTrace, msg._request);148 msgCopy.totalRepeatCount = count;149 msgCopy._formatMessage();150 console.addMessage(msgCopy);151 }152 },153 154 messagesCleared: function()155 {156 if (!WebInspector.settings.preserveConsoleLog.get())157 console.clearMessages();158 },159 }160 InspectorBackend.registerConsoleDispatcher(dispatcher);161 },162 163 setConsoleMessageExpiredCount: function(count)164 {165 if (count) {166 var message = String.sprintf(WebInspector.UIString("%d console messages are not shown."), count);167 this.addMessage(WebInspector.ConsoleMessage.createTextMessage(message, WebInspector.ConsoleMessage.MessageLevel.Warning));168 }169 },170 171 115 addContext: function(context) 172 116 { … … 311 255 }, 312 256 313 addMessage: function(msg) 257 _consoleMessageAdded: function(event) 258 { 259 this.commandSincePreviousMessage = false; 260 this.previousMessage = event.data; 261 this._appendConsoleMessage(event.data); 262 }, 263 264 _appendConsoleCommand: function(msg) 265 { 266 if (this.previousMessage) 267 this.commandSincePreviousMessage = true; 268 this._appendConsoleMessage(msg); 269 }, 270 271 _appendConsoleCommandResult: function(msg) 272 { 273 this._appendConsoleMessage(msg); 274 }, 275 276 _appendConsoleMessage: function(msg) 314 277 { 315 278 var shouldScrollToLastMessage = this.messagesElement.isScrolledToBottom(); 316 317 if (msg instanceof WebInspector.ConsoleMessage && !(msg instanceof WebInspector.ConsoleCommandResult)) {318 this._incrementErrorWarningCount(msg);319 this.dispatchEventToListeners(WebInspector.ConsoleView.Events.MessageAdded, msg);320 this.commandSincePreviousMessage = false;321 this.previousMessage = msg;322 } else if (msg instanceof WebInspector.ConsoleCommand) {323 if (this.previousMessage) {324 this.commandSincePreviousMessage = true;325 }326 }327 279 328 280 this.messages.push(msg); … … 349 301 }, 350 302 351 _incrementErrorWarningCount: function(msg) 352 { 353 switch (msg.level) { 354 case WebInspector.ConsoleMessage.MessageLevel.Warning: 355 WebInspector.warnings += msg.repeatDelta; 356 break; 357 case WebInspector.ConsoleMessage.MessageLevel.Error: 358 WebInspector.errors += msg.repeatDelta; 359 break; 360 } 361 }, 362 363 requestClearMessages: function() 364 { 365 ConsoleAgent.clearConsoleMessages(); 366 this.clearMessages(); 367 }, 368 369 clearMessages: function() 370 { 371 this.dispatchEventToListeners(WebInspector.ConsoleView.Events.ConsoleCleared); 372 303 _consoleCleared: function() 304 { 373 305 this.messages = []; 374 306 … … 376 308 this.topGroup.messagesElement.removeChildren(); 377 309 378 WebInspector.errors = 0;379 WebInspector.warnings = 0;380 381 310 delete this.commandSincePreviousMessage; 382 311 delete this.previousMessage; 312 313 this.dispatchEventToListeners(WebInspector.ConsoleView.Events.ConsoleCleared); 383 314 }, 384 315 … … 515 446 }, 516 447 517 _clearButtonClicked: function()518 {519 this.requestClearMessages();520 },521 522 448 _handleContextMenuEvent: function(event) 523 449 { … … 546 472 547 473 contextMenu.appendSeparator(); 548 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Clear console" : "Clear Console"), this. requestClearMessages.bind(this));474 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Clear console" : "Clear Console"), this._requestClearMessages.bind(this)); 549 475 contextMenu.show(event); 550 476 }, … … 576 502 var shortcutK = shortcut.makeDescriptor("k", WebInspector.KeyboardShortcut.Modifiers.Meta); 577 503 // This case requires a separate bound function as its isMacOnly property should not be shared among different shortcut handlers. 578 this._shortcuts[shortcutK.key] = this.requestClearMessages.bind(this); 504 var clearConsoleHandler = this._requestClearMessages.bind(this); 505 this._shortcuts[shortcutK.key] = clearConsoleHandler; 579 506 this._shortcuts[shortcutK.key].isMacOnly = true; 580 507 581 var clearConsoleHandler = this.requestClearMessages.bind(this);582 508 var shortcutL = shortcut.makeDescriptor("l", WebInspector.KeyboardShortcut.Modifiers.Ctrl); 583 509 this._shortcuts[shortcutL.key] = clearConsoleHandler; … … 607 533 }, 608 534 535 _requestClearMessages: function() 536 { 537 WebInspector.console.requestClearMessages(); 538 }, 539 609 540 _promptKeyDown: function(event) 610 541 { … … 668 599 669 600 var commandMessage = new WebInspector.ConsoleCommand(str); 670 this.addMessage(commandMessage); 671 672 var self = this; 601 this._appendConsoleCommand(commandMessage); 602 673 603 function printResult(result, wasThrown) 674 604 { … … 676 606 return; 677 607 678 self.prompt.history.push(str);679 self.prompt.historyOffset = 0;680 self.prompt.text = "";681 682 WebInspector.settings.consoleHistory.set( self.prompt.history.slice(-30));683 684 self.addMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, commandMessage));685 } 686 this.evalInInspectedWindow(str, "console", true, undefined, undefined, printResult );608 this.prompt.history.push(str); 609 this.prompt.historyOffset = 0; 610 this.prompt.text = ""; 611 612 WebInspector.settings.consoleHistory.set(this.prompt.history.slice(-30)); 613 614 this._appendConsoleCommandResult(new WebInspector.ConsoleCommandResult(result, wasThrown, commandMessage)); 615 } 616 this.evalInInspectedWindow(str, "console", true, undefined, undefined, printResult.bind(this)); 687 617 688 618 WebInspector.userMetrics.ConsoleEvaluated.record(); -
trunk/Source/WebCore/inspector/front-end/DebuggerModel.js
r93706 r93769 31 31 /** 32 32 * @constructor 33 * @extends {WebInspector.Object} 33 34 */ 34 35 WebInspector.DebuggerModel = function() -
trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
r93706 r93769 52 52 WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.Reset, this._debuggerReset, this); 53 53 54 WebInspector.console.addEventListener(WebInspector.Console View.Events.MessageAdded, this._consoleMessageAdded, this);55 WebInspector.console.addEventListener(WebInspector.Console View.Events.ConsoleCleared, this._consoleCleared, this);54 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._consoleMessageAdded, this); 55 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); 56 56 57 57 new WebInspector.DebuggerPresentationModelResourceBinding(this); … … 114 114 }, 115 115 116 addSourceMappingListener: function(sourceURL, s ourceId, listener)116 addSourceMappingListener: function(sourceURL, scriptId, listener) 117 117 { 118 118 this._sourceMappingListeners.push(listener); 119 119 }, 120 120 121 removeSourceMappingListener: function(sourceURL, s ourceId, listener)121 removeSourceMappingListener: function(sourceURL, scriptId, listener) 122 122 { 123 123 // FIXME: implement this. -
trunk/Source/WebCore/inspector/front-end/NetworkLog.js
r93768 r93769 29 29 */ 30 30 31 var console = {} 32 console.warn = function(message) {} 33 /** @param {string=} message */ 34 console.assert = function(expr, message) {} 31 /** 32 * @constructor 33 */ 34 WebInspector.NetworkLog = function() 35 { 36 this._resources = []; 37 WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceStarted, this._onResourceStarted, this); 38 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, this._frameNavigated, this); 39 } 35 40 36 var WebInspector = {} 37 /** @param {string} url */ 38 WebInspector.linkifyURLAsNode = function(url) {} 39 /** @param {string} url */ 40 WebInspector.linkifyStringAsFragment = function(url) {} 41 WebInspector.NetworkLog.prototype = { 42 get resources() 43 { 44 return this._resources; 45 }, 41 46 42 /** 43 * @param {string} str 44 * @param {...*} varArgs 45 */ 46 WebInspector.UIString = function(str, varArgs) {} 47 var InspectorBackend = {} 47 _frameNavigated: function(event) 48 { 49 if (!event.data.isMainFrame) 50 return; 51 // Preserve resources from the new session. 52 var oldResources = this._resources.splice(0, this._resources.length); 53 for (var i = 0; i < oldResources.length; ++i) { 54 if (oldResources[i].loaderId === event.data.loaderId) 55 this._resources.push(oldResources[i]); 56 } 57 }, 48 58 49 var JSON = {} 50 /** @param {string} str */ 51 JSON.parse = function(str) {} 52 53 /** @param {Object} obj */ 54 /** @return {string} */ 55 JSON.stringify = function(str) {} 56 57 Element.prototype.scrollIntoViewIfNeeded = function() {} 59 _onResourceStarted: function(event) 60 { 61 this._resources.push(event.data); 62 } 63 } -
trunk/Source/WebCore/inspector/front-end/NetworkManager.js
r93706 r93769 31 31 /** 32 32 * @constructor 33 * @extends {WebInspector.Object} 33 34 */ 34 35 WebInspector.NetworkManager = function() … … 125 126 else 126 127 resource.timing = response.timing; 128 129 if (!this._mimeTypeIsConsistentWithType(resource)) { 130 WebInspector.console.addMessage(new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.Other, 131 WebInspector.ConsoleMessage.MessageType.Log, 132 WebInspector.ConsoleMessage.MessageLevel.Warning, 133 -1, 134 this.url, 135 1, 136 WebInspector.UIString("Resource interpreted as %s but transferred with MIME type %s.", WebInspector.Resource.Type.toUIString(this.type), this.mimeType))); 137 } 138 }, 139 140 _mimeTypeIsConsistentWithType: function(resource) 141 { 142 // If status is an error, content is likely to be of an inconsistent type, 143 // as it's going to be an error message. We do not want to emit a warning 144 // for this, though, as this will already be reported as resource loading failure. 145 // Also, if a URL like http://localhost/wiki/load.php?debug=true&lang=en produces text/css and gets reloaded, 146 // it is 304 Not Modified and its guessed mime-type is text/php, which is wrong. 147 // Don't check for mime-types in 304-resources. 148 if (resource.hasErrorStatusCode() || resource.statusCode === 304) 149 return true; 150 151 if (typeof resource.type === "undefined" 152 || resource.type === WebInspector.Resource.Type.Other 153 || resource.type === WebInspector.Resource.Type.XHR 154 || resource.type === WebInspector.Resource.Type.WebSocket) 155 return true; 156 157 if (!resource.mimeType) 158 return true; // Might be not known for cached resources with null responses. 159 160 if (resource.mimeType in WebInspector.MIMETypes) 161 return resource.type in WebInspector.MIMETypes[resource.mimeType]; 162 163 return false; 127 164 }, 128 165 … … 326 363 327 364 /** 328 * @ constructor365 * @type {?WebInspector.NetworkManager} 329 366 */ 330 WebInspector.NetworkLog = function() 331 { 332 this._resources = []; 333 WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceStarted, this._onResourceStarted, this); 334 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, this._frameNavigated, this); 335 } 336 337 WebInspector.NetworkLog.prototype = { 338 get resources() 339 { 340 return this._resources; 341 }, 342 343 _frameNavigated: function(event) 344 { 345 if (!event.data.isMainFrame) 346 return; 347 // Preserve resources from the new session. 348 var oldResources = this._resources.splice(0, this._resources.length); 349 for (var i = 0; i < oldResources.length; ++i) { 350 if (oldResources[i].loaderId === event.data.loaderId) 351 this._resources.push(oldResources[i]); 352 } 353 }, 354 355 _onResourceStarted: function(event) 356 { 357 this._resources.push(event.data); 358 } 359 } 367 WebInspector.networkManager = null; -
trunk/Source/WebCore/inspector/front-end/Resource.js
r93706 r93769 424 424 425 425 if (x) { 426 this._checkWarnings();427 426 this.dispatchEventToListeners("finished"); 428 427 if (this._pendingContentCallbacks.length) … … 783 782 }, 784 783 785 _mimeTypeIsConsistentWithType: function()786 {787 // If status is an error, content is likely to be of an inconsistent type,788 // as it's going to be an error message. We do not want to emit a warning789 // for this, though, as this will already be reported as resource loading failure.790 // Also, if a URL like http://localhost/wiki/load.php?debug=true&lang=en produces text/css and gets reloaded,791 // it is 304 Not Modified and its guessed mime-type is text/php, which is wrong.792 // Don't check for mime-types in 304-resources.793 if (this.hasErrorStatusCode() || this.statusCode === 304)794 return true;795 796 if (typeof this.type === "undefined"797 || this.type === WebInspector.Resource.Type.Other798 || this.type === WebInspector.Resource.Type.XHR799 || this.type === WebInspector.Resource.Type.WebSocket)800 return true;801 802 if (!this.mimeType)803 return true; // Might be not known for cached resources with null responses.804 805 if (this.mimeType in WebInspector.MIMETypes)806 return this.type in WebInspector.MIMETypes[this.mimeType];807 808 return false;809 },810 811 _checkWarnings: function()812 {813 if (this._mimeTypeIsConsistentWithType())814 return;815 816 WebInspector.console.addMessage(new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.Other,817 WebInspector.ConsoleMessage.MessageType.Log,818 WebInspector.ConsoleMessage.MessageLevel.Warning,819 -1,820 this.url,821 1,822 WebInspector.UIString("Resource interpreted as %s but transferred with MIME type %s.", WebInspector.Resource.Type.toUIString(this.type), this.mimeType),823 null,824 null));825 },826 827 784 get content() 828 785 { -
trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js
r93706 r93769 39 39 WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, this._onResourceUpdated, this); 40 40 41 WebInspector.console.addEventListener(WebInspector.Console View.Events.MessageAdded, this._consoleMessageAdded, this);42 WebInspector.console.addEventListener(WebInspector.Console View.Events.ConsoleCleared, this._consoleCleared, this);41 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._consoleMessageAdded, this); 42 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); 43 43 44 44 this.frontendReused(); -
trunk/Source/WebCore/inspector/front-end/SourceFile.js
r93595 r93769 31 31 // RawSourceCode represents JavaScript resource or HTML resource with inlined scripts 32 32 // as it came from network. 33 34 /** 35 * @constructor 36 * @extends {WebInspector.Object} 37 */ 33 38 WebInspector.RawSourceCode = function(id, script, formatter) 34 39 { … … 92 97 var closestScript = this._scripts[0]; 93 98 for (var i = 1; i < this._scripts.length; ++i) { 94 script = this._scripts[i];99 var script = this._scripts[i]; 95 100 if (script.lineOffset > lineNumber || (script.lineOffset === lineNumber && script.columnOffset > columnNumber)) 96 101 continue; … … 254 259 255 260 261 /** 262 * @constructor 263 * @implements {WebInspector.ContentProvider} 264 */ 256 265 WebInspector.ScriptContentProvider = function(script) 257 266 { … … 261 270 262 271 WebInspector.ScriptContentProvider.prototype = { 263 requestContent: function(callback) 264 { 265 function didRequestSource(source) 266 { 267 callback(this._mimeType, source); 272 requestContent: function(callback) 273 { 274 function didRequestSource(source) 275 { 276 callback(this._mimeType, source); 277 } 278 this._script.requestSource(didRequestSource.bind(this)); 268 279 } 269 this._script.requestSource(didRequestSource.bind(this));270 }271 280 } 272 281 273 282 WebInspector.ScriptContentProvider.prototype.__proto__ = WebInspector.ContentProvider.prototype; 274 283 275 284 /** 285 * @constructor 286 * @implements {WebInspector.ContentProvider} 287 */ 276 288 WebInspector.ConcatenatedScriptsContentProvider = function(scripts) 277 289 { … … 301 313 var lineNumber = 0; 302 314 var columnNumber = 0; 303 var scriptRanges = []; 304 function appendChunk(chunk , script)315 316 function appendChunk(chunk) 305 317 { 306 318 var start = { lineNumber: lineNumber, columnNumber: columnNumber }; … … 315 327 } 316 328 var end = { lineNumber: lineNumber, columnNumber: columnNumber }; 317 if (script)318 scriptRanges.push({ start: start, end: end, sourceId: script.sourceId });319 329 } 320 330 … … 330 340 // Add script tag. 331 341 appendChunk(scriptOpenTag); 332 appendChunk(sources[i] , scripts[i]);342 appendChunk(sources[i]); 333 343 appendChunk(scriptCloseTag); 334 344 } … … 340 350 WebInspector.ConcatenatedScriptsContentProvider.prototype.__proto__ = WebInspector.ContentProvider.prototype; 341 351 342 352 /** 353 * @constructor 354 * @implements {WebInspector.ContentProvider} 355 */ 343 356 WebInspector.ResourceContentProvider = function(resource) 344 357 { -
trunk/Source/WebCore/inspector/front-end/UISourceCode.js
r93304 r93769 29 29 */ 30 30 31 /** 32 * @constructor 33 */ 31 34 WebInspector.UISourceCode = function(id, url, isContentScript, contentProvider) 32 35 { … … 77 80 } 78 81 79 WebInspector.ContentProvider = function() 80 { 82 /** 83 * @interface 84 */ 85 WebInspector.ContentProvider = function() { } 86 WebInspector.ContentProvider.prototype = { 87 requestContent: function(callback) { } 81 88 } 82 83 WebInspector.ContentProvider.prototype = {84 requestContent: function(callback)85 {86 // Should be implemented by subclasses.87 }88 } -
trunk/Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
r93584 r93769 187 187 continue; 188 188 189 WebInspector.console .evalInInspectedWindow(expression, this._watchObjectGroupId, false, true, undefined, appendResult.bind(this, expression, i));189 WebInspector.consoleView.evalInInspectedWindow(expression, this._watchObjectGroupId, false, true, undefined, appendResult.bind(this, expression, i)); 190 190 } 191 191 -
trunk/Source/WebCore/inspector/front-end/WebKit.qrc
r93705 r93769 17 17 <file>Color.js</file> 18 18 <file>ConsoleMessage.js</file> 19 <file>ConsoleModel.js</file> 19 20 <file>ConsolePanel.js</file> 20 21 <file>ConsoleView.js</file> … … 69 70 <file>MetricsSidebarPane.js</file> 70 71 <file>NetworkItemView.js</file> 72 <file>NetworkLog.js</file> 71 73 <file>NetworkManager.js</file> 72 74 <file>NetworkPanel.js</file> -
trunk/Source/WebCore/inspector/front-end/externs.js
r93706 r93769 35 35 36 36 var WebInspector = {} 37 /** @param {string} url */ 38 WebInspector.linkifyURLAsNode = function(url) {} 37 38 /** 39 * @param {string} url 40 * @param {string=} linkText 41 * @param {string=} classes 42 * @param {boolean=} isExternal 43 * @param {string=} tooltipText 44 */ 45 WebInspector.linkifyURLAsNode = function(url, linkText, classes, isExternal, tooltipText) {} 46 39 47 /** @param {string} url */ 40 48 WebInspector.linkifyStringAsFragment = function(url) {} 49 50 /** 51 * @param {string} url 52 * @param {number} lineNumber 53 */ 54 WebInspector.formatLinkText = function(url, lineNumber) {} 41 55 42 56 /** -
trunk/Source/WebCore/inspector/front-end/inspector.html
r93705 r93769 62 62 <script type="text/javascript" src="Drawer.js"></script> 63 63 <script type="text/javascript" src="ConsoleMessage.js"></script> 64 <script type="text/javascript" src="ConsoleModel.js"></script> 64 65 <script type="text/javascript" src="ConsoleView.js"></script> 65 66 <script type="text/javascript" src="Panel.js"></script> … … 68 69 <script type="text/javascript" src="CSSStyleModel.js"></script> 69 70 <script type="text/javascript" src="NetworkManager.js"></script> 71 <script type="text/javascript" src="NetworkLog.js"></script> 70 72 <script type="text/javascript" src="ResourceTreeModel.js"></script> 71 73 <script type="text/javascript" src="ResourceCategory.js"></script> -
trunk/Source/WebCore/inspector/front-end/inspector.js
r93706 r93769 184 184 var anchoredStatusBar = document.getElementById("anchored-status-bar-items"); 185 185 anchoredStatusBar.appendChild(this._dockToggleButton.element); 186 anchoredStatusBar.appendChild(this.console .toggleConsoleButton.element);186 anchoredStatusBar.appendChild(this.consoleView.toggleConsoleButton.element); 187 187 if (this.panels.elements) 188 188 anchoredStatusBar.appendChild(this.panels.elements.nodeSearchButton.element); … … 290 290 }, 291 291 292 get errors()293 {294 return this._errors || 0;295 },296 297 set errors(x)298 {299 x = Math.max(x, 0);300 301 if (this._errors === x)302 return;303 this._errors = x;304 this._updateErrorAndWarningCounts();305 },306 307 get warnings()308 {309 return this._warnings || 0;310 },311 312 set warnings(x)313 {314 x = Math.max(x, 0);315 316 if (this._warnings === x)317 return;318 this._warnings = x;319 this._updateErrorAndWarningCounts();320 },321 322 292 _updateErrorAndWarningCounts: function() 323 293 { … … 326 296 return; 327 297 328 if (!this.errors && !this.warnings) { 298 var errors = WebInspector.console.errors; 299 var warnings = WebInspector.console.warnings; 300 if (!errors && !warnings) { 329 301 errorWarningElement.addStyleClass("hidden"); 330 302 return; … … 335 307 errorWarningElement.removeChildren(); 336 308 337 if ( this.errors) {309 if (errors) { 338 310 var errorElement = document.createElement("span"); 339 311 errorElement.id = "error-count"; 340 errorElement.textContent = this.errors;312 errorElement.textContent = errors; 341 313 errorWarningElement.appendChild(errorElement); 342 314 } 343 315 344 if ( this.warnings) {316 if (warnings) { 345 317 var warningsElement = document.createElement("span"); 346 318 warningsElement.id = "warning-count"; 347 warningsElement.textContent = this.warnings;319 warningsElement.textContent = warnings; 348 320 errorWarningElement.appendChild(warningsElement); 349 321 } 350 322 351 if ( this.errors) {352 if ( this.warnings) {353 if ( this.errors == 1) {354 if ( this.warnings == 1)355 errorWarningElement.title = WebInspector.UIString("%d error, %d warning", this.errors, this.warnings);323 if (errors) { 324 if (warnings) { 325 if (errors == 1) { 326 if (warnings == 1) 327 errorWarningElement.title = WebInspector.UIString("%d error, %d warning", errors, warnings); 356 328 else 357 errorWarningElement.title = WebInspector.UIString("%d error, %d warnings", this.errors, this.warnings);358 } else if ( this.warnings == 1)359 errorWarningElement.title = WebInspector.UIString("%d errors, %d warning", this.errors, this.warnings);329 errorWarningElement.title = WebInspector.UIString("%d error, %d warnings", errors, warnings); 330 } else if (warnings == 1) 331 errorWarningElement.title = WebInspector.UIString("%d errors, %d warning", errors, warnings); 360 332 else 361 errorWarningElement.title = WebInspector.UIString("%d errors, %d warnings", this.errors, this.warnings);362 } else if ( this.errors == 1)363 errorWarningElement.title = WebInspector.UIString("%d error", this.errors);333 errorWarningElement.title = WebInspector.UIString("%d errors, %d warnings", errors, warnings); 334 } else if (errors == 1) 335 errorWarningElement.title = WebInspector.UIString("%d error", errors); 364 336 else 365 errorWarningElement.title = WebInspector.UIString("%d errors", this.errors);366 } else if ( this.warnings == 1)367 errorWarningElement.title = WebInspector.UIString("%d warning", this.warnings);368 else if ( this.warnings)369 errorWarningElement.title = WebInspector.UIString("%d warnings", this.warnings);337 errorWarningElement.title = WebInspector.UIString("%d errors", errors); 338 } else if (warnings == 1) 339 errorWarningElement.title = WebInspector.UIString("%d warning", warnings); 340 else if (warnings) 341 errorWarningElement.title = WebInspector.UIString("%d warnings", warnings); 370 342 else 371 343 errorWarningElement.title = null; … … 512 484 WebInspector.shortcutsScreen.section(WebInspector.UIString("Elements Panel")); 513 485 486 this.console = new WebInspector.ConsoleModel(); 487 this.console.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._updateErrorAndWarningCounts, this); 488 this.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._updateErrorAndWarningCounts, this); 489 514 490 this.drawer = new WebInspector.Drawer(); 515 this.console = new WebInspector.ConsoleView(this.drawer); 516 this.drawer.visibleView = this.console; 491 this.consoleView = new WebInspector.ConsoleView(this.drawer); 492 this.drawer.visibleView = this.consoleView; 493 517 494 this.networkManager = new WebInspector.NetworkManager(); 518 495 this.resourceTreeModel = new WebInspector.ResourceTreeModel(); 519 496 this.networkLog = new WebInspector.NetworkLog(); 520 497 this.domAgent = new WebInspector.DOMAgent(); 521 new WebInspector.JavaScriptContextManager(this.resourceTreeModel, this.console );498 new WebInspector.JavaScriptContextManager(this.resourceTreeModel, this.consoleView); 522 499 523 500 InspectorBackend.registerInspectorDispatcher(this); … … 554 531 this.extensionServer.initExtensions(); 555 532 556 if (WebInspector.settings.monitoringXHREnabled.get()) 557 ConsoleAgent.setMonitoringXHREnabled(true); 558 559 // There is no console agent for workers yet. 560 if (!WebInspector.WorkerManager.isWorkerFrontend()) 561 ConsoleAgent.enable(this.console.setConsoleMessageExpiredCount.bind(this.console)); 533 this.console.enableAgent(); 562 534 563 535 DatabaseAgent.enable(); … … 1027 999 WebInspector.showConsole = function() 1028 1000 { 1029 this.drawer.showView(this.console );1001 this.drawer.showView(this.consoleView); 1030 1002 } 1031 1003
Note: See TracChangeset
for help on using the changeset viewer.