Web Inspector: load network panel lazily
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Aug 2012 19:34:18 +0000 (19:34 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Aug 2012 19:34:18 +0000 (19:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=94414

Reviewed by Vsevolod Vlasov.

Source/WebCore:

This change removes access to WebInspector.panels.network and loads it lazily.

* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessageImpl):
(WebInspector.ConsoleMessageImpl.prototype.clone):
* inspector/front-end/ConsoleModel.js:
(WebInspector.ConsoleMessage.create):
(WebInspector.ConsoleDispatcher.prototype.messageAdded):
* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleMessage.create):
* inspector/front-end/NetworkLog.js:
(WebInspector.NetworkLog):
(WebInspector.NetworkLog.prototype._onRequestStarted):
(WebInspector.NetworkLog.prototype._onLoad):
(WebInspector.NetworkLog.prototype.requestForId):
* inspector/front-end/NetworkManager.js:
(WebInspector.NetworkDispatcher.prototype._updateNetworkRequestWithResponse):
* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkLogView):
* inspector/front-end/ScriptSnippetModel.js:
(WebInspector.ScriptSnippetModel.prototype.evaluateScriptSnippet.compileCallback):
(WebInspector.ScriptSnippetModel.prototype.evaluateScriptSnippet):
* inspector/front-end/externs.js:
* inspector/front-end/inspector.html:
* inspector/front-end/inspector.js:
(WebInspector._panelDescriptors):
(WebInspector._showAnchorLocation):

Source/WebKit/chromium:

* WebKit.gyp:

LayoutTests:

* http/tests/inspector/inspector-test.js:
(initialize_InspectorTest.InspectorTest.navigate):
(initialize_InspectorTest.InspectorTest._innerReloadPage):
* http/tests/inspector/network-test.js:
* http/tests/inspector/network/async-xhr-json-mime-type.html:
* http/tests/inspector/network/cached-resource-destroyed-moved-to-storage.html:
* http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html:
* http/tests/inspector/network/download.html:
* http/tests/inspector/network/network-cachedresources-with-same-urls.html:
* http/tests/inspector/network/network-clear-cache.html-disabled:
* http/tests/inspector/network/network-clear-cookies.html-disabled:
* http/tests/inspector/network/network-content-replacement-embed.html:
* http/tests/inspector/network/network-content-replacement-xhr.html:
* http/tests/inspector/network/network-cyrillic-xhr.html:
* http/tests/inspector/network/network-disable-cache-memory.html:
* http/tests/inspector/network/network-disable-cache-xhrs.html:
* http/tests/inspector/network/network-disabling-check-no-memory-leak.html:
* http/tests/inspector/network/network-embed.html:
* http/tests/inspector/network/network-empty-xhr.html:
* http/tests/inspector/network/network-iframe-load-and-delete.html:
* http/tests/inspector/network/network-image-404.html:
* http/tests/inspector/network/network-initiator-from-console.html:
* http/tests/inspector/network/network-preview-json.html:
* http/tests/inspector/network/network-request-revision-content.html:
* http/tests/inspector/network/network-shared-worker.html:
* http/tests/inspector/network/network-sidebar-width.html:
* http/tests/inspector/network/network-size-chunked.html:
* http/tests/inspector/network/network-size-sync.html:
* http/tests/inspector/network/network-size.html:
* http/tests/inspector/network/network-worker.html:
* http/tests/inspector/network/network-xhr-async-double.html:
* http/tests/inspector/network/network-xhr-async.html:
* http/tests/inspector/network/network-xhr-same-url-as-main-resource.html:
* http/tests/inspector/network/network-xhr-sync.html:
* http/tests/inspector/network/request-parameters-decoding.html:
* http/tests/inspector/network/x-frame-options-deny.html:
* http/tests/inspector/resource-har-pages.html:
* http/tests/inspector/resource-tree/resource-tree-mimetype.html:

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

52 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/inspector-test.js
LayoutTests/http/tests/inspector/network-test.js
LayoutTests/http/tests/inspector/network/async-xhr-json-mime-type.html
LayoutTests/http/tests/inspector/network/cached-resource-destroyed-moved-to-storage.html
LayoutTests/http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html
LayoutTests/http/tests/inspector/network/download.html
LayoutTests/http/tests/inspector/network/network-cachedresources-with-same-urls.html
LayoutTests/http/tests/inspector/network/network-clear-cache.html-disabled
LayoutTests/http/tests/inspector/network/network-clear-cookies.html-disabled
LayoutTests/http/tests/inspector/network/network-content-replacement-embed.html
LayoutTests/http/tests/inspector/network/network-content-replacement-xhr.html
LayoutTests/http/tests/inspector/network/network-cyrillic-xhr.html
LayoutTests/http/tests/inspector/network/network-disable-cache-memory.html
LayoutTests/http/tests/inspector/network/network-disable-cache-xhrs.html
LayoutTests/http/tests/inspector/network/network-disabling-check-no-memory-leak.html
LayoutTests/http/tests/inspector/network/network-embed.html
LayoutTests/http/tests/inspector/network/network-empty-xhr.html
LayoutTests/http/tests/inspector/network/network-iframe-load-and-delete.html
LayoutTests/http/tests/inspector/network/network-image-404.html
LayoutTests/http/tests/inspector/network/network-initiator-from-console.html
LayoutTests/http/tests/inspector/network/network-preview-json.html
LayoutTests/http/tests/inspector/network/network-request-revision-content.html
LayoutTests/http/tests/inspector/network/network-shared-worker.html
LayoutTests/http/tests/inspector/network/network-sidebar-width.html
LayoutTests/http/tests/inspector/network/network-size-chunked.html
LayoutTests/http/tests/inspector/network/network-size-sync.html
LayoutTests/http/tests/inspector/network/network-size.html
LayoutTests/http/tests/inspector/network/network-worker.html
LayoutTests/http/tests/inspector/network/network-xhr-async-double.html
LayoutTests/http/tests/inspector/network/network-xhr-async.html
LayoutTests/http/tests/inspector/network/network-xhr-same-url-as-main-resource.html
LayoutTests/http/tests/inspector/network/network-xhr-sync.html
LayoutTests/http/tests/inspector/network/request-parameters-decoding.html
LayoutTests/http/tests/inspector/network/x-frame-options-deny.html
LayoutTests/http/tests/inspector/resource-har-pages.html
LayoutTests/http/tests/inspector/resource-tree/resource-tree-mimetype.html
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/inspector/front-end/ConsoleMessage.js
Source/WebCore/inspector/front-end/ConsoleModel.js
Source/WebCore/inspector/front-end/ConsoleView.js
Source/WebCore/inspector/front-end/NetworkLog.js
Source/WebCore/inspector/front-end/NetworkManager.js
Source/WebCore/inspector/front-end/NetworkPanel.js
Source/WebCore/inspector/front-end/ScriptSnippetModel.js
Source/WebCore/inspector/front-end/externs.js
Source/WebCore/inspector/front-end/inspector.html
Source/WebCore/inspector/front-end/inspector.js
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gyp

index 22fda3e..261bd83 100644 (file)
@@ -1,5 +1,51 @@
 2012-08-19  Pavel Feldman  <pfeldman@chromium.org>
 
+        Web Inspector: load network panel lazily
+        https://bugs.webkit.org/show_bug.cgi?id=94414
+
+        Reviewed by Vsevolod Vlasov.
+
+        * http/tests/inspector/inspector-test.js:
+        (initialize_InspectorTest.InspectorTest.navigate):
+        (initialize_InspectorTest.InspectorTest._innerReloadPage):
+        * http/tests/inspector/network-test.js:
+        * http/tests/inspector/network/async-xhr-json-mime-type.html:
+        * http/tests/inspector/network/cached-resource-destroyed-moved-to-storage.html:
+        * http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html:
+        * http/tests/inspector/network/download.html:
+        * http/tests/inspector/network/network-cachedresources-with-same-urls.html:
+        * http/tests/inspector/network/network-clear-cache.html-disabled:
+        * http/tests/inspector/network/network-clear-cookies.html-disabled:
+        * http/tests/inspector/network/network-content-replacement-embed.html:
+        * http/tests/inspector/network/network-content-replacement-xhr.html:
+        * http/tests/inspector/network/network-cyrillic-xhr.html:
+        * http/tests/inspector/network/network-disable-cache-memory.html:
+        * http/tests/inspector/network/network-disable-cache-xhrs.html:
+        * http/tests/inspector/network/network-disabling-check-no-memory-leak.html:
+        * http/tests/inspector/network/network-embed.html:
+        * http/tests/inspector/network/network-empty-xhr.html:
+        * http/tests/inspector/network/network-iframe-load-and-delete.html:
+        * http/tests/inspector/network/network-image-404.html:
+        * http/tests/inspector/network/network-initiator-from-console.html:
+        * http/tests/inspector/network/network-preview-json.html:
+        * http/tests/inspector/network/network-request-revision-content.html:
+        * http/tests/inspector/network/network-shared-worker.html:
+        * http/tests/inspector/network/network-sidebar-width.html:
+        * http/tests/inspector/network/network-size-chunked.html:
+        * http/tests/inspector/network/network-size-sync.html:
+        * http/tests/inspector/network/network-size.html:
+        * http/tests/inspector/network/network-worker.html:
+        * http/tests/inspector/network/network-xhr-async-double.html:
+        * http/tests/inspector/network/network-xhr-async.html:
+        * http/tests/inspector/network/network-xhr-same-url-as-main-resource.html:
+        * http/tests/inspector/network/network-xhr-sync.html:
+        * http/tests/inspector/network/request-parameters-decoding.html:
+        * http/tests/inspector/network/x-frame-options-deny.html:
+        * http/tests/inspector/resource-har-pages.html:
+        * http/tests/inspector/resource-tree/resource-tree-mimetype.html:
+
+2012-08-19  Pavel Feldman  <pfeldman@chromium.org>
+
         REGRESSION (r125280-r125284): inspector/console/console-format-collections.html failing on Apple Lion Debug WK1 (Tests)
         https://bugs.webkit.org/show_bug.cgi?id=93748
 
index 5963b86..e5eeeaf 100644 (file)
@@ -183,8 +183,7 @@ InspectorTest.navigate = function(url, callback)
 {
     InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(callback);
 
-    if (WebInspector.panels.network)
-        WebInspector.panels.network._reset();
+    WebInspector.panel("network")._reset();
     InspectorTest.evaluateInConsole("window.location = '" + url + "'");
 }
 
@@ -202,8 +201,7 @@ InspectorTest._innerReloadPage = function(hardReload, callback)
 {
     InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(callback);
 
-    if (WebInspector.panels.network)
-        WebInspector.panels.network._reset();
+    WebInspector.panel("network")._reset();
     PageAgent.reload(hardReload);
 }
 
index 4c7e13a..aaa41f8 100644 (file)
@@ -2,7 +2,7 @@ var initialize_NetworkTest = function() {
 
 InspectorTest.dumpNetworkRequests = function()
 {
-    var requests = WebInspector.panels.network.requests.slice();
+    var requests = WebInspector.panel("network").requests.slice();
     requests.sort(function(a, b) {return a.url.localeCompare(b.url);});
     InspectorTest.addResult("resources count = " + requests.length);
     for (i = 0; i < requests.length; i++)
index ca0f769..71fb60b 100644 (file)
@@ -20,7 +20,7 @@ function test()
 
     function step2()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult("resource.type: " + request1.type);
         InspectorTest.addResult("resource.content before requesting content: " + request1.content);
@@ -30,7 +30,7 @@ function test()
 
     function step3()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         InspectorTest.completeTest();
index 29e88ec..b3895b8 100644 (file)
@@ -46,7 +46,7 @@ function test()
 
     function step2()
     {
-        imageRequest = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        imageRequest = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         imageRequest.requestContent(step3);
     }
 
index 6dc150f..7d334ba 100644 (file)
@@ -46,7 +46,7 @@ function test()
 
     function step2()
     {
-        imageRequest = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        imageRequest = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         imageRequest.requestContent(step3);
     }
 
index 72a0dde..c5af00d 100644 (file)
@@ -18,7 +18,7 @@ function test()
 
     function responseReceived(requestId, time, resourceType, response)
     {
-        var request = WebInspector.networkRequestById(requestId);
+        var request = WebInspector.networkLog.requestForId(requestId);
         if (/download\.zzz/.exec(request.url)) {
             InspectorTest.addResult("Received response for download.zzz");
             InspectorTest.addResult("SUCCESS");
@@ -28,14 +28,14 @@ function test()
 
     function loadingFinished(requestId, finishTime)
     {
-        var request = WebInspector.networkRequestById(requestId);
+        var request = WebInspector.networkLog.requestForId(requestId);
         if (/download\.zzz/.exec(request.url))
             InspectorTest.completeTest();
     }
 
     function loadingFailed(requestId, time, localizedDescription, canceled)
     {
-        var request = WebInspector.networkRequestById(requestId);
+        var request = WebInspector.networkLog.requestForId(requestId);
         if (/download\.zzz/.exec(request.url))
             InspectorTest.completeTest();
     }
index 259392e..ba07fab 100644 (file)
@@ -32,9 +32,9 @@ function test()
     {
         // inspector-test.js appears in network panel occasionally in Safari on
         // Mac, so checking two last requests.
-        var requestsCount = WebInspector.panels.network.requests.length;
-        var request1 = WebInspector.panels.network.requests[requestsCount - 2];
-        var request2 = WebInspector.panels.network.requests[requestsCount - 1];
+        var requestsCount = WebInspector.panel("network").requests.length;
+        var request1 = WebInspector.panel("network").requests[requestsCount - 2];
+        var request2 = WebInspector.panel("network").requests[requestsCount - 1];
         request1.requestContent(contentLoaded);
         request2.requestContent(contentLoaded);
     }
@@ -45,9 +45,9 @@ function test()
         if (++contentLoadedCount !== 2)
             return;
 
-        var requestsCount = WebInspector.panels.network.requests.length;
-        var request1 = WebInspector.panels.network.requests[requestsCount - 2];
-        var request2 = WebInspector.panels.network.requests[requestsCount - 1];
+        var requestsCount = WebInspector.panel("network").requests.length;
+        var request1 = WebInspector.panel("network").requests[requestsCount - 2];
+        var request2 = WebInspector.panel("network").requests[requestsCount - 1];
 
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult(request2.url);
index 5a03774..ef20a61 100644 (file)
@@ -58,10 +58,10 @@ function test()
     {
         // inspector-test.js appears in network panel occasionally in Safari on
         // Mac, so checking two last resources.
-        var resourcesCount = WebInspector.panels.network.resources.length;
-        var resource1 = WebInspector.panels.network.resources[resourcesCount - 3];
-        var resource2 = WebInspector.panels.network.resources[resourcesCount - 2];
-        var resource3 = WebInspector.panels.network.resources[resourcesCount - 1];
+        var resourcesCount = WebInspector.panel("network").resources.length;
+        var resource1 = WebInspector.panel("network").resources[resourcesCount - 3];
+        var resource2 = WebInspector.panel("network").resources[resourcesCount - 2];
+        var resource3 = WebInspector.panel("network").resources[resourcesCount - 1];
         resource1.requestContent(contentLoaded);
         resource2.requestContent(contentLoaded);
         resource3.requestContent(contentLoaded);
@@ -73,10 +73,10 @@ function test()
         if (++contentLoadedCount !== 3)
             return;
 
-        var resourcesCount = WebInspector.panels.network.resources.length;
-        var resource1 = WebInspector.panels.network.resources[resourcesCount - 3];
-        var resource2 = WebInspector.panels.network.resources[resourcesCount - 2];
-        var resource3 = WebInspector.panels.network.resources[resourcesCount - 1];
+        var resourcesCount = WebInspector.panel("network").resources.length;
+        var resource1 = WebInspector.panel("network").resources[resourcesCount - 3];
+        var resource2 = WebInspector.panel("network").resources[resourcesCount - 2];
+        var resource3 = WebInspector.panel("network").resources[resourcesCount - 1];
 
         InspectorTest.addResult(resource1.url);
         InspectorTest.addResult(resource2.url);
index 26e0ea2..f53e4fd 100644 (file)
@@ -58,9 +58,9 @@ function test()
     {
         // inspector-test.js appears in network panel occasionally in Safari on
         // Mac, so checking two last resources.
-        var resourcesCount = WebInspector.panels.network.resources.length;
-        var resource1 = WebInspector.panels.network.resources[resourcesCount - 2];
-        var resource2 = WebInspector.panels.network.resources[resourcesCount - 1];
+        var resourcesCount = WebInspector.panel("network").resources.length;
+        var resource1 = WebInspector.panel("network").resources[resourcesCount - 2];
+        var resource2 = WebInspector.panel("network").resources[resourcesCount - 1];
 
         InspectorTest.addResult(resource1.url);
         InspectorTest.addResult(resource2.url);
index ea534ad..9cd8531 100644 (file)
@@ -80,25 +80,25 @@ function test()
 
     function step1()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 4];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 4];
         dumpRequest(request, step2);
     }
 
     function step2()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 3];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 3];
         dumpRequest(request, step3);
     }
 
     function step3()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 2];
         dumpRequest(request, step4);
     }
 
     function step4()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         dumpRequest(request, step5);
     }
 
index 8f7a6a1..737863a 100644 (file)
@@ -60,25 +60,25 @@ function test()
 
     function step1()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 4];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 4];
         dumpRequest(request, step2);
     }
 
     function step2()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 3];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 3];
         dumpRequest(request, step3);
     }
 
     function step3()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 2];
         dumpRequest(request, step4);
     }
 
     function step4()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         dumpRequest(request, step5);
     }
 
index 8fecbd3..73db2a6 100644 (file)
@@ -47,13 +47,13 @@ function test()
 
     function step2()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 2];
         dumpRequest(request, step3);
     }
 
     function step3()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         dumpRequest(request, step4);
     }
 
index 5850d6b..ced7d8b 100644 (file)
@@ -27,15 +27,15 @@ function test()
 
         function scriptLoaded()
         {
-            var requestsCount = WebInspector.panels.network.requests.length;
-            var request = WebInspector.panels.network.requests[requestsCount - 1];
+            var requestsCount = WebInspector.panel("network").requests.length;
+            var request = WebInspector.panel("network").requests[requestsCount - 1];
             request.requestContent(contentLoaded);
         }
 
         function contentLoaded()
         {
-            var requestsCount = WebInspector.panels.network.requests.length;
-            var request = WebInspector.panels.network.requests[requestsCount - 1];
+            var requestsCount = WebInspector.panel("network").requests.length;
+            var request = WebInspector.panel("network").requests[requestsCount - 1];
             callback(request.content);
         }
     }
index 9d9c363..9905c7d 100644 (file)
@@ -60,10 +60,10 @@ function test()
     {
         // inspector-test.js appears in network panel occasionally in Safari on
         // Mac, so checking two last resources.
-        var requestsCount = WebInspector.panels.network.requests.length;
-        var request1 = WebInspector.panels.network.requests[requestsCount - 3];
-        var request2 = WebInspector.panels.network.requests[requestsCount - 2];
-        var request3 = WebInspector.panels.network.requests[requestsCount - 1];
+        var requestsCount = WebInspector.panel("network").requests.length;
+        var request1 = WebInspector.panel("network").requests[requestsCount - 3];
+        var request2 = WebInspector.panel("network").requests[requestsCount - 2];
+        var request3 = WebInspector.panel("network").requests[requestsCount - 1];
         request1.requestContent(contentLoaded);
         request2.requestContent(contentLoaded);
         request3.requestContent(contentLoaded);
@@ -75,10 +75,10 @@ function test()
         if (++contentLoadedCount !== 3)
             return;
 
-        var requestsCount = WebInspector.panels.network.requests.length;
-        var request1 = WebInspector.panels.network.requests[requestsCount - 3];
-        var request2 = WebInspector.panels.network.requests[requestsCount - 2];
-        var request3 = WebInspector.panels.network.requests[requestsCount - 1];
+        var requestsCount = WebInspector.panel("network").requests.length;
+        var request1 = WebInspector.panel("network").requests[requestsCount - 3];
+        var request2 = WebInspector.panel("network").requests[requestsCount - 2];
+        var request3 = WebInspector.panel("network").requests[requestsCount - 1];
 
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult(request2.url);
index 5dc0db3..904a430 100644 (file)
@@ -32,13 +32,13 @@ function test()
 
     function step3()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         request1.requestContent(step4);
     }
 
     function step4()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult("resource.content after disabling network domain: " + request1.content);
         NetworkAgent.enable(step5);
     }
index f21a2a5..3e0c505 100644 (file)
@@ -89,31 +89,31 @@ function test()
 
     function step2()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 5];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 5];
         dumpRequest(request, step3);
     }
 
     function step3()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 4];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 4];
         dumpRequest(request, step4);
     }
 
     function step4()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 3];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 3];
         dumpRequest(request, step5);
     }
 
     function step5()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 2];
         dumpRequest(request, step6);
     }
 
     function step6()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         dumpRequest(request, step7);
     }
 
index 5985603..097cc1d 100644 (file)
@@ -47,13 +47,13 @@ function test()
 
     function step2()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 2];
         dumpRequest(request, step3);
     }
 
     function step3()
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         dumpRequest(request, step4);
     }
 
index 3ea2cec..3bd4cc2 100644 (file)
@@ -43,7 +43,7 @@ function test()
 
     function step2()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 3];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 3];
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult("resource.type: " + request1.type);
         InspectorTest.addResult("resource.content before requesting content: " + request1.content);
@@ -52,10 +52,10 @@ function test()
 
     function step3()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 3];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 3];
         InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
-        var request2 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request2 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult(request2.url);
         InspectorTest.addResult("resource.type: " + request2.type);
         InspectorTest.addResult("resource.content before requesting content: " + request2.content);
@@ -64,7 +64,7 @@ function test()
 
     function step4()
     {
-        var request2 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request2 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult("resource.content after requesting content: " + request2.content);
 
         InspectorTest.completeTest();
index b287580..ea26cb0 100644 (file)
@@ -29,7 +29,7 @@ function test()
 
     function step2()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult("resource.type: " + request1.type);
         InspectorTest.addResult("resource.content before requesting content: " + request1.content);
@@ -39,7 +39,7 @@ function test()
 
     function step3()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         InspectorTest.completeTest();
index d108023..265879a 100644 (file)
@@ -39,7 +39,7 @@ var test = function()
         if (!findRequestByURL(/script.js/))
             return;
 
-        WebInspector.panels.network.show();
+        WebInspector.panel("network").show();
         InspectorTest.completeTest();
     }
 }
index 44f4c09..bbdd8f7 100644 (file)
@@ -5,6 +5,8 @@
 
 function test()
 {
+    WebInspector.showPanel("network");
+
     var testData;
 
     testData = "while(1);";
index 7d94184..d6837c6 100644 (file)
@@ -20,7 +20,7 @@ function test()
     var resource;
     function step2(event)
     {
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(request.url);
         if (!uiSourceCode)
             return;
index 495fa0d..38f18b0 100644 (file)
@@ -28,7 +28,7 @@ function test()
 
     function step2()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult("resource.type: " + request1.type);
         InspectorTest.addResult("resource.content before requesting content: " + request1.content);
@@ -37,7 +37,7 @@ function test()
 
     function step3()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         InspectorTest.completeTest();
index 9e5b47c..de744cc 100644 (file)
@@ -21,9 +21,9 @@ function test()
     var oldSetting;
     function step2()
     {
-        var panel = WebInspector.panels.network;
+        var panel = WebInspector.panel("network");
         var setting = WebInspector.settings[panel._sidebarWidthSettingName()];
-        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
 
         oldSetting = setting.get();
         panel.show();
index c07f6b4..a25ca0d 100644 (file)
@@ -22,7 +22,7 @@ function test()
 
     function step2()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult("resourceSize: " + request1.resourceSize);
         InspectorTest.addResult("transferSize: " + request1.transferSize);
index 51b3b09..2caf341 100644 (file)
@@ -20,7 +20,7 @@ function test()
 
     function step2()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult("resourceSize: " + request1.resourceSize);
         InspectorTest.addResult("transferSize: " + request1.transferSize);
index 7090ea9..df53cac 100644 (file)
@@ -32,13 +32,13 @@ function test()
     {
         // inspector-test.js appears in network panel occasionally in Safari on
         // Mac, so checking two last resources.
-        var requestsCount = WebInspector.panels.network.requests.length;
-        var request1 = WebInspector.panels.network.requests[requestsCount - 2];
+        var requestsCount = WebInspector.panel("network").requests.length;
+        var request1 = WebInspector.panel("network").requests[requestsCount - 2];
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult("resourceSize: " + request1.resourceSize);
         InspectorTest.addResult("transferSize: " + (request1.transferSize - request1.responseHeadersSize));
 
-        var request2 = WebInspector.panels.network.requests[requestsCount - 1];
+        var request2 = WebInspector.panel("network").requests[requestsCount - 1];
         InspectorTest.addResult(request2.url);
         InspectorTest.addResult("resourceSize: " + request2.resourceSize);
         InspectorTest.addResult("transferSize: " + (request2.transferSize - request2.responseHeadersSize));
index fe16b85..3ae4c6e 100644 (file)
@@ -28,7 +28,7 @@ function test()
 
     function step2()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult("resource.type: " + request1.type);
         InspectorTest.addResult("resource.content before requesting content: " + request1.content);
@@ -37,7 +37,7 @@ function test()
 
     function step3()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         InspectorTest.completeTest();
index a7fc9d5..e07a658 100644 (file)
@@ -44,8 +44,8 @@ function test()
 
     function step2()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
-        var request2 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 2];
+        var request2 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         request1.requestContent(step3);
         request2.requestContent(step3);
     }
@@ -55,8 +55,8 @@ function test()
     {
         if (--toLoad) 
             return;
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
-        var request2 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 2];
+        var request2 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult("resource1.content: " + request1.content);
         InspectorTest.addResult("resource2.content: " + request2.content);
         InspectorTest.assertTrue(request1.content === 'request1' && request2.content === 'request2');
index 1c0995b..f6fbe05 100644 (file)
@@ -27,7 +27,7 @@ function test()
 
     function step2()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult("resource.type: " + request1.type);
         InspectorTest.addResult("resource.content before requesting content: " + request1.content);
@@ -37,7 +37,7 @@ function test()
 
     function step3()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         InspectorTest.completeTest();
index dfff4a3..01befd7 100644 (file)
@@ -20,7 +20,7 @@ function test()
 
     function step2()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult(request1.type.name());
         InspectorTest.completeTest();
     }
index 48850d7..f1f7cf8 100644 (file)
@@ -27,7 +27,7 @@ function test()
 
     function step2()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult(request1.url);
         InspectorTest.addResult("resource.type: " + request1.type);
         InspectorTest.addResult("resource.content before requesting content: " + request1.content);
@@ -37,7 +37,7 @@ function test()
 
     function step3()
     {
-        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1];
         InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         InspectorTest.completeTest();
index 35dfdd7..70969ec 100644 (file)
@@ -5,6 +5,7 @@
 
 function test()
 {
+       WebInspector.showPanel("network");
     var value = "Test+%21%40%23%24%25%5E%26*%28%29_%2B+parameters.";
     var parameterElement = WebInspector.RequestHeadersView.prototype._formatParameter(value, "", true);
     InspectorTest.addResult("Original value: " + value);
index b9339c5..de58c6a 100644 (file)
@@ -18,7 +18,7 @@ function test()
 
     function responseReceived(requestId, time, resourceType, response)
     {
-        var request = WebInspector.networkRequestById(requestId);
+        var request = WebInspector.networkLog.requestForId(requestId);
         if (/x-frame-options-deny\.cgi/.exec(request.url)) {
             InspectorTest.addResult("Received response for x-frame-options-deny.cgi");
             InspectorTest.addResult("SUCCESS");
@@ -28,14 +28,14 @@ function test()
 
     function loadingFinished(requestId, finishTime)
     {
-        var request = WebInspector.networkRequestById(requestId);
+        var request = WebInspector.networkLog.requestForId(requestId);
         if (/x-frame-options-deny\.cgi/.exec(request.url))
             InspectorTest.completeTest();
     }
 
     function loadingFailed(requestId, time, localizedDescription, canceled)
     {
-        var request = WebInspector.networkRequestById(requestId);
+        var request = WebInspector.networkLog.requestForId(requestId);
         if (/x-frame-options-deny\.cgi/.exec(request.url))
             InspectorTest.completeTest();
     }
index e5d62c0..6d6de82 100644 (file)
@@ -23,7 +23,7 @@ var test = function()
             }
         }
         WebInspector.showPanel("network");
-        var networkLogView = WebInspector.panels.network._networkLogView;
+        var networkLogView = WebInspector.panel("network")._networkLogView;
         // networkLogView.clear();
         networkLogView._preserveLogToggle.toggled = true;
         WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, onRequestFinished);
@@ -32,7 +32,7 @@ var test = function()
 
     function step2()
     {
-        var log = (new WebInspector.HARLog(WebInspector.panels.network._networkLogView._requests)).build();
+        var log = (new WebInspector.HARLog(WebInspector.panel("network")._networkLogView._requests)).build();
         InspectorTest.addObject(log.pages, InspectorTest.HARPropertyFormattersWithSize);
 
         // Filter out favicon.ico requests that only appear on certain platforms.
index dda8be9..bf71ecc 100644 (file)
@@ -6,8 +6,7 @@
 <script>
 function test()
 {
-    if (WebInspector.panels.network)
-        WebInspector.panels.network._reset();
+    WebInspector.panel("network")._reset();
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, step2);
     WebInspector.resourceTreeModel._fetchResourceTree();
 
index e20ea8a..140e608 100644 (file)
@@ -1,3 +1,40 @@
+2012-08-19  Pavel Feldman  <pfeldman@chromium.org>
+
+        Web Inspector: load network panel lazily
+        https://bugs.webkit.org/show_bug.cgi?id=94414
+
+        Reviewed by Vsevolod Vlasov.
+
+        This change removes access to WebInspector.panels.network and loads it lazily.
+
+        * WebCore.gypi:
+        * WebCore.xcodeproj/project.pbxproj:
+        * inspector/front-end/ConsoleMessage.js:
+        (WebInspector.ConsoleMessageImpl):
+        (WebInspector.ConsoleMessageImpl.prototype.clone):
+        * inspector/front-end/ConsoleModel.js:
+        (WebInspector.ConsoleMessage.create):
+        (WebInspector.ConsoleDispatcher.prototype.messageAdded):
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleMessage.create):
+        * inspector/front-end/NetworkLog.js:
+        (WebInspector.NetworkLog):
+        (WebInspector.NetworkLog.prototype._onRequestStarted):
+        (WebInspector.NetworkLog.prototype._onLoad):
+        (WebInspector.NetworkLog.prototype.requestForId):
+        * inspector/front-end/NetworkManager.js:
+        (WebInspector.NetworkDispatcher.prototype._updateNetworkRequestWithResponse):
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkLogView):
+        * inspector/front-end/ScriptSnippetModel.js:
+        (WebInspector.ScriptSnippetModel.prototype.evaluateScriptSnippet.compileCallback):
+        (WebInspector.ScriptSnippetModel.prototype.evaluateScriptSnippet):
+        * inspector/front-end/externs.js:
+        * inspector/front-end/inspector.html:
+        * inspector/front-end/inspector.js:
+        (WebInspector._panelDescriptors):
+        (WebInspector._showAnchorLocation):
+
 2012-08-19  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r125976.
index 2d773e4..9cf1d72 100644 (file)
             'inspector/front-end/FileSystemModel.js',
             'inspector/front-end/FileUtils.js',
             'inspector/front-end/FilteredItemSelectionDialog.js',
-            'inspector/front-end/FontView.js',
             'inspector/front-end/GoToLineDialog.js',
             'inspector/front-end/HAREntry.js',
             'inspector/front-end/HandlerRegistry.js',
             'inspector/front-end/HeapSnapshotWorker.js',
             'inspector/front-end/HelpScreen.js',
-            'inspector/front-end/ImageView.js',
             'inspector/front-end/IndexedDBModel.js',
             'inspector/front-end/InspectorBackend.js',
             'inspector/front-end/InspectorFrontendAPI.js',
             'inspector/front-end/Linkifier.js',
             'inspector/front-end/NavigatorOverlayController.js',
             'inspector/front-end/NavigatorView.js',
-            'inspector/front-end/NetworkItemView.js',
             'inspector/front-end/NetworkManager.js',
             'inspector/front-end/NetworkLog.js',
-            'inspector/front-end/NetworkPanel.js',
             'inspector/front-end/NetworkRequest.js',
             'inspector/front-end/Object.js',
             'inspector/front-end/ObjectPopoverHelper.js',
             'inspector/front-end/PropertiesSection.js',
             'inspector/front-end/RawSourceCode.js',
             'inspector/front-end/RemoteObject.js',
-            'inspector/front-end/RequestCookiesView.js',
-            'inspector/front-end/RequestHeadersView.js',
-            'inspector/front-end/RequestJSONView.js',
-            'inspector/front-end/RequestHTMLView.js',
-            'inspector/front-end/RequestPreviewView.js',
-            'inspector/front-end/RequestResponseView.js',
-            'inspector/front-end/RequestTimingView.js',
-            'inspector/front-end/RequestView.js',
             'inspector/front-end/Resource.js',
             'inspector/front-end/ResourceScriptMapping.js',
             'inspector/front-end/ResourceTreeModel.js',
             'inspector/front-end/ResourceType.js',
             'inspector/front-end/ResourceUtils.js',
-            'inspector/front-end/ResourceView.js',
-            'inspector/front-end/ResourceWebSocketFrameView.js',
             'inspector/front-end/RevisionHistoryView.js',
             'inspector/front-end/SASSSourceMapping.js',
             'inspector/front-end/ScopeChainSidebarPane.js',
             'inspector/front-end/IndexedDBViews.js',
             'inspector/front-end/ResourcesPanel.js',
         ],
+        'webinspector_network_js_files': [
+            'inspector/front-end/FontView.js',
+            'inspector/front-end/ImageView.js',
+            'inspector/front-end/NetworkItemView.js',
+            'inspector/front-end/RequestCookiesView.js',
+            'inspector/front-end/RequestHeadersView.js',
+            'inspector/front-end/RequestHTMLView.js',
+            'inspector/front-end/RequestJSONView.js',
+            'inspector/front-end/RequestPreviewView.js',
+            'inspector/front-end/RequestResponseView.js',
+            'inspector/front-end/RequestTimingView.js',
+            'inspector/front-end/RequestView.js',
+            'inspector/front-end/ResourceView.js',
+            'inspector/front-end/ResourceWebSocketFrameView.js',
+            'inspector/front-end/NetworkPanel.js',
+        ],
         'webinspector_timeline_js_files': [
             'inspector/front-end/MemoryStatistics.js',
             'inspector/front-end/TimelineFrameController.js',
         'webinspector_modules_js_files': [
             '<@(webinspector_elements_js_files)',
             '<@(webinspector_resources_js_files)',
+            '<@(webinspector_network_js_files)',
             '<@(webinspector_timeline_js_files)',
             '<@(webinspector_profiles_js_files)',
             '<@(webinspector_audits_js_files)',
index 04472f8..2329b7f 100644 (file)
                                "$(DERIVED_FILE_DIR)/WebCore/inspector.js",
                                "$(DERIVED_FILE_DIR)/WebCore/ElementsPanel.js",
                                "$(DERIVED_FILE_DIR)/WebCore/ResourcesPanel.js",
+                               "$(DERIVED_FILE_DIR)/WebCore/NetworkPanel.js",
                                "$(DERIVED_FILE_DIR)/WebCore/TimelinePanel.js",
                                "$(DERIVED_FILE_DIR)/WebCore/ProfilesPanel.js",
                                "$(DERIVED_FILE_DIR)/WebCore/AuditsPanel.js",
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\n# Don't do anything for Production builds, since the Inspector isn't installed.\nif [[ ${CONFIGURATION:=Debug} == \"Debug\" || ${CONFIGURATION:=Production} == \"Production\" ]]; then\n    exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/inspector/combine-javascript-resources.pl\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --generated-scripts-dir \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore\" --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\n# Inline script imports in ElementsPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ElementsPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ElementsPanel.js\"\n\n# Inline script imports in ResourcesPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ResourcesPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ResourcesPanel.js\"\n\n# Inline script imports in TimelinePanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/TimelinePanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/TimelinePanel.js\"\n\n# Inline script imports in ProfilesPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ProfilesPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ProfilesPanel.js\"\n\n# Inline script imports in AuditsPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/AuditsPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/AuditsPanel.js\"\n\n# Inline script imports in CodeMirrorTextEditor.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/CodeMirrorTextEditor.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/CodeMirrorTextEditor.js\"\n\n# Inline script imports in ScriptFormatterWorker.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ScriptFormatterWorker.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ScriptFormatterWorker.js\"\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n    cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n\n    # Remove any top-level JavaScript files, since they will be replaced with the combined file.\n    # Keep InspectorBackend*.js files so they can be used by other front-ends.\n    find . -depth 1 -name \"*.js\" -not -name \"InspectorBackend*.js\" | xargs rm -rf\n\n    # Copy the modified HTML file and the combined scripts.\n    cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n    cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/ElementsPanel.js\" ElementsPanel.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/ResourcesPanel.js\" ResourcesPanel.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/TimelinePanel.js\" TimelinePanel.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/ProfilesPanel.js\" ProfilesPanel.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/AuditsPanel.js\" AuditsPanel.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/CodeMirrorTextEditor.js\" CodeMirrorTextEditor.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/ScriptFormatterWorker.js\" ScriptFormatterWorker.js\nfi\n";
+                       shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\n# Don't do anything for Production builds, since the Inspector isn't installed.\nif [[ ${CONFIGURATION:=Debug} == \"Debug\" || ${CONFIGURATION:=Production} == \"Production\" ]]; then\n    exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/inspector/combine-javascript-resources.pl\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --generated-scripts-dir \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore\" --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\n# Inline script imports in ElementsPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ElementsPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ElementsPanel.js\"\n\n# Inline script imports in ResourcesPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ResourcesPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ResourcesPanel.js\"\n\n# Inline script imports in NetworkPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/NetworkPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/NetworkPanel.js\"\n\n# Inline script imports in TimelinePanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/TimelinePanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/TimelinePanel.js\"\n\n# Inline script imports in ProfilesPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ProfilesPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ProfilesPanel.js\"\n\n# Inline script imports in AuditsPanel.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/AuditsPanel.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/AuditsPanel.js\"\n\n# Inline script imports in CodeMirrorTextEditor.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/CodeMirrorTextEditor.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/CodeMirrorTextEditor.js\"\n\n# Inline script imports in ScriptFormatterWorker.js file.\n\"$SRCROOT/inspector/inline-javascript-imports.py\" \"${SRCROOT}/inspector/front-end/ScriptFormatterWorker.js\" \"${SRCROOT}/inspector/front-end\" \"${DERIVED_FILE_DIR}/WebCore/ScriptFormatterWorker.js\"\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n    cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n\n    # Remove any top-level JavaScript files, since they will be replaced with the combined file.\n    # Keep InspectorBackend*.js files so they can be used by other front-ends.\n    find . -depth 1 -name \"*.js\" -not -name \"InspectorBackend*.js\" | xargs rm -rf\n\n    # Copy the modified HTML file and the combined scripts.\n    cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n    cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/ElementsPanel.js\" ElementsPanel.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/ResourcesPanel.js\" ResourcesPanel.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/NetworkPanel.js\" NetworkPanel.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/TimelinePanel.js\" TimelinePanel.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/ProfilesPanel.js\" ProfilesPanel.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/AuditsPanel.js\" AuditsPanel.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/CodeMirrorTextEditor.js\" CodeMirrorTextEditor.js\n    cp \"${DERIVED_FILE_DIR}/WebCore/ScriptFormatterWorker.js\" ScriptFormatterWorker.js\nfi\n";
                };
                1C81BA330E97357C00266E07 /* Copy Inspector Resources */ = {
                        isa = PBXShellScriptBuildPhase;
index 52a2ca8..95e217b 100644 (file)
  * @param {number=} repeatCount
  * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
  * @param {ConsoleAgent.StackTrace=} stackTrace
- * @param {WebInspector.NetworkRequest=} request
+ * @param {NetworkAgent.RequestId=} requestId
  * @param {boolean=} isOutdated
  */
-WebInspector.ConsoleMessageImpl = function(source, level, message, linkifier, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated)
+WebInspector.ConsoleMessageImpl = function(source, level, message, linkifier, type, url, line, repeatCount, parameters, stackTrace, requestId, isOutdated)
 {
     WebInspector.ConsoleMessage.call(this, source, level, url, line, repeatCount);
 
@@ -54,7 +54,7 @@ WebInspector.ConsoleMessageImpl = function(source, level, message, linkifier, ty
     this._messageText = message;
     this._parameters = parameters;
     this._stackTrace = stackTrace;
-    this._request = request;
+    this._request = requestId ? WebInspector.networkLog.requestForId(requestId) : null;
     this._isOutdated = isOutdated;
 
     this._customFormatters = {
@@ -715,7 +715,7 @@ WebInspector.ConsoleMessageImpl.prototype = {
      */
     clone: function()
     {
-        return WebInspector.ConsoleMessage.create(this.source, this.level, this._messageText, this.type, this.url, this.line, this.repeatCount, this._parameters, this._stackTrace, this._request, this._isOutdated);
+        return WebInspector.ConsoleMessage.create(this.source, this.level, this._messageText, this.type, this.url, this.line, this.repeatCount, this._parameters, this._stackTrace, this._requestId, this._isOutdated);
     }
 }
 
index 5be5a02..2e2abdd 100644 (file)
@@ -202,11 +202,11 @@ WebInspector.ConsoleMessage.prototype = {
  * @param {number=} repeatCount
  * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
  * @param {ConsoleAgent.StackTrace=} stackTrace
- * @param {WebInspector.NetworkRequest=} request
+ * @param {NetworkAgent.RequestId=} requestId
  * @param {boolean=} isOutdated
  * @return {WebInspector.ConsoleMessage}
  */
-WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated)
+WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, requestId, isOutdated)
 {
 }
 
@@ -267,7 +267,7 @@ WebInspector.ConsoleDispatcher.prototype = {
             payload.repeatCount,
             payload.parameters,
             payload.stackTrace,
-            payload.networkRequestId ? WebInspector.networkRequestById(payload.networkRequestId) : undefined,
+            payload.networkRequestId,
             this._console._enablingConsole);
         this._console.addMessage(consoleMessage);
     },
index a81cef1..70ef8e4 100644 (file)
@@ -954,7 +954,7 @@ WebInspector.ConsoleGroup.prototype = {
  */
 WebInspector.consoleView = null;
 
-WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated)
+WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, repeatCount, parameters, stackTrace, requestId, isOutdated)
 {
-    return new WebInspector.ConsoleMessageImpl(source, level, message, WebInspector.consoleView._linkifier, type, url, line, repeatCount, parameters, stackTrace, request, isOutdated);
+    return new WebInspector.ConsoleMessageImpl(source, level, message, WebInspector.consoleView._linkifier, type, url, line, repeatCount, parameters, stackTrace, requestId, isOutdated);
 }
index 8bf6422..9a4b2c7 100644 (file)
@@ -34,6 +34,7 @@
 WebInspector.NetworkLog = function()
 {
     this._requests = [];
+    this._requestForId = {};
     WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this);
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._onMainFrameNavigated, this);
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.OnLoad, this._onLoad, this);
@@ -85,6 +86,7 @@ WebInspector.NetworkLog.prototype = {
     {
         var request = /** @type {WebInspector.NetworkRequest} */ event.data;
         this._requests.push(request);
+        this._requestForId[request.requestId] = request;
         request.__page = this._currentPageLoad;
     },
 
@@ -104,6 +106,15 @@ WebInspector.NetworkLog.prototype = {
     {
         if (this._currentPageLoad)
             this._currentPageLoad.loadTime = event.data;
+    },
+
+    /**
+     * @param {NetworkAgent.RequestId} requestId
+     * @return {?WebInspector.NetworkRequest}
+     */
+    requestForId: function(requestId)
+    {
+        return this._requestForId[requestId];
     }
 }
 
index ecf6a59..ddfd953 100644 (file)
@@ -197,7 +197,7 @@ WebInspector.NetworkDispatcher.prototype = {
                 1,
                 [],
                 null,
-                networkRequest));
+                networkRequest.requestId));
         }
     },
 
index fff9d95..697fd0d 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+importScript("RequestView.js");
+importScript("ResourceView.js");
+importScript("FontView.js");
+importScript("ImageView.js");
+importScript("NetworkItemView.js");
+importScript("RequestCookiesView.js");
+importScript("RequestHeadersView.js");
+importScript("RequestHTMLView.js");
+importScript("RequestJSONView.js");
+importScript("RequestPreviewView.js");
+importScript("RequestResponseView.js");
+importScript("RequestTimingView.js");
+importScript("ResourceWebSocketFrameView.js");
+
 /**
  * @constructor
  * @extends {WebInspector.View}
@@ -77,6 +91,8 @@ WebInspector.NetworkLogView = function()
         this._canClearBrowserCookies = result;
     }
     NetworkAgent.canClearBrowserCookies(onCanClearBrowserCookies.bind(this));
+
+    WebInspector.networkLog.requests.forEach(this._appendRequest.bind(this));
 }
 
 WebInspector.NetworkLogView.prototype = {
index dbd80ed..dcd2b84 100644 (file)
@@ -199,9 +199,7 @@ WebInspector.ScriptSnippetModel.prototype = {
                 var consoleMessage = WebInspector.ConsoleMessage.create(
                         WebInspector.ConsoleMessage.MessageSource.JS,
                         WebInspector.ConsoleMessage.MessageLevel.Error,
-                        syntaxErrorMessage || "",
-                        WebInspector.ConsoleMessage.MessageType.Log,
-                        "", 0, 1, null, null, null);
+                        syntaxErrorMessage || "");
                 WebInspector.console.addMessage(consoleMessage);
                 return;
             }
index 28acd87..ac508bf 100644 (file)
@@ -119,14 +119,6 @@ InspectorBackend.runAfterPendingDispatches = function(message) {}
 
 // FIXME: remove everything below.
 var WebInspector = {}
-
-/**
- * @param {NetworkAgent.RequestId} requestId
- * @return {?WebInspector.NetworkRequest}
- */
-WebInspector.networkRequestById = function(requestId)
-{
-}
   
 WebInspector.panels = {};
 
index 497144e..8c9064a 100644 (file)
@@ -108,13 +108,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="CSSKeywordCompletions.js"></script>
     <script type="text/javascript" src="PanelEnablerView.js"></script>
     <script type="text/javascript" src="StatusBarButton.js"></script>
-    <script type="text/javascript" src="NetworkPanel.js"></script>
     <script type="text/javascript" src="TextEditor.js"></script>
     <script type="text/javascript" src="DefaultTextEditor.js"></script>
     <script type="text/javascript" src="SourceFrame.js"></script>
     <script type="text/javascript" src="UISourceCodeFrame.js"></script>
-    <script type="text/javascript" src="ResourceView.js"></script>
-    <script type="text/javascript" src="RequestView.js"></script>
     <script type="text/javascript" src="JavaScriptSourceFrame.js"></script>
     <script type="text/javascript" src="SplitView.js"></script>
     <script type="text/javascript" src="TabbedEditorContainer.js"></script>
@@ -127,16 +124,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="ExtensionServer.js"></script>
     <script type="text/javascript" src="ExtensionView.js"></script>
     <script type="text/javascript" src="ExtensionPanel.js"></script>
-    <script type="text/javascript" src="NetworkItemView.js"></script>
     <script type="text/javascript" src="EmptyView.js"></script>
-    <script type="text/javascript" src="RequestHeadersView.js"></script>
-    <script type="text/javascript" src="RequestCookiesView.js"></script>
-    <script type="text/javascript" src="RequestTimingView.js"></script>
-    <script type="text/javascript" src="RequestJSONView.js"></script>
-    <script type="text/javascript" src="RequestHTMLView.js"></script>
-    <script type="text/javascript" src="RequestResponseView.js"></script>
-    <script type="text/javascript" src="RequestPreviewView.js"></script>
-    <script type="text/javascript" src="ResourceWebSocketFrameView.js"></script>
     <script type="text/javascript" src="ScriptFormatter.js"></script>
     <script type="text/javascript" src="DOMSyntaxHighlighter.js"></script>
     <script type="text/javascript" src="TextEditorModel.js"></script>
@@ -147,8 +135,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="SourceJavaScriptTokenizer.js"></script>
     <script type="text/javascript" src="FileSystemModel.js"></script>
     <script type="text/javascript" src="FileUtils.js"></script>
-    <script type="text/javascript" src="FontView.js"></script>
-    <script type="text/javascript" src="ImageView.js"></script>
     <script type="text/javascript" src="DebuggerModel.js"></script>
     <script type="text/javascript" src="SourceMapping.js"></script>
     <script type="text/javascript" src="UISourceCode.js"></script>
index 00a1dd0..4d587c2 100644 (file)
@@ -39,7 +39,7 @@ var WebInspector = {
 
         var elements = new WebInspector.PanelDescriptor("elements", WebInspector.UIString("Elements"), "ElementsPanel", "ElementsPanel.js");
         var resources = new WebInspector.PanelDescriptor("resources", WebInspector.UIString("Resources"), "ResourcesPanel", "ResourcesPanel.js");
-        var network = new WebInspector.PanelDescriptor("network", WebInspector.UIString("Network"), undefined, undefined, new WebInspector.NetworkPanel());
+        var network = new WebInspector.PanelDescriptor("network", WebInspector.UIString("Network"), "NetworkPanel", "NetworkPanel.js");
         var scripts = new WebInspector.PanelDescriptor("scripts", WebInspector.UIString("Sources"), undefined, undefined, new WebInspector.ScriptsPanel());
         var timeline = new WebInspector.PanelDescriptor("timeline", WebInspector.UIString("Timeline"), "TimelinePanel", "TimelinePanel.js");
         var profiles = new WebInspector.PanelDescriptor("profiles", WebInspector.UIString("Profiles"), "ProfilesPanel", "ProfilesPanel.js");
@@ -326,15 +326,6 @@ var WebInspector = {
             errorWarningElement.title = null;
     },
 
-    /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @return {?WebInspector.NetworkRequest}
-     */
-    networkRequestById: function(requestId)
-    {
-        return this.panels.network.requestById(requestId);
-    },
-
     get inspectedPageDomain()
     {
         var parsedURL = WebInspector.inspectedPageURL && WebInspector.inspectedPageURL.asParsedURL();
@@ -1037,7 +1028,7 @@ WebInspector._showAnchorLocation = function(anchor)
         return true;
     if (WebInspector._showAnchorLocationInPanel(anchor, this.panel("resources")))
         return true;
-    if (WebInspector._showAnchorLocationInPanel(anchor, this.panels.network))
+    if (WebInspector._showAnchorLocationInPanel(anchor, this.panel("network")))
         return true;
     return false;
 }
index 4adb730..c476d3c 100644 (file)
@@ -1,3 +1,12 @@
+2012-08-19  Pavel Feldman  <pfeldman@chromium.org>
+
+        Web Inspector: load network panel lazily
+        https://bugs.webkit.org/show_bug.cgi?id=94414
+
+        Reviewed by Vsevolod Vlasov.
+
+        * WebKit.gyp:
+
 2012-08-18  Pavel Feldman  <pfeldman@chromium.org>
 
         Web Inspector: make profiles panel a lazily loaded module.
index a6ea5f0..61ecd12 100644 (file)
                     'dependencies': ['concatenated_devtools_js',
                                      'concatenated_devtools_elements_js',
                                      'concatenated_devtools_resources_js',
+                                     'concatenated_devtools_network_js',
                                      'concatenated_devtools_timeline_js',
                                      'concatenated_devtools_profiles_js',
                                      'concatenated_devtools_audits_js',
                     'dependencies': ['concatenated_devtools_js',
                                      'concatenated_devtools_elements_js',
                                      'concatenated_devtools_resources_js',
+                                     'concatenated_devtools_network_js',
                                      'concatenated_devtools_timeline_js',
                                      'concatenated_devtools_profiles_js',
                                      'concatenated_devtools_audits_js',
                     '<(PRODUCT_DIR)/resources/inspector/DevTools.js',
                     '<(PRODUCT_DIR)/resources/inspector/ElementsPanel.js',
                     '<(PRODUCT_DIR)/resources/inspector/ResourcesPanel.js',
+                    '<(PRODUCT_DIR)/resources/inspector/NetworkPanel.js',
                     '<(PRODUCT_DIR)/resources/inspector/TimelinePanel.js',
                     '<(PRODUCT_DIR)/resources/inspector/ProfilesPanel.js',
                     '<(PRODUCT_DIR)/resources/inspector/AuditsPanel.js',
                     }],
                 },
                 {
+                    'target_name': 'concatenated_devtools_network_js',
+                    'type': 'none',
+                    'actions': [{
+                        'action_name': 'concatenate_devtools_network_js',
+                        'script_name': 'scripts/inline_js_imports.py',
+                        'input_file': '../../WebCore/inspector/front-end/NetworkPanel.js',
+                        'inputs': [
+                            '<@(_script_name)',
+                            '<@(webinspector_network_js_files)',
+                        ],
+                        'search_path': '../../WebCore/inspector/front-end',
+                        'outputs': ['<(PRODUCT_DIR)/resources/inspector/NetworkPanel.js'],
+                        'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'],
+                    }],
+                },
+                {
                     'target_name': 'concatenated_devtools_timeline_js',
                     'type': 'none',
                     'actions': [{