2010-11-01 Pavel Feldman <pfeldman@chromium.org>
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Nov 2010 17:56:20 +0000 (17:56 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Nov 2010 17:56:20 +0000 (17:56 +0000)
        Reviewed by Timothy Hatcher.

        Web Inspector: remove old resources panel.
        https://bugs.webkit.org/show_bug.cgi?id=45657

        * CMakeLists.txt:
        * English.lproj/localizedStrings.js:
        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSInjectedScriptHostCustom.cpp:
        * inspector/InjectedScriptHost.cpp:
        * inspector/Inspector.idl:
        * inspector/InspectorCSSStore.cpp:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::~InspectorController):
        (WebCore::InspectorController::connectFrontend):
        (WebCore::InspectorController::releaseFrontendLifetimeAgents):
        (WebCore::InspectorController::populateScriptObjects):
        (WebCore::InspectorController::unbindAllResources):
        (WebCore::InspectorController::didCommitLoad):
        (WebCore::InspectorController::frameDetachedFromParent):
        (WebCore::InspectorController::didLoadResourceFromMemoryCache):
        (WebCore::InspectorController::identifierForInitialRequest):
        (WebCore::InspectorController::willSendRequest):
        (WebCore::InspectorController::markResourceAsCached):
        (WebCore::InspectorController::didReceiveResponse):
        (WebCore::InspectorController::didReceiveContentLength):
        (WebCore::InspectorController::didFinishLoading):
        (WebCore::InspectorController::didFailLoading):
        (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
        (WebCore::InspectorController::scriptImported):
        (WebCore::InspectorController::didCreateWebSocket):
        (WebCore::InspectorController::willSendWebSocketHandshakeRequest):
        (WebCore::InspectorController::didReceiveWebSocketHandshakeResponse):
        (WebCore::InspectorController::didCloseWebSocket):
        * inspector/InspectorController.h:
        * inspector/InspectorFrontendHost.cpp:
        * inspector/InspectorResource.cpp: Removed.
        * inspector/InspectorResource.h: Removed.
        * inspector/InspectorResourceAgent.cpp:
        (WebCore::InspectorResourceAgent::setOverrideContent):
        * inspector/InspectorResourceAgent.h:
        * inspector/front-end/ConsoleView.js:
        (WebInspector.ConsoleView.prototype.addMessage):
        (WebInspector.ConsoleView.prototype.clearMessages):
        * inspector/front-end/ExtensionServer.js:
        (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
        * inspector/front-end/Images/resourcesSilhouette.png: Removed.
        * inspector/front-end/Resource.js:
        * inspector/front-end/ResourceManager.js:
        (WebInspector.ResourceManager.getContent):
        * inspector/front-end/ResourcesPanel.js: Removed.
        * inspector/front-end/Settings.js:
        * inspector/front-end/StoragePanel.js:
        (WebInspector.StoragePanel):
        (WebInspector.StoragePanel.prototype.get toolbarItemLabel):
        * inspector/front-end/WebKit.qrc:
        * inspector/front-end/inspector.html:
        * inspector/front-end/inspector.js:
        (WebInspector._createPanels):
        (WebInspector.get networkResources):
        (WebInspector.forAllResources):
        (WebInspector.resourceForURL):
        (WebInspector.doLoadedDone.populateInspectorState):
        (WebInspector.openResource):
        (WebInspector.domContentEventFired):
        (WebInspector.loadEventFired):
        (WebInspector.reset):
        (WebInspector._choosePanelToShowSourceLine):

2010-11-01  Pavel Feldman  <pfeldman@chromium.org>

        Reviewed by Timothy Hatcher.

        Web Inspector: remove old resources panel.
        https://bugs.webkit.org/show_bug.cgi?id=45657

        * src/WebDevToolsAgentImpl.cpp:
        (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled):
        * src/WebDevToolsAgentImpl.h:

2010-11-01  Pavel Feldman  <pfeldman@chromium.org>

        Reviewed by Timothy Hatcher.

        Web Inspector: remove old resources panel.
        https://bugs.webkit.org/show_bug.cgi?id=45657

        * http/tests/inspector/inspector-test2.js:
        * http/tests/inspector/resource-har-conversion.html:
        * http/tests/inspector/resource-parameters.html:
        * inspector/audits-panel-functional.html:
        * inspector/extensions-test.js:
        * inspector/report-protocol-errors-expected.txt:
        * inspector/report-protocol-errors.html:
        * inspector/styles-source-offsets.html:

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

42 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/inspector-test2.js
LayoutTests/http/tests/inspector/resource-har-conversion.html
LayoutTests/http/tests/inspector/resource-parameters.html
LayoutTests/inspector/audits-panel-functional.html
LayoutTests/inspector/extensions-test.js
LayoutTests/inspector/report-protocol-errors-expected.txt
LayoutTests/inspector/report-protocol-errors.html
LayoutTests/inspector/styles-source-offsets.html
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/English.lproj/localizedStrings.js
WebCore/GNUmakefile.am
WebCore/WebCore.gypi
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
WebCore/inspector/InjectedScriptHost.cpp
WebCore/inspector/Inspector.idl
WebCore/inspector/InspectorCSSStore.cpp
WebCore/inspector/InspectorController.cpp
WebCore/inspector/InspectorController.h
WebCore/inspector/InspectorFrontendHost.cpp
WebCore/inspector/InspectorResource.cpp [deleted file]
WebCore/inspector/InspectorResource.h [deleted file]
WebCore/inspector/InspectorResourceAgent.cpp
WebCore/inspector/InspectorResourceAgent.h
WebCore/inspector/front-end/ConsoleView.js
WebCore/inspector/front-end/ExtensionServer.js
WebCore/inspector/front-end/Images/resourcesSilhouette.png [deleted file]
WebCore/inspector/front-end/Resource.js
WebCore/inspector/front-end/ResourceManager.js
WebCore/inspector/front-end/ResourcesPanel.js [deleted file]
WebCore/inspector/front-end/Settings.js
WebCore/inspector/front-end/StoragePanel.js
WebCore/inspector/front-end/WebKit.qrc
WebCore/inspector/front-end/inspector.html
WebCore/inspector/front-end/inspector.js
WebKit/chromium/ChangeLog
WebKit/chromium/src/WebDevToolsAgentImpl.cpp
WebKit/chromium/src/WebDevToolsAgentImpl.h

index b843ffa..569d762 100644 (file)
@@ -1,3 +1,19 @@
+2010-11-01  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: remove old resources panel.
+        https://bugs.webkit.org/show_bug.cgi?id=45657
+
+        * http/tests/inspector/inspector-test2.js:
+        * http/tests/inspector/resource-har-conversion.html:
+        * http/tests/inspector/resource-parameters.html:
+        * inspector/audits-panel-functional.html:
+        * inspector/extensions-test.js:
+        * inspector/report-protocol-errors-expected.txt:
+        * inspector/report-protocol-errors.html:
+        * inspector/styles-source-offsets.html:
+
 2010-11-01  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Unreviewed.
index 27294b2..6db579c 100644 (file)
@@ -107,30 +107,6 @@ InspectorTest.runAfterPendingDispatches = function(callback)
     WebInspector.TestController.prototype.runAfterPendingDispatches(callback);
 }
 
-InspectorTest.enableResourceTracking = function(callback)
-{
-    if (Preferences.networkPanelEnabled) {
-        InspectorTest.reloadPageIfNeeded(callback);
-        return;
-    }
-
-    if (WebInspector.panels.resources.resourceTrackingEnabled)
-        callback();
-    else {
-        InspectorTest._reloadPageCallback = callback;
-        WebInspector.panels.resources.toggleResourceTracking();
-    }
-}
-
-InspectorTest.disableResourceTracking = function()
-{
-    if (Preferences.networkPanelEnabled)
-        return;
-
-    if (WebInspector.panels.resources.resourceTrackingEnabled)
-        WebInspector.panels.resources.toggleResourceTracking();
-}
-
 InspectorTest.findDOMNode = function(root, filter, callback)
 {
     var found = false;
index 2229e56..4db518e 100644 (file)
@@ -30,12 +30,11 @@ var test = function()
         }
     }
 
-    InspectorTest.enableResourceTracking(function() {
+    InspectorTest.reloadPageIfNeeded(function() {
         InjectedScriptAccess.getDefault().evaluate("doXHR()", "console", function() {
             addCookieHeadersToResource(findResourceByURL(/inspector-test2\.js$/));
             var resources = Object.keys(WebInspector.networkResources).map(getHAR).sort(InspectorTest.resourceURLComparer);
             InspectorTest.addObject(resources, InspectorTest.HARNondeterministicPropertiesWithSize);
-            InspectorTest.disableResourceTracking();
             InspectorTest.completeTest();
         });
     });
index 3da6030..6d612d4 100644 (file)
@@ -6,15 +6,8 @@
 <script>
 function doit()
 {
-    function callback(result)
-    {
-        if (result === "enabling")
-            return;
-        window.submitCalled = true;
-        document.getElementById("submit").click();
-    }
-
-    evaluateInWebInspector("frontend_enableResourceTracking", callback);
+    window.submitCalled = true;
+    document.getElementById("submit").click();
 }
 
 function onIframeLoad()
@@ -30,29 +23,10 @@ function onIframeLoad()
     evaluateInWebInspector("frontend_dumpFormData", callback);
 }
 
-function frontend_enableResourceTracking(testController)
-{
-    if (Preferences.networkPanelEnabled) {
-        if (!WebInspector.panels.network._pageWasReloaded) {
-            WebInspector.panels.network._pageWasReloaded = true;
-            WebInspector.panels.network._reset();
-            InspectorBackend.reloadPage();
-            return "enabling";
-        }
-    } else if (!WebInspector.panels.resources.resourceTrackingEnabled) {
-        WebInspector.panels.resources.toggleResourceTracking();
-        return "enabling";
-    }
-    return "enabled";
-}
-
 function frontend_dumpFormData(testController)
 {
     var resource = WebInspector.resourceForURL("http://localhost:8000/inspector/resources/post-target.cgi?queryParam1=queryValue1&queryParam2=");
 
-    if (!Preferences.networkPanelEnabled)
-        WebInspector.panels.resources.toggleResourceTracking();
-
     if (!resource) {
         testController.notifyDone("No resource found");
         return;
index e020855..17f5c61 100644 (file)
@@ -33,15 +33,10 @@ function doit()
 
 function frontend_runAudits(testController)
 {
-    if (Preferences.networkPanelEnabled) {
-        if (!WebInspector.panels.network._pageWasReloaded) {
-            WebInspector.panels.network._pageWasReloaded = true;
-            WebInspector.panels.network._reset();
-            InspectorBackend.reloadPage();
-            return "refreshing";
-        }
-    } else if (!WebInspector.panels.resources.resourceTrackingEnabled) {
-        WebInspector.panels.resources.toggleResourceTracking();
+    if (!WebInspector.panels.network._pageWasReloaded) {
+        WebInspector.panels.network._pageWasReloaded = true;
+        WebInspector.panels.network._reset();
+        InspectorBackend.reloadPage();
         return "refreshing";
     }
 
@@ -59,14 +54,7 @@ function frontend_runAudits(testController)
             // Audits are done, check results.
             var output = frontend_collectAuditResults();
             // Avoid influencing tests that require resource tracking to be disabled.
-            if (Preferences.networkPanelEnabled) {
-                testController.notifyDone(output.join("\n"));
-            } else {
-                WebInspector.panels.resources.toggleResourceTracking();
-                testController.runAfterPendingDispatches(function() {
-                    testController.notifyDone(output.join("\n"));
-                });
-            }
+            testController.notifyDone(output.join("\n"));
         });
     } catch(e) {
         testController.notifyDone("Exception: " + e.toString());
index cd9f293..4dc2fb4 100644 (file)
@@ -41,10 +41,9 @@ InspectorTest.runExtensionTests = function()
         });
     } 
     InspectorTest.dispatchOnMessage("extension-tests-done", function() {
-        InspectorTest.disableResourceTracking();
         InspectorTest.completeTest();
     });
-    InspectorTest.enableResourceTracking(addExtension);
+    InspectorTest.reloadPageIfNeeded(addExtension);
 }
 
 }
index 8a3cbfd..f10273b 100644 (file)
@@ -60,16 +60,18 @@ Tests that InspectorBackendDispatcher is catching incorrect messages.
     seq : 4
     success : false
     errors : {
-        0 : "Protocol Error: Argument 'identifier' with type 'Number' was not found."
-        1 : "Protocol Error: Argument 'encode' with type 'Boolean' was not found."
+        0 : "Protocol Error: Argument 'frameId' with type 'Number' was not found."
+        1 : "Protocol Error: Argument 'url' with type 'String' was not found."
+        2 : "Protocol Error: Argument 'base64Encode' with type 'Boolean' was not found."
     }
 }
 {
     seq : 5
     success : false
     errors : {
-        0 : "Protocol Error: Argument 'identifier' has wrong type. It should be 'Number'."
-        1 : "Protocol Error: Argument 'encode' with type 'Boolean' was not found."
+        0 : "Protocol Error: Argument 'frameId' with type 'Number' was not found."
+        1 : "Protocol Error: Argument 'url' with type 'String' was not found."
+        2 : "Protocol Error: Argument 'base64Encode' with type 'Boolean' was not found."
     }
 }
 {
index cd7ba5c..4730ae4 100644 (file)
@@ -12,10 +12,10 @@ function test()
         '{"command":"test"}',
         '{"seq":"not a number","command":"test"}',
         '{"seq":1,"command":"test"}',
-        '{"seq":2,"command":"getResourceContent"}',
-        '{"seq":3,"command":"getResourceContent","arguments":[]}',
-        '{"seq":4,"command":"getResourceContent","arguments":{}}',
-        '{"seq":5,"command":"getResourceContent","arguments":{"identifier":"not a number"}}',
+        '{"seq":2,"command":"resourceContent"}',
+        '{"seq":3,"command":"resourceContent","arguments":[]}',
+        '{"seq":4,"command":"resourceContent","arguments":{}}',
+        '{"seq":5,"command":"resourceContent","arguments":{"identifier":"not a number"}}',
         '{"seq":6,"command":"removeBreakpoint","arguments":{}}',
         '{"seq":7,"command":"removeBreakpoint","arguments":{"sourceID":"someSourceId","lineNumber":0}}',
 
index 746e7e8..15a3727 100644 (file)
@@ -24,11 +24,6 @@ function doit()
 
 function frontend_runTest(testController)
 {
-    if (!Preferences.networkPanelEnabled && !WebInspector.panels.resources.resourceTrackingEnabled) {
-        WebInspector.panels.resources.toggleResourceTracking();
-        return "refreshing";
-    }
-
     testController.waitUntilDone();
     frontend_expandDOMSubtree(WebInspector.domAgent.document);
     testController.runAfterPendingDispatches(function() {
index 4b05477..bba7a33 100644 (file)
@@ -1124,7 +1124,6 @@ SET(WebCore_SOURCES
     inspector/InspectorFrontendHost.cpp
     inspector/InspectorInstrumentation.cpp
     inspector/InspectorProfilerAgent.cpp
-    inspector/InspectorResource.cpp
     inspector/InspectorResourceAgent.cpp
     inspector/InspectorStyleSheet.cpp
     inspector/InspectorValues.cpp
index 377a9d1..f3b9832 100644 (file)
@@ -1,3 +1,78 @@
+2010-11-01  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: remove old resources panel.
+        https://bugs.webkit.org/show_bug.cgi?id=45657
+
+        * CMakeLists.txt:
+        * English.lproj/localizedStrings.js:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        * inspector/InjectedScriptHost.cpp:
+        * inspector/Inspector.idl:
+        * inspector/InspectorCSSStore.cpp:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::~InspectorController):
+        (WebCore::InspectorController::connectFrontend):
+        (WebCore::InspectorController::releaseFrontendLifetimeAgents):
+        (WebCore::InspectorController::populateScriptObjects):
+        (WebCore::InspectorController::unbindAllResources):
+        (WebCore::InspectorController::didCommitLoad):
+        (WebCore::InspectorController::frameDetachedFromParent):
+        (WebCore::InspectorController::didLoadResourceFromMemoryCache):
+        (WebCore::InspectorController::identifierForInitialRequest):
+        (WebCore::InspectorController::willSendRequest):
+        (WebCore::InspectorController::markResourceAsCached):
+        (WebCore::InspectorController::didReceiveResponse):
+        (WebCore::InspectorController::didReceiveContentLength):
+        (WebCore::InspectorController::didFinishLoading):
+        (WebCore::InspectorController::didFailLoading):
+        (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
+        (WebCore::InspectorController::scriptImported):
+        (WebCore::InspectorController::didCreateWebSocket):
+        (WebCore::InspectorController::willSendWebSocketHandshakeRequest):
+        (WebCore::InspectorController::didReceiveWebSocketHandshakeResponse):
+        (WebCore::InspectorController::didCloseWebSocket):
+        * inspector/InspectorController.h:
+        * inspector/InspectorFrontendHost.cpp:
+        * inspector/InspectorResource.cpp: Removed.
+        * inspector/InspectorResource.h: Removed.
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::setOverrideContent):
+        * inspector/InspectorResourceAgent.h:
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype.addMessage):
+        (WebInspector.ConsoleView.prototype.clearMessages):
+        * inspector/front-end/ExtensionServer.js:
+        (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
+        * inspector/front-end/Images/resourcesSilhouette.png: Removed.
+        * inspector/front-end/Resource.js:
+        * inspector/front-end/ResourceManager.js:
+        (WebInspector.ResourceManager.getContent):
+        * inspector/front-end/ResourcesPanel.js: Removed.
+        * inspector/front-end/Settings.js:
+        * inspector/front-end/StoragePanel.js:
+        (WebInspector.StoragePanel):
+        (WebInspector.StoragePanel.prototype.get toolbarItemLabel):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/inspector.html:
+        * inspector/front-end/inspector.js:
+        (WebInspector._createPanels):
+        (WebInspector.get networkResources):
+        (WebInspector.forAllResources):
+        (WebInspector.resourceForURL):
+        (WebInspector.doLoadedDone.populateInspectorState):
+        (WebInspector.openResource):
+        (WebInspector.domContentEventFired):
+        (WebInspector.loadEventFired):
+        (WebInspector.reset):
+        (WebInspector._choosePanelToShowSourceLine):
+
 2010-10-28  Zhenyao Mo  <zmo@google.com>
 
         Reviewed by Kenneth Russell.
index 57ae52d..cf39906 100644 (file)
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
index becbb81..b424388 100644 (file)
@@ -1854,8 +1854,6 @@ webcore_sources += \
        WebCore/inspector/InspectorInstrumentation.h \
        WebCore/inspector/InspectorProfilerAgent.cpp \
        WebCore/inspector/InspectorProfilerAgent.h \
-       WebCore/inspector/InspectorResource.cpp \
-       WebCore/inspector/InspectorResource.h \
        WebCore/inspector/InspectorResourceAgent.cpp \
        WebCore/inspector/InspectorResourceAgent.h \
        WebCore/inspector/InspectorState.cpp \
index d9c5e39..8ac303d 100644 (file)
             'inspector/InspectorInstrumentation.h',
             'inspector/InspectorProfilerAgent.cpp',
             'inspector/InspectorProfilerAgent.h',
-            'inspector/InspectorResource.cpp',
-            'inspector/InspectorResource.h',
             'inspector/InspectorResourceAgent.cpp',
             'inspector/InspectorResourceAgent.h',
             'inspector/InspectorState.cpp',
             'inspector/front-end/Resource.js',
             'inspector/front-end/ResourceCategory.js',
             'inspector/front-end/ResourceManager.js',
-            'inspector/front-end/ResourcesPanel.js',
             'inspector/front-end/ResourceView.js',
             'inspector/front-end/ScopeChainSidebarPane.js',
             'inspector/front-end/Script.js',
index 4f3ecc0..44d544d 100644 (file)
@@ -1015,7 +1015,6 @@ SOURCES += \
     inspector/InspectorFrontendHost.cpp \
     inspector/InspectorInstrumentation.cpp \
     inspector/InspectorProfilerAgent.cpp \
-    inspector/InspectorResource.cpp \
     inspector/InspectorResourceAgent.cpp \
     inspector/InspectorState.cpp \
     inspector/InspectorStorageAgent.cpp \
index 65056f7..bc1f890 100644 (file)
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\inspector\InspectorResource.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\inspector\InspectorResource.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath="..\inspector\InspectorResourceAgent.cpp"\r
                                >\r
                        </File>\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\inspector\front-end\ResourcesPanel.js"\r
-                                       >\r
-                               </File>\r
-                               <File\r
                                        RelativePath="..\inspector\front-end\ResourceView.js"\r
                                        >\r
                                </File>\r
index c1bf23b..b3a8d86 100644 (file)
                41F061750F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */; };
                41F0618E0F5F069800A07EAC /* ConsoleMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F0618C0F5F069800A07EAC /* ConsoleMessage.h */; };
                41F0618F0F5F069800A07EAC /* ConsoleMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F0618D0F5F069800A07EAC /* ConsoleMessage.cpp */; };
-               41F062010F5F0B6600A07EAC /* InspectorResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F061FF0F5F0B6600A07EAC /* InspectorResource.h */; };
-               41F062020F5F0B6600A07EAC /* InspectorResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F062000F5F0B6600A07EAC /* InspectorResource.cpp */; };
                41F062140F5F192600A07EAC /* InspectorDatabaseResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F062120F5F192600A07EAC /* InspectorDatabaseResource.h */; };
                41F062150F5F192600A07EAC /* InspectorDatabaseResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F062130F5F192600A07EAC /* InspectorDatabaseResource.cpp */; };
                41F066E40F64BCF600A07EAC /* ScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F066E20F64BCF600A07EAC /* ScriptObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
                41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMStorageResource.cpp; sourceTree = "<group>"; };
                41F0618C0F5F069800A07EAC /* ConsoleMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleMessage.h; sourceTree = "<group>"; };
                41F0618D0F5F069800A07EAC /* ConsoleMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConsoleMessage.cpp; sourceTree = "<group>"; };
-               41F061FF0F5F0B6600A07EAC /* InspectorResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorResource.h; sourceTree = "<group>"; };
-               41F062000F5F0B6600A07EAC /* InspectorResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorResource.cpp; sourceTree = "<group>"; };
                41F062120F5F192600A07EAC /* InspectorDatabaseResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseResource.h; sourceTree = "<group>"; };
                41F062130F5F192600A07EAC /* InspectorDatabaseResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDatabaseResource.cpp; sourceTree = "<group>"; };
                41F066E20F64BCF600A07EAC /* ScriptObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptObject.h; sourceTree = "<group>"; };
                                20D629251253690B00081543 /* InspectorInstrumentation.h */,
                                9F0D6B2C121BFEBA006C0288 /* InspectorProfilerAgent.cpp */,
                                9F0D6B2D121BFEBA006C0288 /* InspectorProfilerAgent.h */,
-                               41F062000F5F0B6600A07EAC /* InspectorResource.cpp */,
-                               41F061FF0F5F0B6600A07EAC /* InspectorResource.h */,
                                82AB1771125C826700C5069D /* InspectorResourceAgent.cpp */,
                                82AB1772125C826700C5069D /* InspectorResourceAgent.h */,
                                4FA3B908125CD12100300BAD /* InspectorState.cpp */,
                                7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */,
                                20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */,
                                9F0D6B2F121BFEBA006C0288 /* InspectorProfilerAgent.h in Headers */,
-                               41F062010F5F0B6600A07EAC /* InspectorResource.h in Headers */,
                                82AB1776125C826700C5069D /* InspectorResourceAgent.h in Headers */,
                                4FA3B90B125CD12200300BAD /* InspectorState.h in Headers */,
                                7AB0B1C11211A62200A76940 /* InspectorStorageAgent.h in Headers */,
                                7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */,
                                20D629261253690B00081543 /* InspectorInstrumentation.cpp in Sources */,
                                9F0D6B2E121BFEBA006C0288 /* InspectorProfilerAgent.cpp in Sources */,
-                               41F062020F5F0B6600A07EAC /* InspectorResource.cpp in Sources */,
                                82AB1775125C826700C5069D /* InspectorResourceAgent.cpp in Sources */,
                                4FA3B90A125CD12200300BAD /* InspectorState.cpp in Sources */,
                                7AB0B1C01211A62200A76940 /* InspectorStorageAgent.cpp in Sources */,
index 818d549..9cf4604 100644 (file)
@@ -47,7 +47,6 @@
 #include "InjectedScript.h"
 #include "InjectedScriptHost.h"
 #include "InspectorController.h"
-#include "InspectorResource.h"
 #include "InspectorValues.h"
 #include "JSDOMWindow.h"
 #include "JSDOMWindowCustom.h"
index 06b25fe..415a2e5 100644 (file)
@@ -43,7 +43,6 @@
 #include "InspectorController.h"
 #include "InspectorDOMAgent.h"
 #include "InspectorFrontend.h"
-#include "InspectorResource.h"
 #include "Pasteboard.h"
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
index e6e0a7f..7d317b1 100644 (file)
@@ -46,7 +46,6 @@ module core {
         [notify] void domContentEventFired(out double time);
         [notify] void inspectedURLChanged(out String url);
         [notify] void loadEventFired(out double time);
-        [notify] void removeResource(out unsigned long identifier);
         [notify] void reset();
         [notify] void resetProfilesPanel();
         [notify] void setChildNodes(out long parentId, out Array nodes);
@@ -56,7 +55,6 @@ module core {
         [notify] void timelineProfilerWasStarted();
         [notify] void timelineProfilerWasStopped();
         [notify] void updateFocusedNode(out long nodeId);
-        [notify] void updateResource(out Value resource);
 
 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
         [notify] void addProfileHeader(out Object header);
@@ -100,8 +98,6 @@ module core {
 
         [handler=Controller] void setMonitoringXHREnabled(in boolean enable, out boolean newState);
 
-        [handler=Controller] void setResourceTrackingEnabled(in boolean enabled, in boolean always, out boolean newState);
-        [handler=Controller] void getResourceContent(in unsigned long identifier, in boolean encode, out String content);
         [handler=Controller] void reloadPage();
 
         [handler=Controller] void startTimelineProfiler();
index b75f11b..08634cb 100644 (file)
@@ -43,7 +43,6 @@
 #include "Frame.h"
 #include "HTMLHeadElement.h"
 #include "InspectorController.h"
-#include "InspectorResource.h"
 #include "InspectorResourceAgent.h"
 #include "Node.h"
 #include "PlatformString.h"
index 1bb3919..0e1a388 100644 (file)
 #include <wtf/StdLibExtras.h>
 #include <wtf/UnusedParam.h>
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-#include "InspectorResource.h"
-#endif
-
 #if ENABLE(DATABASE)
 #include "Database.h"
 #endif
@@ -174,10 +170,6 @@ InspectorController::~InspectorController()
     ASSERT(!m_inspectedPage);
     ASSERT(!m_highlightedNode);
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    deleteAllValues(m_frameResources);
-#endif
-
     releaseFrontendLifetimeAgents();
 
     m_inspectorBackend->disconnectController();
@@ -233,13 +225,6 @@ bool InspectorController::searchingForNodeInPage() const
     return m_state->getBoolean(InspectorState::searchingForNode);
 }
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-bool InspectorController::resourceTrackingEnabled() const
-{
-    return m_state->getBoolean(InspectorState::resourceTrackingEnabled);
-}
-#endif
-
 void InspectorController::getInspectorState(RefPtr<InspectorObject>* state)
 {
 #if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -485,10 +470,7 @@ void InspectorController::connectFrontend()
     releaseFrontendLifetimeAgents();
     m_frontend = new InspectorFrontend(m_client);
     m_domAgent = InspectorDOMAgent::create(m_cssStore.get(), m_frontend.get());
-
-#if !LEGACY_RESOURCE_TRACKING_ENABLED
     m_resourceAgent = InspectorResourceAgent::create(m_inspectedPage, m_frontend.get());
-#endif
 
 #if ENABLE(DATABASE)
     m_storageAgent = InspectorStorageAgent::create(m_frontend.get());
@@ -594,9 +576,7 @@ void InspectorController::disconnectFrontend()
 
 void InspectorController::releaseFrontendLifetimeAgents()
 {
-#if !LEGACY_RESOURCE_TRACKING_ENABLED
     m_resourceAgent.clear();
-#endif
 
     // m_domAgent is RefPtr. Remove DOM listeners first to ensure that there are
     // no references to the DOM agent from the DOM tree.
@@ -637,12 +617,6 @@ void InspectorController::populateScriptObjects()
         m_frontend->profilerWasEnabled();
 #endif
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    ResourcesMap::iterator resourcesEnd = m_resources.end();
-    for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
-        it->second->updateScriptObject(m_frontend.get());
-#endif
-
     if (m_domContentEventTime != -1.0)
         m_frontend->domContentEventFired(m_domContentEventTime);
     if (m_loadEventTime != -1.0)
@@ -705,12 +679,6 @@ void InspectorController::restoreProfiler()
 
 void InspectorController::unbindAllResources()
 {
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    ResourcesMap::iterator resourcesEnd = m_resources.end();
-    for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
-        it->second->releaseScriptObject(0);
-#endif
-    
 #if ENABLE(DATABASE)
     DatabaseResourcesMap::iterator databasesEnd = m_databaseResources.end();
     for (DatabaseResourcesMap::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it)
@@ -725,36 +693,13 @@ void InspectorController::unbindAllResources()
         m_timelineAgent->reset();
 }
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-void InspectorController::pruneResources(ResourcesMap* resourceMap, DocumentLoader* loaderToKeep)
-{
-    ASSERT_ARG(resourceMap, resourceMap);
-
-    ResourcesMap mapCopy(*resourceMap);
-    ResourcesMap::iterator end = mapCopy.end();
-    for (ResourcesMap::iterator it = mapCopy.begin(); it != end; ++it) {
-        InspectorResource* resource = (*it).second.get();
-        if (resource == m_mainResource)
-            continue;
-
-        if (!loaderToKeep || !resource->isSameLoader(loaderToKeep)) {
-            removeResource(resource);
-            if (m_frontend)
-                resource->releaseScriptObject(m_frontend.get());
-        }
-    }
-}
-#endif
-
 void InspectorController::didCommitLoad(DocumentLoader* loader)
 {
     if (!enabled())
         return;
 
-#if !LEGACY_RESOURCE_TRACKING_ENABLED
     if (m_resourceAgent)
         m_resourceAgent->didCommitLoad(loader);
-#endif
     
     ASSERT(m_inspectedPage);
 
@@ -802,32 +747,11 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
 #endif
 
         if (m_frontend) {
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-            if (!loader->frameLoader()->isLoadingFromCachedPage()) {
-                ASSERT(m_mainResource && m_mainResource->isSameLoader(loader));
-                // We don't add the main resource until its load is committed. This is
-                // needed to keep the load for a user-entered URL from showing up in the
-                // list of resources for the page they are navigating away from.
-                m_mainResource->updateScriptObject(m_frontend.get());
-            } else {
-                // Pages loaded from the page cache are committed before
-                // m_mainResource is the right resource for this load, so we
-                // clear it here. It will be re-assigned in
-                // identifierForInitialRequest.
-                m_mainResource = 0;
-            }
-#endif
             m_mainResourceIdentifier = 0;
             m_frontend->didCommitLoad();
             m_domAgent->setDocument(m_inspectedPage->mainFrame()->document());
         }
     }
-
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    for (Frame* frame = loader->frame(); frame; frame = frame->tree()->traverseNext(loader->frame()))
-        if (ResourcesMap* resourceMap = m_frameResources.get(frame))
-            pruneResources(resourceMap, loader);
-#endif
 }
 
 void InspectorController::frameDetachedFromParent(Frame* rootFrame)
@@ -835,74 +759,10 @@ void InspectorController::frameDetachedFromParent(Frame* rootFrame)
     if (!enabled())
         return;
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    for (Frame* frame = rootFrame; frame; frame = frame->tree()->traverseNext(rootFrame))
-        if (ResourcesMap* resourceMap = m_frameResources.get(frame))
-            removeAllResources(resourceMap);
-#else
     if (m_resourceAgent)
         m_resourceAgent->frameDetachedFromParent(rootFrame);
-#endif
 }
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-void InspectorController::addResource(InspectorResource* resource)
-{
-    m_resources.set(resource->identifier(), resource);
-    m_knownResources.add(resource->requestURL());
-
-    Frame* frame = resource->frame();
-    if (!frame)
-        return;
-    ResourcesMap* resourceMap = m_frameResources.get(frame);
-    if (resourceMap)
-        resourceMap->set(resource->identifier(), resource);
-    else {
-        resourceMap = new ResourcesMap;
-        resourceMap->set(resource->identifier(), resource);
-        m_frameResources.set(frame, resourceMap);
-    }
-}
-
-void InspectorController::removeResource(InspectorResource* resource)
-{
-    m_resources.remove(resource->identifier());
-    String requestURL = resource->requestURL();
-    if (!requestURL.isNull())
-        m_knownResources.remove(requestURL);
-
-    Frame* frame = resource->frame();
-    if (!frame)
-        return;
-    ResourcesMap* resourceMap = m_frameResources.get(frame);
-    if (!resourceMap) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    resourceMap->remove(resource->identifier());
-    if (resourceMap->isEmpty()) {
-        m_frameResources.remove(frame);
-        delete resourceMap;
-    }
-}
-
-InspectorResource* InspectorController::getTrackedResource(unsigned long identifier)
-{
-    if (!enabled())
-        return 0;
-
-    if (resourceTrackingEnabled())
-        return m_resources.get(identifier).get();
-
-    bool isMainResource = m_mainResource && m_mainResource->identifier() == identifier;
-    if (isMainResource)
-        return m_mainResource.get();
-
-    return 0;
-}
-#endif
-
 void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader, const CachedResource* cachedResource)
 {
     if (!enabled())
@@ -910,31 +770,8 @@ void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader,
 
     ensureSettingsLoaded();
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    // If the resource URL is already known, we don't need to add it again since this is just a cached load.
-    if (m_knownResources.contains(cachedResource->url()))
-        return;
-
-    ASSERT(m_inspectedPage);
-    bool isMainResource = isMainResourceLoader(loader, KURL(ParsedURLString, cachedResource->url()));
-    if (!isMainResource && !resourceTrackingEnabled())
-        return;
-
-    RefPtr<InspectorResource> resource = InspectorResource::createCached(m_inspectedPage->progress()->createUniqueIdentifier(), loader, cachedResource);
-
-    if (isMainResource) {
-        m_mainResource = resource;
-        resource->markMainResource();
-    }
-
-    addResource(resource.get());
-
-    if (m_frontend)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
         m_resourceAgent->didLoadResourceFromMemoryCache(loader, cachedResource);
-#endif
 }
 
 void InspectorController::identifierForInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request)
@@ -949,25 +786,8 @@ void InspectorController::identifierForInitialRequest(unsigned long identifier,
 
     ensureSettingsLoaded();
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    if (!isMainResource && !resourceTrackingEnabled())
-        return;
-
-    RefPtr<InspectorResource> resource = InspectorResource::create(identifier, loader, request.url());
-
-    if (isMainResource) {
-        m_mainResource = resource;
-        resource->markMainResource();
-    }
-
-    addResource(resource.get());
-
-    if (m_frontend && loader->frameLoader()->isLoadingFromCachedPage() && resource == m_mainResource)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
         m_resourceAgent->identifierForInitialRequest(identifier, request.url(), loader);
-#endif
 }
 
 void InspectorController::mainResourceFiredDOMContentEvent(DocumentLoader* loader, const KURL& url)
@@ -1015,40 +835,8 @@ void InspectorController::willSendRequest(unsigned long identifier, ResourceRequ
     if (m_timelineAgent)
         m_timelineAgent->willSendResourceRequest(identifier, isMainResource, request);
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    RefPtr<InspectorResource> resource = getTrackedResource(identifier);
-    if (!resource)
-        return;
-
-    if (!redirectResponse.isNull()) {
-        // Redirect may have empty URL and we'd like to not crash with invalid HashMap entry.
-        // See http/tests/misc/will-send-request-returns-null-on-redirect.html
-        if (!request.url().isEmpty()) {
-            resource->endTiming(0);
-            resource->updateResponse(redirectResponse);
-
-            // We always store last redirect by the original id key. Rest of the redirects are stored within the last one.
-            unsigned long id = m_inspectedPage->progress()->createUniqueIdentifier();
-            RefPtr<InspectorResource> withRedirect = resource->appendRedirect(id, request.url());
-            removeResource(resource.get());
-            addResource(withRedirect.get());
-            if (isMainResource) {
-                m_mainResource = withRedirect;
-                withRedirect->markMainResource();
-            }
-            resource = withRedirect;
-        }
-    }
-
-    resource->startTiming();
-    resource->updateRequest(request);
-
-    if (resource != m_mainResource && m_frontend)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
         m_resourceAgent->willSendRequest(identifier, request, redirectResponse);
-#endif
 }
 
 void InspectorController::markResourceAsCached(unsigned long identifier)
@@ -1056,13 +844,8 @@ void InspectorController::markResourceAsCached(unsigned long identifier)
     if (!enabled())
         return;
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    if (RefPtr<InspectorResource> resource = getTrackedResource(identifier))
-        resource->markAsCached();
-#else
     if (m_resourceAgent)
         m_resourceAgent->markResourceAsCached(identifier);
-#endif
 }
 
 void InspectorController::didReceiveResponse(unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response)
@@ -1070,18 +853,8 @@ void InspectorController::didReceiveResponse(unsigned long identifier, DocumentL
     if (!enabled())
         return;
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    if (RefPtr<InspectorResource> resource = getTrackedResource(identifier)) {
-        resource->updateResponse(response);
-
-        if (resource != m_mainResource && m_frontend)
-            resource->updateScriptObject(m_frontend.get());
-    }
-    UNUSED_PARAM(loader);
-#else
     if (m_resourceAgent)
         m_resourceAgent->didReceiveResponse(identifier, loader, response);
-#endif
 
     if (response.httpStatusCode() >= 400) {
         String message = makeString("Failed to load resource: the server responded with a status of ", String::number(response.httpStatusCode()), " (", response.httpStatusText(), ')');
@@ -1094,19 +867,8 @@ void InspectorController::didReceiveContentLength(unsigned long identifier, int
     if (!enabled())
         return;
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    RefPtr<InspectorResource> resource = getTrackedResource(identifier);
-    if (!resource)
-        return;
-
-    resource->addLength(lengthReceived);
-
-    if (resource != m_mainResource && m_frontend)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
         m_resourceAgent->didReceiveContentLength(identifier, lengthReceived);
-#endif
 }
 
 void InspectorController::didFinishLoading(unsigned long identifier, double finishTime)
@@ -1117,20 +879,8 @@ void InspectorController::didFinishLoading(unsigned long identifier, double fini
     if (m_timelineAgent)
         m_timelineAgent->didFinishLoadingResource(identifier, false, finishTime);
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    RefPtr<InspectorResource> resource = getTrackedResource(identifier);
-    if (!resource)
-        return;
-
-    resource->endTiming(finishTime);
-
-    // No need to mute this event for main resource since it happens after did commit load.
-    if (m_frontend)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
         m_resourceAgent->didFinishLoading(identifier, finishTime);
-#endif
 }
 
 void InspectorController::didFailLoading(unsigned long identifier, const ResourceError& error)
@@ -1146,21 +896,8 @@ void InspectorController::didFailLoading(unsigned long identifier, const Resourc
             message += ": " + error.localizedDescription();
         addMessageToConsole(OtherMessageSource, LogMessageType, ErrorMessageLevel, message, 0, error.failingURL());
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    RefPtr<InspectorResource> resource = getTrackedResource(identifier);
-    if (!resource)
-        return;
-
-    resource->markFailed(error.localizedDescription());
-    resource->endTiming(0);
-
-    // No need to mute this event for main resource since it happens after did commit load.
-    if (m_frontend)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
         m_resourceAgent->didFailLoading(identifier, error);
-#endif
 }
 
 void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber)
@@ -1171,22 +908,8 @@ void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identi
     if (m_state->getBoolean(InspectorState::monitoringXHR))
         addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, "XHR finished loading: \"" + url + "\".", sendLineNumber, sendURL);
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    if (!resourceTrackingEnabled())
-        return;
-
-    InspectorResource* resource = m_resources.get(identifier).get();
-    if (!resource)
-        return;
-
-    resource->setOverrideContent(sourceString, InspectorResource::XHR);
-
-    if (m_frontend)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
-        m_resourceAgent->setOverrideContent(identifier, sourceString, InspectorResource::XHR);
-#endif
+        m_resourceAgent->setOverrideContent(identifier, sourceString, "XHR");
 }
 
 void InspectorController::scriptImported(unsigned long identifier, const String& sourceString)
@@ -1194,56 +917,8 @@ void InspectorController::scriptImported(unsigned long identifier, const String&
     if (!enabled())
         return;
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    if (!resourceTrackingEnabled())
-        return;
-
-    InspectorResource* resource = m_resources.get(identifier).get();
-    if (!resource)
-        return;
-
-    resource->setOverrideContent(sourceString, InspectorResource::Script);
-
-    if (m_frontend)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
-        m_resourceAgent->setOverrideContent(identifier, sourceString, InspectorResource::Script);
-#endif
-}
-
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-void InspectorController::setResourceTrackingEnabled(bool enable)
-{
-    if (!enabled())
-        return;
-
-    ASSERT(m_inspectedPage);
-    m_state->setBoolean(InspectorState::resourceTrackingEnabled, enable);
-}
-#endif
-
-void InspectorController::setResourceTrackingEnabled(bool enable, bool always, bool* newState)
-{
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    *newState = enable;
-
-    if (always)
-        m_state->setBoolean(InspectorState::resourceTrackingAlwaysEnabled, enable);
-
-    if (resourceTrackingEnabled() == enable)
-        return;
-
-    ASSERT(m_inspectedPage);
-    m_state->setBoolean(InspectorState::resourceTrackingEnabled, enable);
-
-    if (enable)
-        reloadPage();
-#else
-    UNUSED_PARAM(enable);
-    UNUSED_PARAM(always);
-    UNUSED_PARAM(newState);
-#endif
+        m_resourceAgent->setOverrideContent(identifier, sourceString, "Script");
 }
 
 void InspectorController::ensureSettingsLoaded()
@@ -1568,67 +1243,27 @@ void InspectorController::didCreateWebSocket(unsigned long identifier, const KUR
         return;
     ASSERT(m_inspectedPage);
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    RefPtr<InspectorResource> resource = InspectorResource::createWebSocket(identifier, requestURL, documentURL);
-    addResource(resource.get());
-
-    if (m_frontend)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
         m_resourceAgent->didCreateWebSocket(identifier, requestURL);
     UNUSED_PARAM(documentURL);
-#endif
 }
 
 void InspectorController::willSendWebSocketHandshakeRequest(unsigned long identifier, const WebSocketHandshakeRequest& request)
 {
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    RefPtr<InspectorResource> resource = getTrackedResource(identifier);
-    if (!resource)
-        return;
-    resource->startTiming();
-    resource->updateWebSocketRequest(request);
-    if (m_frontend)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
         m_resourceAgent->willSendWebSocketHandshakeRequest(identifier, request);
-#endif
 }
 
 void InspectorController::didReceiveWebSocketHandshakeResponse(unsigned long identifier, const WebSocketHandshakeResponse& response)
 {
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    RefPtr<InspectorResource> resource = getTrackedResource(identifier);
-    if (!resource)
-        return;
-    // Calling resource->markResponseReceivedTime() here makes resources bar chart confusing, because
-    // we cannot apply the "latency + download" model of regular resources to WebSocket connections.
-    // FIXME: Design a new UI for bar charts of WebSocket resources, and record timing here.
-    resource->updateWebSocketResponse(response);
-    if (m_frontend)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
         m_resourceAgent->didReceiveWebSocketHandshakeResponse(identifier, response);
-#endif
 }
 
 void InspectorController::didCloseWebSocket(unsigned long identifier)
 {
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    RefPtr<InspectorResource> resource = getTrackedResource(identifier);
-    if (!resource)
-        return;
-
-    resource->endTiming(0);
-    if (m_frontend)
-        resource->updateScriptObject(m_frontend.get());
-#else
     if (m_resourceAgent)
         m_resourceAgent->didCloseWebSocket(identifier);
-#endif
 }
 #endif // ENABLE(WEB_SOCKETS)
 
@@ -2172,22 +1807,6 @@ void InspectorController::setInspectorExtensionAPI(const String& source)
     m_inspectorExtensionAPI = source;
 }
 
-void InspectorController::getResourceContent(unsigned long identifier, bool encode, String* content)
-{
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    RefPtr<InspectorResource> resource = m_resources.get(identifier);
-    if (!resource) {
-        *content = String();
-        return;
-    }
-    *content = encode ? resource->sourceBytes() : resource->sourceString();
-#else
-    UNUSED_PARAM(identifier);
-    UNUSED_PARAM(encode);
-    UNUSED_PARAM(content);
-#endif
-}
-
 void InspectorController::reloadPage()
 {
     // FIXME: Why do we set the user gesture indicator here?
index 640987b..f1fc381 100644 (file)
@@ -86,12 +86,6 @@ class SharedBuffer;
 class Storage;
 class StorageArea;
 
-#define LEGACY_RESOURCE_TRACKING_ENABLED 0
-
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-class InspectorResource;
-#endif
-
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
 class InspectorApplicationCacheAgent;
 #endif
@@ -107,10 +101,6 @@ class WebSocketHandshakeResponse;
 
 class InspectorController : public Noncopyable {
 public:
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    typedef HashMap<unsigned long, RefPtr<InspectorResource> > ResourcesMap;
-    typedef HashMap<RefPtr<Frame>, ResourcesMap*> FrameResourcesMap;
-#endif
     typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMap;
     typedef HashMap<int, RefPtr<InspectorDOMStorageResource> > DOMStorageResourcesMap;
 
@@ -179,12 +169,6 @@ public:
     void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
     void scriptImported(unsigned long identifier, const String& sourceString);
 
-    void setResourceTrackingEnabled(bool enabled, bool always, bool* newState);
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    void setResourceTrackingEnabled(bool enabled);
-    bool resourceTrackingEnabled() const;
-#endif
-
     void ensureSettingsLoaded();
 
     void startTimelineProfiler();
@@ -230,10 +214,6 @@ public:
     void didCloseWebSocket(unsigned long identifier);
 #endif
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    const ResourcesMap& resources() const { return m_resources; }
-#endif
-
     bool hasFrontend() const { return m_frontend; }
 
     void drawNodeHighlight(GraphicsContext&) const;
@@ -332,15 +312,6 @@ private:
 
     void addConsoleMessage(PassOwnPtr<ConsoleMessage>);
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    void addResource(InspectorResource*);
-    void removeResource(InspectorResource*);
-    InspectorResource* getTrackedResource(unsigned long identifier);
-    void pruneResources(ResourcesMap*, DocumentLoader* loaderToKeep = 0);
-    void removeAllResources(ResourcesMap* map) { pruneResources(map); }
-#endif
-    void getResourceContent(unsigned long identifier, bool encode, String* content);
-
     bool isMainResourceLoader(DocumentLoader* loader, const KURL& requestUrl);
 
     void didEvaluateForTestInFrontend(long callId, const String& jsonResult);
@@ -372,12 +343,6 @@ private:
 #endif 
 
     RefPtr<Node> m_nodeToFocus;
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-    RefPtr<InspectorResource> m_mainResource;
-    ResourcesMap m_resources;
-    HashSet<String> m_knownResources;
-    FrameResourcesMap m_frameResources;
-#endif
     RefPtr<InspectorResourceAgent> m_resourceAgent;
     unsigned long m_mainResourceIdentifier;
     double m_loadEventTime;
index bc529ea..4b7e13f 100644 (file)
@@ -42,7 +42,6 @@
 #include "HitTestResult.h"
 #include "HTMLFrameOwnerElement.h"
 #include "InspectorFrontendClient.h"
-#include "InspectorResource.h"
 #include "Page.h"
 #include "Pasteboard.h"
 #include "ScriptFunctionCall.h"
diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp
deleted file mode 100644 (file)
index 9b3f95d..0000000
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorResource.h"
-
-#if ENABLE(INSPECTOR)
-
-#include "Base64.h"
-#include "Cache.h"
-#include "CachedResource.h"
-#include "CachedResourceLoader.h"
-#include "DocumentLoader.h"
-#include "Frame.h"
-#include "InspectorFrontend.h"
-#include "InspectorResourceAgent.h"
-#include "InspectorValues.h"
-#include "ResourceLoadTiming.h"
-#include "ResourceRequest.h"
-#include "ResourceResponse.h"
-#include "TextEncoding.h"
-#include "WebSocketHandshakeRequest.h"
-#include "WebSocketHandshakeResponse.h"
-
-#include <wtf/Assertions.h>
-#include <wtf/text/StringBuffer.h>
-
-namespace WebCore {
-
-#if ENABLE(WEB_SOCKETS)
-// Create human-readable binary representation, like "01:23:45:67:89:AB:CD:EF".
-static String createReadableStringFromBinary(const unsigned char* value, size_t length)
-{
-    ASSERT(length > 0);
-    static const char hexDigits[17] = "0123456789ABCDEF";
-    size_t bufferSize = length * 3 - 1;
-    StringBuffer buffer(bufferSize);
-    size_t index = 0;
-    for (size_t i = 0; i < length; ++i) {
-        if (i > 0)
-            buffer[index++] = ':';
-        buffer[index++] = hexDigits[value[i] >> 4];
-        buffer[index++] = hexDigits[value[i] & 0xF];
-    }
-    ASSERT(index == bufferSize);
-    return String::adopt(buffer);
-}
-#endif
-
-InspectorResource::InspectorResource(unsigned long identifier, DocumentLoader* loader, const KURL& requestURL)
-    : m_identifier(identifier)
-    , m_loader(loader)
-    , m_frame(loader ? loader->frame() : 0)
-    , m_requestURL(requestURL)
-    , m_expectedContentLength(0)
-    , m_cached(false)
-    , m_finished(false)
-    , m_failed(false)
-    , m_length(0)
-    , m_responseStatusCode(0)
-    , m_startTime(-1.0)
-    , m_responseReceivedTime(-1.0)
-    , m_endTime(-1.0)
-    , m_connectionID(0)
-    , m_connectionReused(false)
-    , m_isMainResource(false)
-#if ENABLE(WEB_SOCKETS)
-    , m_isWebSocket(false)
-#endif
-{
-}
-
-InspectorResource::~InspectorResource()
-{
-}
-
-PassRefPtr<InspectorResource> InspectorResource::appendRedirect(unsigned long identifier, const KURL& redirectURL)
-{
-    // Last redirect is always a container of all previous ones. Pass this container here.
-    RefPtr<InspectorResource> redirect = InspectorResource::create(m_identifier, m_loader.get(), redirectURL);
-    redirect->m_redirects = m_redirects;
-    redirect->m_redirects.append(this);
-    redirect->m_changes.set(RedirectsChange);
-
-    m_identifier = identifier;
-    // Re-send request info with new id.
-    m_changes.set(RequestChange);
-    m_redirects.clear();
-    return redirect;
-}
-
-PassRefPtr<InspectorResource> InspectorResource::create(unsigned long identifier, DocumentLoader* loader, const KURL& requestURL)
-{
-    ASSERT(loader);
-    return adoptRef(new InspectorResource(identifier, loader, requestURL));
-}
-
-PassRefPtr<InspectorResource> InspectorResource::createCached(unsigned long identifier, DocumentLoader* loader, const CachedResource* cachedResource)
-{
-    PassRefPtr<InspectorResource> resource = create(identifier, loader, KURL(ParsedURLString, cachedResource->url()));
-
-    resource->m_finished = true;
-
-    resource->updateResponse(cachedResource->response());
-
-    resource->m_length = cachedResource->encodedSize();
-    resource->m_cached = true;
-    resource->m_startTime = currentTime();
-    resource->m_responseReceivedTime = resource->m_startTime;
-    resource->m_endTime = resource->m_startTime;
-
-    resource->m_changes.setAll();
-
-    return resource;
-}
-
-#if ENABLE(WEB_SOCKETS)
-PassRefPtr<InspectorResource> InspectorResource::createWebSocket(unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
-{
-    RefPtr<InspectorResource> resource = adoptRef(new InspectorResource(identifier, 0, requestURL));
-    resource->markWebSocket();
-    resource->m_documentURL = documentURL;
-    resource->m_changes.setAll();
-    return resource.release();
-}
-#endif
-
-void InspectorResource::updateRequest(const ResourceRequest& request)
-{
-    m_requestHeaderFields = request.httpHeaderFields();
-    m_requestMethod = request.httpMethod();
-    if (request.httpBody() && !request.httpBody()->isEmpty())
-        m_requestFormData = request.httpBody()->flattenToString();
-
-    m_changes.set(RequestChange);
-}
-
-void InspectorResource::markAsCached()
-{
-    m_cached = true;
-}
-
-void InspectorResource::updateResponse(const ResourceResponse& response)
-{
-    m_expectedContentLength = response.expectedContentLength();
-    m_mimeType = response.mimeType();
-    if (m_mimeType.isEmpty() && response.httpStatusCode() == 304) {
-        CachedResource* cachedResource = cache()->resourceForURL(response.url().string());
-        if (cachedResource)
-            m_mimeType = cachedResource->response().mimeType();
-    }
-    if (ResourceRawHeaders* headers = response.resourceRawHeaders().get()) {
-        m_requestHeaderFields = headers->requestHeaders;
-        m_responseHeaderFields = headers->responseHeaders;
-        m_changes.set(RequestChange);
-    } else
-        m_responseHeaderFields = response.httpHeaderFields();
-    m_responseStatusCode = response.httpStatusCode();
-    m_responseStatusText = response.httpStatusText();
-    m_suggestedFilename = response.suggestedFilename();
-
-    m_connectionID = response.connectionID();
-    m_connectionReused = response.connectionReused();
-    m_loadTiming = response.resourceLoadTiming();
-    m_cached = m_cached || response.wasCached();
-    m_responseReceivedTime = currentTime();
-    m_changes.set(TimingChange);
-    m_changes.set(ResponseChange);
-    m_changes.set(TypeChange);
-}
-
-#if ENABLE(WEB_SOCKETS)
-void InspectorResource::updateWebSocketRequest(const WebSocketHandshakeRequest& request)
-{
-    m_requestHeaderFields = request.headerFields();
-    m_requestMethod = "GET"; // Currently we always use "GET" to request handshake.
-    m_webSocketRequestKey3.set(new WebSocketHandshakeRequest::Key3(request.key3()));
-    m_changes.set(RequestChange);
-    m_changes.set(TypeChange);
-}
-
-void InspectorResource::updateWebSocketResponse(const WebSocketHandshakeResponse& response)
-{
-    m_responseStatusCode = response.statusCode();
-    m_responseStatusText = response.statusText();
-    m_responseHeaderFields = response.headerFields();
-    m_webSocketChallengeResponse.set(new WebSocketHandshakeResponse::ChallengeResponse(response.challengeResponse()));
-    m_changes.set(ResponseChange);
-    m_changes.set(TypeChange);
-}
-#endif // ENABLE(WEB_SOCKETS)
-
-static PassRefPtr<InspectorObject> buildHeadersObject(const HTTPHeaderMap& headers)
-{
-    RefPtr<InspectorObject> object = InspectorObject::create();
-    HTTPHeaderMap::const_iterator end = headers.end();
-    for (HTTPHeaderMap::const_iterator it = headers.begin(); it != end; ++it) {
-        object->setString(it->first.string(), it->second);
-    }
-    return object;
-}
-
-static PassRefPtr<InspectorObject> buildObjectForTiming(ResourceLoadTiming* timing)
-{
-    RefPtr<InspectorObject> jsonObject = InspectorObject::create();
-    jsonObject->setNumber("requestTime", timing->requestTime);
-    jsonObject->setNumber("proxyStart", timing->proxyStart);
-    jsonObject->setNumber("proxyEnd", timing->proxyEnd);
-    jsonObject->setNumber("dnsStart", timing->dnsStart);
-    jsonObject->setNumber("dnsEnd", timing->dnsEnd);
-    jsonObject->setNumber("connectStart", timing->connectStart);
-    jsonObject->setNumber("connectEnd", timing->connectEnd);
-    jsonObject->setNumber("sslStart", timing->sslStart);
-    jsonObject->setNumber("sslEnd", timing->sslEnd);
-    jsonObject->setNumber("sendStart", timing->sendStart);
-    jsonObject->setNumber("sendEnd", timing->sendEnd);
-    jsonObject->setNumber("receiveHeadersEnd", timing->receiveHeadersEnd);
-    return jsonObject;
-}
-
-
-void InspectorResource::updateScriptObject(InspectorFrontend* frontend)
-{
-    if (m_changes.hasChange(NoChange))
-        return;
-
-    RefPtr<InspectorObject> jsonObject = InspectorObject::create();
-    jsonObject->setNumber("id", m_identifier);
-    if (m_changes.hasChange(RequestChange)) {
-        if (m_frame)
-            m_documentURL = m_frame->document()->url();
-        jsonObject->setString("url", m_requestURL.string());
-        jsonObject->setString("documentURL", m_documentURL.string());
-        RefPtr<InspectorObject> requestHeaders = buildHeadersObject(m_requestHeaderFields);
-        jsonObject->setObject("requestHeaders", requestHeaders);
-        jsonObject->setBoolean("mainResource", m_isMainResource);
-        jsonObject->setString("requestMethod", m_requestMethod);
-        jsonObject->setString("requestFormData", m_requestFormData);
-        jsonObject->setBoolean("didRequestChange", true);
-#if ENABLE(WEB_SOCKETS)
-        if (m_webSocketRequestKey3)
-            jsonObject->setString("webSocketRequestKey3", createReadableStringFromBinary(m_webSocketRequestKey3->value, sizeof(m_webSocketRequestKey3->value)));
-#endif
-    }
-
-    if (m_changes.hasChange(ResponseChange)) {
-        jsonObject->setString("mimeType", m_mimeType);
-        jsonObject->setString("suggestedFilename", m_suggestedFilename);
-        jsonObject->setNumber("expectedContentLength", m_expectedContentLength);
-        jsonObject->setNumber("statusCode", m_responseStatusCode);
-        jsonObject->setString("statusText", m_responseStatusText);
-        RefPtr<InspectorObject> responseHeaders = buildHeadersObject(m_responseHeaderFields);
-        jsonObject->setObject("responseHeaders", responseHeaders);
-        jsonObject->setNumber("connectionID", m_connectionID);
-        jsonObject->setBoolean("connectionReused", m_connectionReused);
-        jsonObject->setBoolean("cached", m_cached);
-        if (m_loadTiming && !m_cached)
-            jsonObject->setObject("timing", buildObjectForTiming(m_loadTiming.get()));
-#if ENABLE(WEB_SOCKETS)
-        if (m_webSocketChallengeResponse)
-            jsonObject->setString("webSocketChallengeResponse", createReadableStringFromBinary(m_webSocketChallengeResponse->value, sizeof(m_webSocketChallengeResponse->value)));
-#endif
-        jsonObject->setBoolean("didResponseChange", true);
-    }
-
-    if (m_changes.hasChange(TypeChange)) {
-        jsonObject->setNumber("type", static_cast<int>(type()));
-        jsonObject->setBoolean("didTypeChange", true);
-    }
-
-    if (m_changes.hasChange(LengthChange)) {
-        jsonObject->setNumber("resourceSize", m_length);
-        jsonObject->setBoolean("didLengthChange", true);
-    }
-
-    if (m_changes.hasChange(CompletionChange)) {
-        jsonObject->setBoolean("failed", m_failed);
-        jsonObject->setString("localizedFailDescription", m_localizedFailDescription);
-        jsonObject->setBoolean("finished", m_finished);
-        jsonObject->setBoolean("didCompletionChange", true);
-    }
-
-    if (m_changes.hasChange(TimingChange)) {
-        if (m_startTime > 0)
-            jsonObject->setNumber("startTime", m_startTime);
-        if (m_responseReceivedTime > 0)
-            jsonObject->setNumber("responseReceivedTime", m_responseReceivedTime);
-        if (m_endTime > 0)
-            jsonObject->setNumber("endTime", m_endTime);
-        jsonObject->setBoolean("didTimingChange", true);
-    }
-
-    if (m_changes.hasChange(RedirectsChange)) {
-        for (size_t i = 0; i < m_redirects.size(); ++i)
-            m_redirects[i]->updateScriptObject(frontend);
-    }
-
-    frontend->updateResource(jsonObject);
-    m_changes.clearAll();
-}
-
-void InspectorResource::releaseScriptObject(InspectorFrontend* frontend)
-{
-    m_changes.setAll();
-
-    for (size_t i = 0; i < m_redirects.size(); ++i)
-        m_redirects[i]->releaseScriptObject(frontend);
-
-    if (frontend)
-        frontend->removeResource(m_identifier);
-}
-
-static InspectorResource::Type cachedResourceType(CachedResource* cachedResource)
-{
-    if (!cachedResource)
-        return InspectorResource::Other;
-
-    switch (cachedResource->type()) {
-    case CachedResource::ImageResource:
-        return InspectorResource::Image;
-    case CachedResource::FontResource:
-        return InspectorResource::Font;
-    case CachedResource::CSSStyleSheet:
-#if ENABLE(XSLT)
-    case CachedResource::XSLStyleSheet:
-#endif
-        return InspectorResource::Stylesheet;
-    case CachedResource::Script:
-        return InspectorResource::Script;
-    default:
-        return InspectorResource::Other;
-    }
-}
-
-InspectorResource::Type InspectorResource::type() const
-{
-    if (!m_overrideContent.isNull())
-        return m_overrideContentType;
-
-#if ENABLE(WEB_SOCKETS)
-    if (m_isWebSocket)
-        return WebSocket;
-#endif
-
-    ASSERT(m_loader);
-
-    if (m_loader->frameLoader() && equalIgnoringFragmentIdentifier(m_requestURL, m_loader->frameLoader()->iconURL()))
-        return Image;
-
-    if (!m_frame)
-        return Other;
-
-    InspectorResource::Type resourceType = cachedResourceType(InspectorResourceAgent::cachedResource(m_frame.get(), m_requestURL));
-    if (equalIgnoringFragmentIdentifier(m_requestURL, m_loader->requestURL()) && resourceType == Other)
-        return Doc;
-
-    return resourceType;
-}
-
-void InspectorResource::setOverrideContent(const String& data, Type type)
-{
-    m_overrideContent = data;
-    m_overrideContentType = type;
-    m_changes.set(TypeChange);
-}
-
-String InspectorResource::sourceString() const
-{
-    if (!m_overrideContent.isNull())
-        return String(m_overrideContent);
-
-    String result;
-    if (!InspectorResourceAgent::resourceContent(m_frame.get(), m_requestURL, &result))
-        return String();
-    return result;
-}
-
-String InspectorResource::sourceBytes() const
-{
-    Vector<char> out;
-    if (!m_overrideContent.isNull()) {
-        Vector<char> data;
-        String overrideContent = m_overrideContent;
-        data.append(overrideContent.characters(), overrideContent.length());
-        base64Encode(data, out);
-        return String(out.data(), out.size());
-    }
-
-    String result;
-    if (!InspectorResourceAgent::resourceContentBase64(m_frame.get(), m_requestURL, &result))
-        return String();
-    return result;
-}
-
-void InspectorResource::startTiming()
-{
-    m_startTime = currentTime();
-    m_changes.set(TimingChange);
-}
-
-void InspectorResource::endTiming(double actualEndTime)
-{
-    if (actualEndTime)
-        m_endTime = actualEndTime;
-    else
-        m_endTime = currentTime();
-
-    m_finished = true;
-    m_changes.set(TimingChange);
-    m_changes.set(CompletionChange);
-}
-
-void InspectorResource::markFailed(const String& localizedDescription)
-{
-    m_failed = true;
-    m_localizedFailDescription = localizedDescription;
-    m_changes.set(CompletionChange);
-}
-
-void InspectorResource::addLength(int lengthReceived)
-{
-    m_length += lengthReceived;
-    m_changes.set(LengthChange);
-
-    // Update load time, otherwise the resource will
-    // have start time == end time and  0 load duration
-    // until its loading is completed.
-    m_endTime = currentTime();
-    m_changes.set(TimingChange);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorResource.h b/WebCore/inspector/InspectorResource.h
deleted file mode 100644 (file)
index aa4c3b1..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef InspectorResource_h
-#define InspectorResource_h
-
-#include "HTTPHeaderMap.h"
-#include "KURL.h"
-#include "WebSocketHandshakeRequest.h"
-#include "WebSocketHandshakeResponse.h"
-
-#include <wtf/CurrentTime.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-    class CachedResource;
-    class DocumentLoader;
-    class Frame;
-    class InspectorFrontend;
-    class ResourceLoadTiming;
-    class ResourceRequest;
-    class ResourceResponse;
-
-#if ENABLE(WEB_SOCKETS)
-    class WebSocketHandshakeRequest;
-    class WebSocketHandshakeResponse;
-#endif
-
-    class InspectorResource : public RefCounted<InspectorResource> {
-    public:
-
-        // Keep these in sync with WebInspector.Resource.Type
-        enum Type {
-            Doc,
-            Stylesheet,
-            Image,
-            Font,
-            Script,
-            XHR,
-            Media,
-            WebSocket,
-            Other
-        };
-
-        static PassRefPtr<InspectorResource> create(unsigned long identifier, DocumentLoader* loader, const KURL& requestURL);
-
-        static PassRefPtr<InspectorResource> createCached(unsigned long identifier, DocumentLoader*, const CachedResource*);
-
-#if ENABLE(WEB_SOCKETS)
-        // WebSocket resource doesn't have its loader. For WebSocket resources, m_loader and m_frame will become null.
-        static PassRefPtr<InspectorResource> createWebSocket(unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
-#endif
-
-        ~InspectorResource();
-
-        PassRefPtr<InspectorResource> appendRedirect(unsigned long identifier, const KURL& redirectURL);
-        void updateScriptObject(InspectorFrontend* frontend);
-        void releaseScriptObject(InspectorFrontend* frontend);
-
-        void updateRequest(const ResourceRequest&);
-        void markAsCached();
-        void updateResponse(const ResourceResponse&);
-
-#if ENABLE(WEB_SOCKETS)
-        void updateWebSocketRequest(const WebSocketHandshakeRequest&);
-        void updateWebSocketResponse(const WebSocketHandshakeResponse&);
-#endif
-
-        void setOverrideContent(const String& data, Type);
-        String sourceString() const;
-        String sourceBytes() const;
-
-        bool isSameLoader(DocumentLoader* loader) const { return loader == m_loader; }
-        void markMainResource() { m_isMainResource = true; }
-        unsigned long identifier() const { return m_identifier; }
-        KURL requestURL() const { return m_requestURL; }
-        Frame* frame() const { return m_frame.get(); }
-        const String& mimeType() const { return m_mimeType; }
-        const HTTPHeaderMap& requestHeaderFields() const { return m_requestHeaderFields; }
-        const HTTPHeaderMap& responseHeaderFields() const { return m_responseHeaderFields; }
-        int responseStatusCode() const { return m_responseStatusCode; }
-        String requestMethod() const { return m_requestMethod; }
-        String requestFormData() const { return m_requestFormData; }
-
-        void startTiming();
-        void endTiming(double actualEndTime);
-
-        void markFailed(const String& localizedDescription);
-        void addLength(int lengthReceived);
-
-    private:
-        enum ChangeType {
-            NoChange = 0,
-            RequestChange = 1,
-            ResponseChange = 2,
-            TypeChange = 4,
-            LengthChange = 8,
-            CompletionChange = 16,
-            TimingChange = 32,
-            RedirectsChange = 64
-        };
-
-        class Changes {
-        public:
-            Changes() : m_change(NoChange) {}
-
-            inline bool hasChange(ChangeType change)
-            {
-                return m_change & change || (m_change == NoChange && change == NoChange);
-            }
-            inline void set(ChangeType change)
-            {
-                m_change = static_cast<ChangeType>(static_cast<unsigned>(m_change) | static_cast<unsigned>(change));
-            }
-            inline void clear(ChangeType change)
-            {
-                m_change = static_cast<ChangeType>(static_cast<unsigned>(m_change) & ~static_cast<unsigned>(change));
-            }
-
-            inline void setAll() { m_change = static_cast<ChangeType>(127); }
-            inline void clearAll() { m_change = NoChange; }
-
-        private:
-            ChangeType m_change;
-        };
-
-        InspectorResource(unsigned long identifier, DocumentLoader*, const KURL& requestURL);
-        Type type() const;
-
-#if ENABLE(WEB_SOCKETS)
-        void markWebSocket() { m_isWebSocket = true; }
-#endif
-
-        unsigned long m_identifier;
-        RefPtr<DocumentLoader> m_loader;
-        RefPtr<Frame> m_frame;
-        KURL m_requestURL;
-        KURL m_documentURL;
-        HTTPHeaderMap m_requestHeaderFields;
-        HTTPHeaderMap m_responseHeaderFields;
-        String m_mimeType;
-        String m_suggestedFilename;
-        long long m_expectedContentLength;
-        bool m_cached;
-        bool m_finished;
-        bool m_failed;
-        String m_localizedFailDescription;
-        int m_length;
-        int m_responseStatusCode;
-        String m_responseStatusText;
-        double m_startTime;
-        double m_responseReceivedTime;
-        double m_endTime;
-        unsigned m_connectionID;
-        bool m_connectionReused;
-        RefPtr<ResourceLoadTiming> m_loadTiming;
-        String m_overrideContent;
-        Type m_overrideContentType;
-        Changes m_changes;
-        bool m_isMainResource;
-        String m_requestMethod;
-        String m_requestFormData;
-        Vector<RefPtr<InspectorResource> > m_redirects;
-
-#if ENABLE(WEB_SOCKETS)
-        bool m_isWebSocket;
-
-        // The following fields are not used for resources other than WebSocket.
-        // We allocate them dynamically to reduce memory consumption for regular resources.
-        OwnPtr<WebSocketHandshakeRequest::Key3> m_webSocketRequestKey3;
-        OwnPtr<WebSocketHandshakeResponse::ChallengeResponse> m_webSocketChallengeResponse;
-#endif
-    };
-
-} // namespace WebCore
-
-#endif // InspectorResource_h
index 2e965b6..6b71d39 100644 (file)
@@ -329,21 +329,9 @@ void InspectorResourceAgent::didLoadResourceFromMemoryCache(DocumentLoader* load
     m_frontend->didLoadResourceFromMemoryCache(currentTime(), buildObjectForCachedResource(loader, *resource));
 }
 
-void InspectorResourceAgent::setOverrideContent(unsigned long identifier, const String& sourceString, InspectorResource::Type type)
+void InspectorResourceAgent::setOverrideContent(unsigned long identifier, const String& sourceString, const String& type)
 {
-    String typeString;
-    switch (type) {
-    case InspectorResource::XHR:
-        typeString = "XHR";
-        break;
-    case InspectorResource::Script:
-        typeString = "Script";
-        break;
-    default:
-        typeString = "Other";
-    }
-
-    m_frontend->setOverrideContent(identifier, sourceString, typeString);
+    m_frontend->setOverrideContent(identifier, sourceString, type);
 }
 
 static PassRefPtr<InspectorObject> buildObjectForFrameTree(Frame* frame, bool dumpResources)
index 1cdd292..f61071c 100644 (file)
@@ -31,7 +31,6 @@
 #ifndef InspectorResourceAgent_h
 #define InspectorResourceAgent_h
 
-#include "InspectorResource.h"
 #include "PlatformString.h"
 
 #include <wtf/PassRefPtr.h>
@@ -48,6 +47,7 @@ namespace WebCore {
 class CachedResource;
 class Document;
 class DocumentLoader;
+class Frame;
 class InspectorArray;
 class InspectorObject;
 class InspectorFrontend;
@@ -85,7 +85,7 @@ public:
     void didFinishLoading(unsigned long identifier, double finishTime);
     void didFailLoading(unsigned long identifier, const ResourceError&);
     void didLoadResourceFromMemoryCache(DocumentLoader*, const CachedResource*);
-    void setOverrideContent(unsigned long identifier, const String& sourceString, InspectorResource::Type);
+    void setOverrideContent(unsigned long identifier, const String& sourceString, const String& type);
     void didCommitLoad(DocumentLoader*);
     void frameDetachedFromParent(Frame*);
 
index deca21c..eeaff2e 100644 (file)
@@ -218,18 +218,7 @@ WebInspector.ConsoleView.prototype = {
     {
         if (msg instanceof WebInspector.ConsoleMessage && !(msg instanceof WebInspector.ConsoleCommandResult)) {
             this._incrementErrorWarningCount(msg);
-
-            // Add message to the resource panel
-            if (!Preferences.networkPanelEnabled) {
-                var resource = WebInspector.resourceForURL(msg.url);
-                if (resource) {
-                    msg.resource = resource;
-                    if (WebInspector.panels.resources)
-                        WebInspector.panels.resources.addMessageToResource(msg.resource, msg);
-                }
-            } else
-                WebInspector.resourceManager.addConsoleMessage(msg);
-
+            WebInspector.resourceManager.addConsoleMessage(msg);
             this.commandSincePreviousMessage = false;
             this.previousMessage = msg;
         } else if (msg instanceof WebInspector.ConsoleCommand) {
@@ -300,10 +289,7 @@ WebInspector.ConsoleView.prototype = {
 
     clearMessages: function()
     {
-        if (WebInspector.panels.resources)
-            WebInspector.panels.resources.clearMessages();
-        if (WebInspector.resourceManager)
-            WebInspector.resourceManager.clearConsoleMessages();
+        WebInspector.resourceManager.clearConsoleMessages();
 
         this.messages = [];
 
index 5e593f7..3ee8acc 100644 (file)
@@ -243,13 +243,9 @@ WebInspector.ExtensionServer.prototype = {
         resource = WebInspector.networkResources[id] || WebInspector.resourceForURL(id);
         if (!resource)
             return this._status.E_NOTFOUND(typeof id + ": " + id);
-        if (Preferences.networkPanelEnabled) {
-            WebInspector.panels.storage.showResource(resource, message.line);
-            WebInspector.showPanel("storage");
-        } else {
-            WebInspector.panels.resources.showResource(resource, message.line);
-            WebInspector.showPanel("resources");
-        }
+
+        WebInspector.panels.storage.showResource(resource, message.line);
+        WebInspector.showPanel("storage");
     },
 
     _dispatchCallback: function(requestId, port, result)
diff --git a/WebCore/inspector/front-end/Images/resourcesSilhouette.png b/WebCore/inspector/front-end/Images/resourcesSilhouette.png
deleted file mode 100644 (file)
index 9c8bb53..0000000
Binary files a/WebCore/inspector/front-end/Images/resourcesSilhouette.png and /dev/null differ
index b9a4439..e310d46 100644 (file)
@@ -649,46 +649,3 @@ WebInspector.Resource.prototype = {
 }
 
 WebInspector.Resource.prototype.__proto__ = WebInspector.Object.prototype;
-
-WebInspector.Resource.CompareByStartTime = function(a, b)
-{
-    return a.startTime - b.startTime;
-}
-
-WebInspector.Resource.CompareByResponseReceivedTime = function(a, b)
-{
-    var aVal = a.responseReceivedTime;
-    var bVal = b.responseReceivedTime;
-    if (aVal === -1 ^ bVal === -1)
-        return bVal - aVal;
-    return aVal - bVal;
-}
-
-WebInspector.Resource.CompareByEndTime = function(a, b)
-{
-    var aVal = a.endTime;
-    var bVal = b.endTime;
-    if (aVal === -1 ^ bVal === -1)
-        return bVal - aVal;
-    return aVal - bVal;
-}
-
-WebInspector.Resource.CompareByDuration = function(a, b)
-{
-    return a.duration - b.duration;
-}
-
-WebInspector.Resource.CompareByLatency = function(a, b)
-{
-    return a.latency - b.latency;
-}
-
-WebInspector.Resource.CompareBySize = function(a, b)
-{
-    return a.resourceSize - b.resourceSize;
-}
-
-WebInspector.Resource.CompareByTransferSize = function(a, b)
-{
-    return a.transferSize - b.transferSize;
-}
index 271c4f3..33b79fc 100644 (file)
@@ -472,11 +472,7 @@ WebInspector.ResourceManager.existingResourceViewForResource = function(resource
 
 WebInspector.ResourceManager.getContent = function(resource, base64Encode, callback)
 {
-    // FIXME: eventually, cached resources will have no identifiers.
-    if (Preferences.networkPanelEnabled)
-        InspectorBackend.resourceContent(resource.loader.frameId, resource.url, base64Encode, callback);
-    else
-        InspectorBackend.getResourceContent(resource.identifier, base64Encode, callback);
+    InspectorBackend.resourceContent(resource.loader.frameId, resource.url, base64Encode, callback);
 }
 
 WebInspector.ResourceTreeModel = function()
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
deleted file mode 100644 (file)
index b35fc4b..0000000
+++ /dev/null
@@ -1,1938 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.
- * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.ResourcesPanel = function()
-{
-    WebInspector.Panel.call(this, "resources");
-    this.resourceURLMap = {};
-    this._items = [];
-    this._staleItems = [];
-
-    this._createPanelEnabler();
-
-    this.viewsContainerElement = document.createElement("div");
-    this.viewsContainerElement.id = "resource-views";
-    this.element.appendChild(this.viewsContainerElement);
-
-    this.createFilterPanel();
-    this.createInterface();
-
-    this._createStatusbarButtons();
-    this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._getPopoverAnchor.bind(this), this._showPopover.bind(this), true);
-
-    this.reset();
-    this.filter(this.filterAllElement, false);
-    this.graphsTreeElement.children[0].select();
-    this._resourceTrackingEnabled = false;
-
-    this.sidebarElement.addEventListener("contextmenu", this._contextMenu.bind(this), true);
-}
-
-WebInspector.ResourcesPanel.prototype = {
-    get toolbarItemLabel()
-    {
-        return WebInspector.UIString("Resources");
-    },
-
-    get statusBarItems()
-    {
-        return [this.enableToggleButton.element, this.largerResourcesButton.element, this.sortingSelectElement];
-    },
-
-    get categories()
-    {
-        return WebInspector.resourceCategories;
-    },
-
-    createItemTreeElement: function(item)
-    {
-        return new WebInspector.ResourceSidebarTreeElement(item);
-    },
-
-    createItemGraph: function(item)
-    {
-        return new WebInspector.ResourceGraph(item);
-    },
-
-    isCategoryVisible: function(categoryName)
-    {
-        return (this.itemsGraphsElement.hasStyleClass("filter-all") || this.itemsGraphsElement.hasStyleClass("filter-" + categoryName.toLowerCase()));
-    },
-
-    get items()
-    {
-        return this._items;
-    },
-
-    createInterface: function()
-    {
-        this.containerElement = document.createElement("div");
-        this.containerElement.id = "resources-container";
-        this.containerElement.addEventListener("scroll", this._updateDividersLabelBarPosition.bind(this), false);
-        this.element.appendChild(this.containerElement);
-
-        this.createSidebar(this.containerElement, this.element);
-        this.sidebarElement.id = "resources-sidebar";
-        this.populateSidebar();
-
-        this._containerContentElement = document.createElement("div");
-        this._containerContentElement.id = "resources-container-content";
-        this.containerElement.appendChild(this._containerContentElement);
-
-        this.summaryBar = new WebInspector.SummaryBar(this.categories);
-        this.summaryBar.element.id = "resources-summary";
-        this._containerContentElement.appendChild(this.summaryBar.element);
-
-        this._timelineGrid = new WebInspector.TimelineGrid();
-        this._containerContentElement.appendChild(this._timelineGrid.element);
-        this.itemsGraphsElement = this._timelineGrid.itemsGraphsElement;
-    },
-
-    createFilterPanel: function()
-    {
-        this.filterBarElement = document.createElement("div");
-        this.filterBarElement.id = "resources-filter";
-        this.filterBarElement.className = "scope-bar";
-        this.element.appendChild(this.filterBarElement);
-
-        function createFilterElement(category)
-        {
-            if (category === "all")
-                var label = WebInspector.UIString("All");
-            else if (this.categories[category])
-                var label = this.categories[category].title;
-
-            var categoryElement = document.createElement("li");
-            categoryElement.category = category;
-            categoryElement.addStyleClass(category);
-            categoryElement.appendChild(document.createTextNode(label));
-            categoryElement.addEventListener("click", this._updateFilter.bind(this), false);
-            this.filterBarElement.appendChild(categoryElement);
-
-            return categoryElement;
-        }
-
-        this.filterAllElement = createFilterElement.call(this, "all");
-
-        // Add a divider
-        var dividerElement = document.createElement("div");
-        dividerElement.addStyleClass("scope-bar-divider");
-        this.filterBarElement.appendChild(dividerElement);
-
-        for (var category in this.categories)
-            createFilterElement.call(this, category);
-    },
-
-    showCategory: function(category)
-    {
-        var filterClass = "filter-" + category.toLowerCase();
-        this.itemsGraphsElement.addStyleClass(filterClass);
-        this.itemsTreeElement.childrenListElement.addStyleClass(filterClass);
-    },
-
-    hideCategory: function(category)
-    {
-        var filterClass = "filter-" + category.toLowerCase();
-        this.itemsGraphsElement.removeStyleClass(filterClass);
-        this.itemsTreeElement.childrenListElement.removeStyleClass(filterClass);
-    },
-
-    filter: function(target, selectMultiple)
-    {
-        function unselectAll()
-        {
-            for (var i = 0; i < this.filterBarElement.childNodes.length; ++i) {
-                var child = this.filterBarElement.childNodes[i];
-                if (!child.category)
-                    continue;
-
-                child.removeStyleClass("selected");
-                this.hideCategory(child.category);
-            }
-        }
-
-        if (target === this.filterAllElement) {
-            if (target.hasStyleClass("selected")) {
-                // We can't unselect All, so we break early here
-                return;
-            }
-
-            // If All wasn't selected, and now is, unselect everything else.
-            unselectAll.call(this);
-        } else {
-            // Something other than All is being selected, so we want to unselect All.
-            if (this.filterAllElement.hasStyleClass("selected")) {
-                this.filterAllElement.removeStyleClass("selected");
-                this.hideCategory("all");
-            }
-        }
-
-        if (!selectMultiple) {
-            // If multiple selection is off, we want to unselect everything else
-            // and just select ourselves.
-            unselectAll.call(this);
-
-            target.addStyleClass("selected");
-            this.showCategory(target.category);
-            return;
-        }
-
-        if (target.hasStyleClass("selected")) {
-            // If selectMultiple is turned on, and we were selected, we just
-            // want to unselect ourselves.
-            target.removeStyleClass("selected");
-            this.hideCategory(target.category);
-        } else {
-            // If selectMultiple is turned on, and we weren't selected, we just
-            // want to select ourselves.
-            target.addStyleClass("selected");
-            this.showCategory(target.category);
-        }
-    },
-
-    _updateFilter: function(e)
-    {
-        var isMac = WebInspector.isMac();
-        var selectMultiple = false;
-        if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey)
-            selectMultiple = true;
-        if (!isMac && e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey)
-            selectMultiple = true;
-
-        this.filter(e.target, selectMultiple);
-
-        // When we are updating our filtering, scroll to the top so we don't end up
-        // in blank graph under all the resources.
-        this.containerElement.scrollTop = 0;
-
-        var searchField = document.getElementById("search");
-        WebInspector.doPerformSearch(searchField.value, WebInspector.shortSearchWasForcedByKeyEvent, false, true);
-    },
-
-    _updateDividersLabelBarPosition: function()
-    {
-        const scrollTop = this.containerElement.scrollTop;
-        const offsetHeight = this.summaryBar.element.offsetHeight;
-        const dividersTop = (scrollTop < offsetHeight ? offsetHeight : scrollTop);
-        this._timelineGrid.setScrollAndDividerTop(scrollTop, dividersTop);
-    },
-
-    get needsRefresh()
-    {
-        return this._needsRefresh;
-    },
-
-    set needsRefresh(x)
-    {
-        if (this._needsRefresh === x)
-            return;
-
-        this._needsRefresh = x;
-
-        if (x) {
-            if (this.visible && !("_refreshTimeout" in this))
-                this._refreshTimeout = setTimeout(this.refresh.bind(this), 500);
-        } else {
-            if ("_refreshTimeout" in this) {
-                clearTimeout(this._refreshTimeout);
-                delete this._refreshTimeout;
-            }
-        }
-    },
-
-    refreshIfNeeded: function()
-    {
-        if (this.needsRefresh)
-            this.refresh();
-    },
-
-    resize: function()
-    {
-        WebInspector.Panel.prototype.resize.call(this);
-
-        this.updateGraphDividersIfNeeded();
-    },
-
-    invalidateAllItems: function()
-    {
-        this._staleItems = this._items.slice();
-    },
-
-    get calculator()
-    {
-        return this._calculator;
-    },
-
-    set calculator(x)
-    {
-        if (!x || this._calculator === x)
-            return;
-
-        this._calculator = x;
-        this._calculator.reset();
-
-        this._staleItems = this._items.slice();
-        this.refresh();
-    },
-
-    addItem: function(item)
-    {
-        this._items.push(item);
-        this.refreshItem(item);
-    },
-
-    removeItem: function(item)
-    {
-        this._items.remove(item, true);
-
-        if (item._itemsTreeElement) {
-            this.itemsTreeElement.removeChild(item._itemsTreeElement);
-            this.itemsGraphsElement.removeChild(item._itemsTreeElement._itemGraph.graphElement);
-        }
-
-        delete item._itemsTreeElement;
-        this.adjustScrollPosition();
-    },
-
-    refreshItem: function(item)
-    {
-        this._staleItems.push(item);
-        this.needsRefresh = true;
-    },
-
-    revealAndSelectItem: function(item)
-    {
-        if (item._itemsTreeElement) {
-            item._itemsTreeElement.reveal();
-            item._itemsTreeElement.select(true);
-        }
-    },
-
-    sortItems: function(sortingFunction)
-    {
-        var sortedElements = [].concat(this.itemsTreeElement.children);
-        sortedElements.sort(sortingFunction);
-
-        var sortedElementsLength = sortedElements.length;
-        for (var i = 0; i < sortedElementsLength; ++i) {
-            var treeElement = sortedElements[i];
-            if (treeElement === this.itemsTreeElement.children[i])
-                continue;
-
-            var wasSelected = treeElement.selected;
-            this.itemsTreeElement.removeChild(treeElement);
-            this.itemsTreeElement.insertChild(treeElement, i);
-            if (wasSelected)
-                treeElement.select(true);
-
-            var graphElement = treeElement._itemGraph.graphElement;
-            this.itemsGraphsElement.insertBefore(graphElement, this.itemsGraphsElement.children[i]);
-        }
-    },
-
-    adjustScrollPosition: function()
-    {
-        // Prevent the container from being scrolled off the end.
-        if ((this.containerElement.scrollTop + this.containerElement.offsetHeight) > this.sidebarElement.offsetHeight)
-            this.containerElement.scrollTop = (this.sidebarElement.offsetHeight - this.containerElement.offsetHeight);
-    },
-
-    addEventDivider: function(divider)
-    {
-        this._timelineGrid.addEventDivider(divider);
-    },
-
-    hideEventDividers: function()
-    {
-        this._timelineGrid.hideEventDividers();
-    },
-
-    showEventDividers: function()
-    {
-        this._timelineGrid.showEventDividers();
-    },
-
-    populateSidebar: function()
-    {
-        this.timeGraphItem = new WebInspector.SidebarTreeElement("resources-time-graph-sidebar-item", WebInspector.UIString("Time"));
-        this.timeGraphItem.onselect = this._graphSelected.bind(this);
-
-        var transferTimeCalculator = new WebInspector.ResourceTransferTimeCalculator();
-        var transferDurationCalculator = new WebInspector.ResourceTransferDurationCalculator();
-
-        this.timeGraphItem.sortingOptions = [
-            { name: WebInspector.UIString("Sort by Start Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingStartTime, calculator: transferTimeCalculator, optionName: "startTime" },
-            { name: WebInspector.UIString("Sort by Response Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingResponseReceivedTime, calculator: transferTimeCalculator, optionName: "responseTime" },
-            { name: WebInspector.UIString("Sort by End Time"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByAscendingEndTime, calculator: transferTimeCalculator, optionName: "endTime" },
-            { name: WebInspector.UIString("Sort by Duration"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingDuration, calculator: transferDurationCalculator, optionName: "duration" },
-            { name: WebInspector.UIString("Sort by Latency"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingLatency, calculator: transferDurationCalculator, optionName: "latency" },
-        ];
-
-        this.timeGraphItem.isBarOpaqueAtLeft = false;
-        this.timeGraphItem.selectedSortingOptionIndex = 1;
-
-        this.sizeGraphItem = new WebInspector.SidebarTreeElement("resources-size-graph-sidebar-item", WebInspector.UIString("Size"));
-        this.sizeGraphItem.onselect = this._graphSelected.bind(this);
-
-        var transferSizeCalculator = new WebInspector.ResourceTransferSizeCalculator();
-        this.sizeGraphItem.sortingOptions = [
-            { name: WebInspector.UIString("Sort by Transfer Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingTransferSize, calculator: transferSizeCalculator, optionName: "transferSize" },
-            { name: WebInspector.UIString("Sort by Size"), sortingFunction: WebInspector.ResourceSidebarTreeElement.CompareByDescendingSize, calculator: transferSizeCalculator, optionName: "size" },
-        ];
-
-        this.sizeGraphItem.isBarOpaqueAtLeft = true;
-        this.sizeGraphItem.selectedSortingOptionIndex = 0;
-
-        this.graphsTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("GRAPHS"), {}, true);
-        this.sidebarTree.appendChild(this.graphsTreeElement);
-
-        this.graphsTreeElement.appendChild(this.timeGraphItem);
-        this.graphsTreeElement.appendChild(this.sizeGraphItem);
-        this.graphsTreeElement.expand();
-
-        this.itemsTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("RESOURCES"), {}, true);
-        this.sidebarTree.appendChild(this.itemsTreeElement);
-
-        this.itemsTreeElement.expand();
-    },
-
-    get resourceTrackingEnabled()
-    {
-        return this._resourceTrackingEnabled;
-    },
-
-    _createPanelEnabler: function()
-    {
-        var panelEnablerHeading = WebInspector.UIString("You need to enable resource tracking to use this panel.");
-        var panelEnablerDisclaimer = WebInspector.UIString("Enabling resource tracking will reload the page and make page loading slower.");
-        var panelEnablerButton = WebInspector.UIString("Enable resource tracking");
-
-        this.panelEnablerView = new WebInspector.PanelEnablerView("resources", panelEnablerHeading, panelEnablerDisclaimer, panelEnablerButton);
-        this.panelEnablerView.addEventListener("enable clicked", this._enableResourceTracking, this);
-
-        this.element.appendChild(this.panelEnablerView.element);
-
-        this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
-        this.enableToggleButton.addEventListener("click", this.toggleResourceTracking.bind(this), false);
-    },
-
-    _createStatusbarButtons: function()
-    {
-        this.largerResourcesButton = new WebInspector.StatusBarButton(WebInspector.UIString("Use small resource rows."), "resources-larger-resources-status-bar-item");
-
-        this.largerResourcesButton.toggled = WebInspector.applicationSettings.resourcesLargeRows;
-        if (!WebInspector.applicationSettings.resourcesLargeRows)
-            this._setLargerResources(WebInspector.applicationSettings.resourcesLargeRows);
-        this._loadSortOptions();
-
-        this.largerResourcesButton.addEventListener("click", this._toggleLargerResources.bind(this), false);
-        this.sortingSelectElement = document.createElement("select");
-        this.sortingSelectElement.className = "status-bar-item";
-        this.sortingSelectElement.addEventListener("change", this._changeSortingFunction.bind(this), false);
-    },
-
-    _loadSortOptions: function()
-    {
-        var newOptions = WebInspector.applicationSettings.resourcesSortOptions;
-        if (!newOptions)
-            return;
-
-        this._loadSortOptionForGraph(this.timeGraphItem, newOptions.timeOption || "responseTime");
-        this._loadSortOptionForGraph(this.sizeGraphItem, newOptions.sizeOption || "transferSize");
-    },
-
-    _loadSortOptionForGraph: function(graphItem, newOptionName)
-    {
-        var sortingOptions = graphItem.sortingOptions;
-        for (var i = 0; i < sortingOptions.length; ++i) {
-            if (sortingOptions[i].optionName === newOptionName) {
-                graphItem.selectedSortingOptionIndex = i;
-                // Propagate the option change down to the currently selected option.
-                if (this._lastSelectedGraphTreeElement === graphItem) {
-                    this._lastSelectedGraphTreeElement = null;
-                    this._graphSelected(graphItem);
-                }
-            }
-        }
-    },
-
-    get mainResourceLoadTime()
-    {
-        return this._mainResourceLoadTime || -1;
-    },
-    
-    set mainResourceLoadTime(x)
-    {
-        if (this._mainResourceLoadTime === x)
-            return;
-        
-        this._mainResourceLoadTime = x;
-        
-        // Update the dividers to draw the new line
-        this.updateGraphDividersIfNeeded(true);
-    },
-    
-    get mainResourceDOMContentTime()
-    {
-        return this._mainResourceDOMContentTime || -1;
-    },
-    
-    set mainResourceDOMContentTime(x)
-    {
-        if (this._mainResourceDOMContentTime === x)
-            return;
-        
-        this._mainResourceDOMContentTime = x;
-        
-        this.updateGraphDividersIfNeeded(true);
-    },
-
-    show: function()
-    {
-        WebInspector.Panel.prototype.show.call(this);
-
-        this._updateDividersLabelBarPosition();
-        this.refreshIfNeeded();
-
-        var visibleView = this.visibleView;
-        if (this.visibleResource) {
-            this.visibleView.headersVisible = true;
-            this.visibleView.show(this.viewsContainerElement);
-        } else if (visibleView)
-            visibleView.show();
-
-        // Hide any views that are visible that are not this panel's current visible view.
-        // This can happen when a ResourceView is visible in the Scripts panel then switched
-        // to the this panel.
-        var resourcesLength = this._resources.length;
-        for (var i = 0; i < resourcesLength; ++i) {
-            var resource = this._resources[i];
-            var view = resource._resourcesView;
-            if (!view || view === visibleView)
-                continue;
-            view.visible = false;
-        }
-    },
-
-    get searchableViews()
-    {
-        var views = [];
-
-        const visibleView = this.visibleView;
-        if (visibleView && visibleView.performSearch)
-            views.push(visibleView);
-
-        var resourcesLength = this._resources.length;
-        for (var i = 0; i < resourcesLength; ++i) {
-            var resource = this._resources[i];
-            if (!resource._itemsTreeElement || !resource._itemsTreeElement.selectable)
-                continue;
-            var resourceView = WebInspector.ResourceManager.resourceViewForResource(resource);
-            if (!resourceView.performSearch || resourceView === visibleView)
-                continue;
-            views.push(resourceView);
-        }
-
-        return views;
-    },
-
-    get searchResultsSortFunction()
-    {
-        const resourceTreeElementSortFunction = this.sortingFunction;
-
-        function sortFuction(a, b)
-        {
-            return resourceTreeElementSortFunction(a.resource._itemsTreeElement, b.resource._itemsTreeElement);
-        }
-
-        return sortFuction;
-    },
-
-    searchMatchFound: function(view, matches)
-    {
-        view.resource._itemsTreeElement.searchMatches = matches;
-    },
-
-    searchCanceled: function(startingNewSearch)
-    {
-        WebInspector.Panel.prototype.searchCanceled.call(this, startingNewSearch);
-
-        if (startingNewSearch || !this._resources)
-            return;
-
-        for (var i = 0; i < this._resources.length; ++i) {
-            var resource = this._resources[i];
-            if (resource._itemsTreeElement)
-                resource._itemsTreeElement.updateErrorsAndWarnings();
-        }
-    },
-
-    performSearch: function(query)
-    {
-        for (var i = 0; i < this._resources.length; ++i) {
-            var resource = this._resources[i];
-            if (resource._itemsTreeElement)
-                resource._itemsTreeElement.resetBubble();
-        }
-
-        WebInspector.Panel.prototype.performSearch.call(this, query);
-    },
-
-    get visibleView()
-    {
-        if (this.visibleResource)
-            return this.visibleResource._resourcesView;
-        return this._resourceTrackingEnabled ? null : this.panelEnablerView;
-    },
-
-    get sortingFunction()
-    {
-        return this._sortingFunction;
-    },
-
-    set sortingFunction(x)
-    {
-        this._sortingFunction = x;
-        this._sortResourcesIfNeeded();
-    },
-
-    refresh: function()
-    {
-        this.needsRefresh = false;
-
-        var staleItemsLength = this._staleItems.length;
-
-        var boundariesChanged = false;
-
-        for (var i = 0; i < staleItemsLength; ++i) {
-            var item = this._staleItems[i];
-            if (!item._itemsTreeElement) {
-                // Create the timeline tree element and graph.
-                item._itemsTreeElement = this.createItemTreeElement(item);
-                item._itemsTreeElement._itemGraph = this.createItemGraph(item);
-
-                this.itemsTreeElement.appendChild(item._itemsTreeElement);
-                this.itemsGraphsElement.appendChild(item._itemsTreeElement._itemGraph.graphElement);
-            }
-
-            if (item._itemsTreeElement.refresh)
-                item._itemsTreeElement.refresh();
-
-            if (this.calculator.updateBoundaries(item))
-                boundariesChanged = true;
-        }
-
-        if (boundariesChanged) {
-            // The boundaries changed, so all item graphs are stale.
-            this._staleItems = this._items.slice();
-            staleItemsLength = this._staleItems.length;
-        }
-
-
-        const isBarOpaqueAtLeft = this.sidebarTree.selectedTreeElement && this.sidebarTree.selectedTreeElement.isBarOpaqueAtLeft;
-        for (var i = 0; i < staleItemsLength; ++i)
-            this._staleItems[i]._itemsTreeElement._itemGraph.refresh(this.calculator, isBarOpaqueAtLeft);
-
-        this._staleItems = [];
-
-        this.updateGraphDividersIfNeeded();
-
-        this._sortResourcesIfNeeded();
-        this._updateSummaryGraph();
-    },
-
-    _updateSummaryGraph: function()
-    {
-        this.summaryBar.update(this._resources);
-    },
-
-    resourceTrackingWasEnabled: function()
-    {
-        this._resourceTrackingEnabled = true;
-        this.reset();
-        this.restoreSidebarWidth();
-    },
-
-    resourceTrackingWasDisabled: function()
-    {
-        this._resourceTrackingEnabled = false;
-        this.reset();
-    },
-
-    reset: function()
-    {
-        this._popoverHelper.hidePopup();
-        this.closeVisibleResource();
-
-        delete this.currentQuery;
-        this.searchCanceled();
-
-        if (this._resources) {
-            var resourcesLength = this._resources.length;
-            for (var i = 0; i < resourcesLength; ++i) {
-                var resource = this._resources[i];
-
-                resource.warnings = 0;
-                resource.errors = 0;
-
-                delete resource._resourcesView;
-            }
-        }
-
-        // Begin reset timeline
-        this.containerElement.scrollTop = 0;
-
-        if (this._calculator)
-            this._calculator.reset();
-
-        if (this._items) {
-            var itemsLength = this._items.length;
-            for (var i = 0; i < itemsLength; ++i) {
-                var item = this._items[i];
-                delete item._itemsTreeElement;
-            }
-        }
-
-        this._items = [];
-        this._staleItems = [];
-
-        this.itemsTreeElement.removeChildren();
-        this.itemsGraphsElement.removeChildren();
-
-        this.updateGraphDividersIfNeeded(true);
-        // End reset timeline.
-        
-        this.mainResourceLoadTime = -1;
-        this.mainResourceDOMContentTime = -1;
-        this.viewsContainerElement.removeChildren();
-
-        this.summaryBar.reset();
-
-        if (this._resourceTrackingEnabled) {
-            this.enableToggleButton.title = WebInspector.UIString("Resource tracking enabled. Click to disable.");
-            this.enableToggleButton.toggled = true;
-            this.largerResourcesButton.visible = true;
-            this.sortingSelectElement.removeStyleClass("hidden");
-            this.panelEnablerView.visible = false;
-        } else {
-            this.enableToggleButton.title = WebInspector.UIString("Resource tracking disabled. Click to enable.");
-            this.enableToggleButton.toggled = false;
-            this.largerResourcesButton.visible = false;
-            this.sortingSelectElement.addStyleClass("hidden");
-            this.panelEnablerView.visible = true;
-        }
-        this.resourceURLMap = {};
-    },
-
-    addResource: function(resource)
-    {
-        this.resourceURLMap[resource.url] = resource;
-        this._resources.push(resource);
-    },
-
-    removeResource: function(resource)
-    {
-        if (this.visibleView === resource._resourcesView)
-            this.closeVisibleResource();
-
-        this.removeItem(resource);
-
-        resource.warnings = 0;
-        resource.errors = 0;
-
-        delete resource._resourcesView;
-        delete this.resourceURLMap[resource.url];
-    },
-
-    addMessageToResource: function(resource, msg)
-    {
-        if (!resource)
-            return;
-
-        switch (msg.level) {
-        case WebInspector.ConsoleMessage.MessageLevel.Warning:
-            resource.warnings += msg.repeatDelta;
-            break;
-        case WebInspector.ConsoleMessage.MessageLevel.Error:
-            resource.errors += msg.repeatDelta;
-            break;
-        }
-
-        if (!this.currentQuery && resource._itemsTreeElement)
-            resource._itemsTreeElement.updateErrorsAndWarnings();
-
-        var view = WebInspector.ResourceManager.resourceViewForResource(resource);
-        if (view.addMessage)
-            view.addMessage(msg);
-    },
-
-    clearMessages: function()
-    {
-        var resourcesLength = this._resources.length;
-        for (var i = 0; i < resourcesLength; ++i) {
-            var resource = this._resources[i];
-            resource.warnings = 0;
-            resource.errors = 0;
-
-            if (!this.currentQuery && resource._itemsTreeElement)
-                resource._itemsTreeElement.updateErrorsAndWarnings();
-
-            var view = resource._resourcesView;
-            if (!view || !view.clearMessages)
-                continue;
-            view.clearMessages();
-        }
-    },
-
-    refreshResource: function(resource)
-    {
-        this._recreateViewForResourceIfNeeded(resource);
-        this.refreshItem(resource);
-    },
-
-    _recreateViewForResourceIfNeeded: function(resource)
-    {
-        if (!resource || !resource._resourcesView)
-            return;
-
-        if (WebInspector.ResourceManager.resourceViewTypeMatchesResource(resource, resource._resourcesView))
-            return;
-        var newView = WebInspector.ResourceManager.createResourceView(resource);
-
-        if (!this.currentQuery && resource._itemsTreeElement)
-            resource._itemsTreeElement.updateErrorsAndWarnings();
-
-        var oldView = resource._resourcesView;
-        var oldViewParentNode = oldView.visible ? oldView.element.parentNode : null;
-
-        resource._resourcesView.detach();
-        delete resource._resourcesView;
-
-        resource._resourcesView = newView;
-
-        newView.headersVisible = oldView.headersVisible;
-
-        if (oldViewParentNode)
-            newView.show(oldViewParentNode);
-
-        WebInspector.panels.scripts.viewRecreated(oldView, newView);
-    },
-
-    canShowSourceLine: function(url, line)
-    {
-        return this._resourceTrackingEnabled && !!WebInspector.resourceForURL(url);
-    },
-
-    showSourceLine: function(url, line)
-    {
-        this.showResource(WebInspector.resourceForURL(url), line);
-    },
-
-    showResource: function(resource, line)
-    {
-        if (!resource)
-            return;
-
-        this._popoverHelper.hidePopup();
-
-        this.containerElement.addStyleClass("viewing-resource");
-
-        if (this.visibleResource && this.visibleResource._resourcesView)
-            this.visibleResource._resourcesView.hide();
-
-        var view = WebInspector.ResourceManager.resourceViewForResource(resource);
-        view.headersVisible = true;
-        view.show(this.viewsContainerElement);
-
-        if (line) {
-            view.selectContentTab(true);
-            if (view.revealLine)
-                view.revealLine(line);
-            if (view.highlightLine)
-                view.highlightLine(line);
-        }
-
-        this.revealAndSelectItem(resource);
-
-        this.visibleResource = resource;
-
-        this.updateSidebarWidth();
-    },
-
-    showView: function(view)
-    {
-        if (!view)
-            return;
-        this.showResource(view.resource);
-    },
-
-    closeVisibleResource: function()
-    {
-        this.containerElement.removeStyleClass("viewing-resource");
-        this._updateDividersLabelBarPosition();
-
-        if (this.visibleResource && this.visibleResource._resourcesView)
-            this.visibleResource._resourcesView.hide();
-        delete this.visibleResource;
-
-        if (this._lastSelectedGraphTreeElement)
-            this._lastSelectedGraphTreeElement.select(true);
-
-        this.updateSidebarWidth();
-    },
-
-    _sortResourcesIfNeeded: function()
-    {
-        this.sortItems(this.sortingFunction);
-    },
-
-    updateGraphDividersIfNeeded: function(force)
-    {
-        var proceed = true;
-        if (!this.visible) {
-            this.needsRefresh = true;
-            proceed = false;
-        } else
-            proceed = this._timelineGrid.updateDividers(force, this.calculator);
-        
-        if (!proceed)
-            return;
-
-        if (this.calculator.startAtZero || !this.calculator.computePercentageFromEventTime) {
-            // If our current sorting method starts at zero, that means it shows all
-            // resources starting at the same point, and so onLoad event and DOMContent
-            // event lines really wouldn't make much sense here, so don't render them.
-            // Additionally, if the calculator doesn't have the computePercentageFromEventTime
-            // function defined, we are probably sorting by size, and event times aren't relevant
-            // in this case.
-            return;
-        }
-
-        this._timelineGrid.removeEventDividers();
-        if (this.mainResourceLoadTime !== -1) {
-            var percent = this.calculator.computePercentageFromEventTime(this.mainResourceLoadTime);
-
-            var loadDivider = document.createElement("div");
-            loadDivider.className = "resources-event-divider resources-red-divider";
-
-            var loadDividerPadding = document.createElement("div");
-            loadDividerPadding.className = "resources-event-divider-padding";
-            loadDividerPadding.style.left = percent + "%";
-            loadDividerPadding.title = WebInspector.UIString("Load event fired");
-            loadDividerPadding.appendChild(loadDivider);
-
-            this.addEventDivider(loadDividerPadding);
-        }
-        
-        if (this.mainResourceDOMContentTime !== -1) {
-            var percent = this.calculator.computePercentageFromEventTime(this.mainResourceDOMContentTime);
-
-            var domContentDivider = document.createElement("div");
-            domContentDivider.className = "resources-event-divider resources-blue-divider";
-            
-            var domContentDividerPadding = document.createElement("div");
-            domContentDividerPadding.className = "resources-event-divider-padding";
-            domContentDividerPadding.style.left = percent + "%";
-            domContentDividerPadding.title = WebInspector.UIString("DOMContent event fired");
-            domContentDividerPadding.appendChild(domContentDivider);
-
-            this.addEventDivider(domContentDividerPadding);
-        }
-    },
-
-    _graphSelected: function(treeElement)
-    {
-        if (this._lastSelectedGraphTreeElement)
-            this._lastSelectedGraphTreeElement.selectedSortingOptionIndex = this.sortingSelectElement.selectedIndex;
-
-        this._lastSelectedGraphTreeElement = treeElement;
-
-        this.sortingSelectElement.removeChildren();
-        for (var i = 0; i < treeElement.sortingOptions.length; ++i) {
-            var sortingOption = treeElement.sortingOptions[i];
-            var option = document.createElement("option");
-            option.label = sortingOption.name;
-            option.sortingFunction = sortingOption.sortingFunction;
-            option.calculator = sortingOption.calculator;
-            option.optionName = sortingOption.optionName;
-            this.sortingSelectElement.appendChild(option);
-        }
-
-        this.sortingSelectElement.selectedIndex = treeElement.selectedSortingOptionIndex;
-        this._doChangeSortingFunction();
-
-        this.closeVisibleResource();
-        this.containerElement.scrollTop = 0;
-
-        if (treeElement === this.sizeGraphItem)
-            this.hideEventDividers();
-        else
-            this.showEventDividers();
-    },
-
-    _toggleLargerResources: function()
-    {
-        if (!this.itemsTreeElement._childrenListNode)
-            return;
-
-        WebInspector.applicationSettings.resourcesLargeRows = !WebInspector.applicationSettings.resourcesLargeRows;
-        this._setLargerResources(this.itemsTreeElement.smallChildren);
-    },
-
-    _setLargerResources: function(enabled)
-    {
-        this.largerResourcesButton.toggled = enabled;
-        this.itemsTreeElement.smallChildren = !enabled;
-        if (!enabled) {
-            this.itemsGraphsElement.addStyleClass("small");
-            this.largerResourcesButton.title = WebInspector.UIString("Use large resource rows.");
-            this.adjustScrollPosition();
-        } else {
-            this.itemsGraphsElement.removeStyleClass("small");
-            this.largerResourcesButton.title = WebInspector.UIString("Use small resource rows.");
-        }
-    },
-
-    _changeSortingFunction: function()
-    {
-        this._doChangeSortingFunction();
-        WebInspector.applicationSettings.resourcesSortOptions = {timeOption: this._selectedOptionNameForGraph(this.timeGraphItem), sizeOption: this._selectedOptionNameForGraph(this.sizeGraphItem)};
-    },
-
-    _selectedOptionNameForGraph: function(graphItem)
-    {
-        return graphItem.sortingOptions[graphItem.selectedSortingOptionIndex].optionName;
-    },
-
-    _doChangeSortingFunction: function()
-    {
-        var selectedIndex = this.sortingSelectElement.selectedIndex;
-        if (this._lastSelectedGraphTreeElement)
-            this._lastSelectedGraphTreeElement.selectedSortingOptionIndex = selectedIndex;
-        var selectedOption = this.sortingSelectElement[selectedIndex];
-        this.sortingFunction = selectedOption.sortingFunction;
-        this.calculator = this.summaryBar.calculator = selectedOption.calculator;
-    },
-
-    setSidebarWidth: function(width)
-    {
-        if (this.visibleResource) {
-            this.containerElement.style.width = width + "px";
-            this.sidebarElement.style.removeProperty("width");
-        } else {
-            this.sidebarElement.style.width = width + "px";
-            this.containerElement.style.removeProperty("width");
-        }
-
-        this.sidebarResizeElement.style.left = (width - 3) + "px";
-    },
-
-    updateMainViewWidth: function(width)
-    {
-        this.viewsContainerElement.style.left = width + "px";
-        this._containerContentElement.style.left = width + "px";
-        this.resize();
-    },
-
-    _enableResourceTracking: function()
-    {
-        if (this._resourceTrackingEnabled)
-            return;
-        this.toggleResourceTracking(this.panelEnablerView.alwaysEnabled);
-    },
-
-    toggleResourceTracking: function(optionalAlways)
-    {
-        function callback(newState) {
-            if (newState)
-                WebInspector.panels.resources.resourceTrackingWasEnabled();
-            else
-                WebInspector.panels.resources.resourceTrackingWasDisabled();
-        }
-
-        if (this._resourceTrackingEnabled) {
-            this.largerResourcesButton.visible = false;
-            this.sortingSelectElement.visible = false;
-            WebInspector.resources = {};
-            this.resourceURLMap = {};
-            InspectorBackend.setResourceTrackingEnabled(false, true, callback);
-        } else {
-            this.largerResourcesButton.visible = true;
-            this.sortingSelectElement.visible = true;
-            InspectorBackend.setResourceTrackingEnabled(true, !!optionalAlways, callback);
-        }
-    },
-
-    get _resources()
-    {
-        return this.items;
-    },
-
-    elementsToRestoreScrollPositionsFor: function()
-    {
-        return [ this.containerElement ];
-    },
-
-    _getPopoverAnchor: function(element)
-    {
-        var anchor = element.enclosingNodeOrSelfWithClass("resources-graph-bar") || element.enclosingNodeOrSelfWithClass("resources-graph-label");
-        if (!anchor)
-            return null;
-        var resource = anchor.parentElement.resource;
-        return resource && resource.timing ? anchor : null;
-    },
-
-    _showPopover: function(anchor)
-    {
-        var tableElement = document.createElement("table");
-        var resource = anchor.parentElement.resource;
-        var rows = [];
-
-        function addRow(title, start, end, color)
-        {
-            var row = {};
-            row.title = title;
-            row.start = start;
-            row.end = end;
-            rows.push(row);
-        }
-
-        if (resource.timing.proxyStart !== -1)
-            addRow(WebInspector.UIString("Proxy"), resource.timing.proxyStart, resource.timing.proxyEnd);
-
-        if (resource.timing.dnsStart !== -1) {
-            addRow(WebInspector.UIString("DNS Lookup"), resource.timing.dnsStart, resource.timing.dnsEnd);
-        }
-
-        if (resource.timing.connectStart !== -1) {
-            if (resource.connectionReused)
-                addRow(WebInspector.UIString("Blocking"), resource.timing.connectStart, resource.timing.connectEnd);
-            else {
-                var connectStart = resource.timing.connectStart;
-                // Connection includes DNS, subtract it here.
-                if (resource.timing.dnsStart !== -1)
-                    connectStart += resource.timing.dnsEnd - resource.timing.dnsStart;
-                addRow(WebInspector.UIString("Connecting"), connectStart, resource.timing.connectEnd);
-            }
-        }
-
-        if (resource.timing.sslStart !== -1)
-            addRow(WebInspector.UIString("SSL"), resource.timing.sslStart, resource.timing.sslEnd);
-
-        var sendStart = resource.timing.sendStart;
-        if (resource.timing.sslStart !== -1)
-            sendStart += resource.timing.sslEnd - resource.timing.sslStart;
-        
-        addRow(WebInspector.UIString("Sending"), resource.timing.sendStart, resource.timing.sendEnd);
-        addRow(WebInspector.UIString("Waiting"), resource.timing.sendEnd, resource.timing.receiveHeadersEnd);
-        addRow(WebInspector.UIString("Receiving"), (resource.responseReceivedTime - resource.timing.requestTime) * 1000, (resource.endTime - resource.timing.requestTime) * 1000);
-
-        const chartWidth = 200;
-        var total = (resource.endTime - resource.timing.requestTime) * 1000;
-        var scale = chartWidth / total;
-
-        for (var i = 0; i < rows.length; ++i) {
-            var tr = document.createElement("tr");
-            tableElement.appendChild(tr);
-
-            var td = document.createElement("td");
-            td.textContent = rows[i].title;
-            tr.appendChild(td);
-
-            td = document.createElement("td");
-            td.width = chartWidth + "px";
-
-            var row = document.createElement("div");
-            row.className = "resource-timing-row";
-            td.appendChild(row);
-
-            var bar = document.createElement("span");
-            bar.className = "resource-timing-bar";
-            bar.style.left = scale * rows[i].start + "px";
-            bar.style.right = scale * (total - rows[i].end) + "px";
-            bar.style.backgroundColor = rows[i].color;
-            bar.textContent = "\u200B"; // Important for 0-time items to have 0 width.
-            row.appendChild(bar);
-
-            var title = document.createElement("span");
-            title.className = "resource-timing-bar-title";
-            if (total - rows[i].end < rows[i].start)
-                title.style.right = (scale * (total - rows[i].end) + 3) + "px";
-            else
-                title.style.left = (scale * rows[i].start + 3) + "px";
-            title.textContent = Number.millisToString(rows[i].end - rows[i].start);
-            row.appendChild(title);
-
-            tr.appendChild(td);
-        }
-
-        var popover = new WebInspector.Popover(tableElement);
-        popover.show(anchor);
-        return popover;
-    },
-
-    hide: function()
-    {
-        WebInspector.Panel.prototype.hide.call(this);
-        this._popoverHelper.hidePopup();
-    },
-
-    _contextMenu: function(event)
-    {
-        var contextMenu = new WebInspector.ContextMenu();
-        var resourceTreeItem = event.target.enclosingNodeOrSelfWithClass("resource-sidebar-tree-item");
-        var resource;
-        if (resourceTreeItem && resourceTreeItem.treeElement)
-            resource = resourceTreeItem.treeElement.representedObject;
-
-        var needSeparator = false;
-        // createObjectURL is enabled conditionally, do not expose resource export if it's not available.
-        if (typeof window.createObjectURL === "function" && Preferences.resourceExportEnabled) {
-            if (resource)
-                contextMenu.appendItem(WebInspector.UIString("Export to HAR"), this._exportResource.bind(this, resource));
-            contextMenu.appendItem(WebInspector.UIString("Export all to HAR"), this._exportAll.bind(this));
-            needSeparator = true;
-        }
-
-        if (resource && resource.category === WebInspector.resourceCategories.xhr) {
-            if (needSeparator)
-                contextMenu.appendSeparator();
-            contextMenu.appendItem(WebInspector.UIString("Set XHR Breakpoint"), WebInspector.breakpointManager.createXHRBreakpoint.bind(WebInspector.breakpointManager, resource.url));
-        }
-
-        contextMenu.show(event);
-    },
-
-    _exportAll: function()
-    {
-        var harArchive = {
-            log: (new WebInspector.HARLog()).build()
-        }
-        offerFileForDownload(JSON.stringify(harArchive));
-    },
-
-    _exportResource: function(resource)
-    {
-        var har = (new WebInspector.HAREntry(resource)).build();
-        offerFileForDownload(JSON.stringify(har));
-    }
-}
-
-WebInspector.ResourcesPanel.prototype.__proto__ = WebInspector.Panel.prototype;
-
-WebInspector.ResourceBaseCalculator = function()
-{
-}
-
-WebInspector.ResourceBaseCalculator.prototype = {
-    computeSummaryValues: function(items)
-    {
-        var total = 0;
-        var categoryValues = {};
-
-        var itemsLength = items.length;
-        for (var i = 0; i < itemsLength; ++i) {
-            var item = items[i];
-            var value = this._value(item);
-            if (typeof value === "undefined")
-                continue;
-            if (!(item.category.name in categoryValues))
-                categoryValues[item.category.name] = 0;
-            categoryValues[item.category.name] += value;
-            total += value;
-        }
-
-        return {categoryValues: categoryValues, total: total};
-    },
-
-    computeBarGraphPercentages: function(item)
-    {
-        return {start: 0, middle: 0, end: (this._value(item) / this.boundarySpan) * 100};
-    },
-
-    computeBarGraphLabels: function(item)
-    {
-        const label = this.formatValue(this._value(item));
-        return {left: label, right: label, tooltip: label};
-    },
-
-    get boundarySpan()
-    {
-        return this.maximumBoundary - this.minimumBoundary;
-    },
-
-    updateBoundaries: function(item)
-    {
-        this.minimumBoundary = 0;
-
-        var value = this._value(item);
-        if (typeof this.maximumBoundary === "undefined" || value > this.maximumBoundary) {
-            this.maximumBoundary = value;
-            return true;
-        }
-        return false;
-    },
-
-    reset: function()
-    {
-        delete this.minimumBoundary;
-        delete this.maximumBoundary;
-    },
-
-    _value: function(item)
-    {
-        return 0;
-    },
-
-    formatValue: function(value)
-    {
-        return value.toString();
-    }
-}
-
-WebInspector.ResourceTimeCalculator = function(startAtZero)
-{
-    WebInspector.ResourceBaseCalculator.call(this);
-    this.startAtZero = startAtZero;
-}
-
-WebInspector.ResourceTimeCalculator.prototype = {
-    computeSummaryValues: function(resources)
-    {
-        var resourcesByCategory = {};
-        var resourcesLength = resources.length;
-        for (var i = 0; i < resourcesLength; ++i) {
-            var resource = resources[i];
-            if (!(resource.category.name in resourcesByCategory))
-                resourcesByCategory[resource.category.name] = [];
-            resourcesByCategory[resource.category.name].push(resource);
-        }
-
-        var earliestStart;
-        var latestEnd;
-        var categoryValues = {};
-        for (var category in resourcesByCategory) {
-            resourcesByCategory[category].sort(WebInspector.Resource.CompareByTime);
-            categoryValues[category] = 0;
-
-            var segment = {start: -1, end: -1};
-
-            var categoryResources = resourcesByCategory[category];
-            var resourcesLength = categoryResources.length;
-            for (var i = 0; i < resourcesLength; ++i) {
-                var resource = categoryResources[i];
-                if (resource.startTime === -1 || resource.endTime === -1)
-                    continue;
-
-                if (typeof earliestStart === "undefined")
-                    earliestStart = resource.startTime;
-                else
-                    earliestStart = Math.min(earliestStart, resource.startTime);
-
-                if (typeof latestEnd === "undefined")
-                    latestEnd = resource.endTime;
-                else
-                    latestEnd = Math.max(latestEnd, resource.endTime);
-
-                if (resource.startTime <= segment.end) {
-                    segment.end = Math.max(segment.end, resource.endTime);
-                    continue;
-                }
-
-                categoryValues[category] += segment.end - segment.start;
-
-                segment.start = resource.startTime;
-                segment.end = resource.endTime;
-            }
-
-            // Add the last segment
-            categoryValues[category] += segment.end - segment.start;
-        }
-
-        return {categoryValues: categoryValues, total: latestEnd - earliestStart};
-    },
-
-    computeBarGraphPercentages: function(resource)
-    {
-        if (resource.startTime !== -1)
-            var start = ((resource.startTime - this.minimumBoundary) / this.boundarySpan) * 100;
-        else
-            var start = 0;
-
-        if (resource.responseReceivedTime !== -1)
-            var middle = ((resource.responseReceivedTime - this.minimumBoundary) / this.boundarySpan) * 100;
-        else
-            var middle = (this.startAtZero ? start : 100);
-
-        if (resource.endTime !== -1)
-            var end = ((resource.endTime - this.minimumBoundary) / this.boundarySpan) * 100;
-        else
-            var end = (this.startAtZero ? middle : 100);
-
-        if (this.startAtZero) {
-            end -= start;
-            middle -= start;
-            start = 0;
-        }
-
-        return {start: start, middle: middle, end: end};
-    },
-    
-    computePercentageFromEventTime: function(eventTime)
-    {
-        // This function computes a percentage in terms of the total loading time
-        // of a specific event. If startAtZero is set, then this is useless, and we
-        // want to return 0.
-        if (eventTime !== -1 && !this.startAtZero)
-            return ((eventTime - this.minimumBoundary) / this.boundarySpan) * 100;
-
-        return 0;
-    },
-
-    computeBarGraphLabels: function(resource)
-    {
-        var rightLabel = "";
-        if (resource.responseReceivedTime !== -1 && resource.endTime !== -1)
-            rightLabel = this.formatValue(resource.endTime - resource.responseReceivedTime);
-
-        var hasLatency = resource.latency > 0;
-        if (hasLatency)
-            var leftLabel = this.formatValue(resource.latency);
-        else
-            var leftLabel = rightLabel;
-
-        if (resource.timing)
-            return {left: leftLabel, right: rightLabel};
-
-        if (hasLatency && rightLabel) {
-            var total = this.formatValue(resource.duration);
-            var tooltip = WebInspector.UIString("%s latency, %s download (%s total)", leftLabel, rightLabel, total);
-        } else if (hasLatency)
-            var tooltip = WebInspector.UIString("%s latency", leftLabel);
-        else if (rightLabel)
-            var tooltip = WebInspector.UIString("%s download", rightLabel);
-
-        if (resource.cached)
-            tooltip = WebInspector.UIString("%s (from cache)", tooltip);
-        return {left: leftLabel, right: rightLabel, tooltip: tooltip};
-    },
-
-    updateBoundaries: function(resource)
-    {
-        var didChange = false;
-
-        var lowerBound;
-        if (this.startAtZero)
-            lowerBound = 0;
-        else
-            lowerBound = this._lowerBound(resource);
-
-        if (lowerBound !== -1 && (typeof this.minimumBoundary === "undefined" || lowerBound < this.minimumBoundary)) {
-            this.minimumBoundary = lowerBound;
-            didChange = true;
-        }
-
-        var upperBound = this._upperBound(resource);
-        if (upperBound !== -1 && (typeof this.maximumBoundary === "undefined" || upperBound > this.maximumBoundary)) {
-            this.maximumBoundary = upperBound;
-            didChange = true;
-        }
-
-        return didChange;
-    },
-
-    formatValue: function(value)
-    {
-        return Number.secondsToString(value, WebInspector.UIString);
-    },
-
-    _lowerBound: function(resource)
-    {
-        return 0;
-    },
-
-    _upperBound: function(resource)
-    {
-        return 0;
-    }
-}
-
-WebInspector.ResourceTimeCalculator.prototype.__proto__ = WebInspector.ResourceBaseCalculator.prototype;
-
-WebInspector.ResourceTransferTimeCalculator = function()
-{
-    WebInspector.ResourceTimeCalculator.call(this, false);
-}
-
-WebInspector.ResourceTransferTimeCalculator.prototype = {
-    formatValue: function(value)
-    {
-        return Number.secondsToString(value, WebInspector.UIString);
-    },
-
-    _lowerBound: function(resource)
-    {
-        return resource.startTime;
-    },
-
-    _upperBound: function(resource)
-    {
-        return resource.endTime;
-    }
-}
-
-WebInspector.ResourceTransferTimeCalculator.prototype.__proto__ = WebInspector.ResourceTimeCalculator.prototype;
-
-WebInspector.ResourceTransferDurationCalculator = function()
-{
-    WebInspector.ResourceTimeCalculator.call(this, true);
-}
-
-WebInspector.ResourceTransferDurationCalculator.prototype = {
-    formatValue: function(value)
-    {
-        return Number.secondsToString(value, WebInspector.UIString);
-    },
-
-    _upperBound: function(resource)
-    {
-        return resource.duration;
-    }
-}
-
-WebInspector.ResourceTransferDurationCalculator.prototype.__proto__ = WebInspector.ResourceTimeCalculator.prototype;
-
-WebInspector.ResourceTransferSizeCalculator = function()
-{
-    WebInspector.ResourceBaseCalculator.call(this);
-}
-
-WebInspector.ResourceTransferSizeCalculator.prototype = {
-    computeBarGraphLabels: function(resource)
-    {
-        var networkBytes = this._networkBytes(resource);
-        var resourceBytes = this._value(resource);
-        if (networkBytes && networkBytes !== resourceBytes) {
-            // Transferred size is not the same as reported resource length.
-            var networkBytesString = this.formatValue(networkBytes);
-            var left = networkBytesString;
-            var right = this.formatValue(resourceBytes);
-            var tooltip = right ? WebInspector.UIString("%s (%s transferred)", right, networkBytesString) : right;
-        } else {
-            var left = this.formatValue(resourceBytes);
-            var right = left;
-            var tooltip = left;
-        }
-        if (resource.cached)
-            tooltip = WebInspector.UIString("%s (from cache)", tooltip);
-        return {left: left, right: right, tooltip: tooltip};
-    },
-
-    computeBarGraphPercentages: function(item)
-    {
-        const resourceBytesAsPercent = (this._value(item) / this.boundarySpan) * 100;
-        const networkBytesAsPercent = this._networkBytes(item) ? (this._networkBytes(item) / this.boundarySpan) * 100 : resourceBytesAsPercent;
-        return {start: 0, middle: networkBytesAsPercent, end: resourceBytesAsPercent};
-    },
-
-    _value: function(resource)
-    {
-        return resource.resourceSize;
-    },
-
-    _networkBytes: function(resource)
-    {
-        return resource.transferSize;
-    },
-
-    formatValue: function(value)
-    {
-        return Number.bytesToString(value, WebInspector.UIString);
-    }
-}
-
-WebInspector.ResourceTransferSizeCalculator.prototype.__proto__ = WebInspector.ResourceBaseCalculator.prototype;
-
-WebInspector.ResourceSidebarTreeElement = function(resource)
-{
-    this.resource = resource;
-
-    this.createIconElement();
-
-    WebInspector.SidebarTreeElement.call(this, "resource-sidebar-tree-item", "", "", resource);
-
-    this.refreshTitles();
-}
-
-WebInspector.ResourceSidebarTreeElement.prototype = {
-    onattach: function()
-    {
-        WebInspector.SidebarTreeElement.prototype.onattach.call(this);
-
-        this._listItemNode.addStyleClass("resources-category-" + this.resource.category.name);
-        this._listItemNode.draggable = true;
-        
-        // FIXME: should actually add handler to parent, to be resolved via
-        // https://bugs.webkit.org/show_bug.cgi?id=30227
-        this._listItemNode.addEventListener("dragstart", this.ondragstart.bind(this), false);
-        this.updateErrorsAndWarnings();
-    },
-
-    onselect: function()
-    {
-        WebInspector.panels.resources.showResource(this.resource);
-    },
-    
-    ondblclick: function(event)
-    {
-        InspectorBackend.openInInspectedWindow(this.resource.url);
-    },
-
-    ondragstart: function(event) {
-        event.dataTransfer.setData("text/plain", this.resource.url);
-        event.dataTransfer.setData("text/uri-list", this.resource.url + "\r\n");
-        event.dataTransfer.effectAllowed = "copy";
-        return true;
-    },
-
-    get mainTitle()
-    {
-        return this.resource.displayName;
-    },
-
-    set mainTitle(x)
-    {
-        // Do nothing.
-    },
-
-    get subtitle()
-    {
-        var subtitle = this.resource.displayDomain;
-
-        if (this.resource.path && this.resource.lastPathComponent) {
-            var lastPathComponentIndex = this.resource.path.lastIndexOf("/" + this.resource.lastPathComponent);
-            if (lastPathComponentIndex != -1)
-                subtitle += this.resource.path.substring(0, lastPathComponentIndex);
-        }
-
-        return subtitle;
-    },
-
-    set subtitle(x)
-    {
-        // Do nothing.
-    },
-
-    get selectable()
-    {
-        return WebInspector.panels.resources.isCategoryVisible(this.resource.category.name);
-    },
-
-    createIconElement: function()
-    {
-        var previousIconElement = this.iconElement;
-
-        if (this.resource.category === WebInspector.resourceCategories.images) {
-            var previewImage = document.createElement("img");
-            previewImage.className = "image-resource-icon-preview";
-
-            function onResourceContent()
-            {
-                previewImage.src = this.resource.contentURL;
-            }
-            if (Preferences.useDataURLForResourceImageIcons)
-                this.resource.getContent(onResourceContent.bind(this));
-            else
-                previewImage.src = this.resource.url;
-
-            this.iconElement = document.createElement("div");
-            this.iconElement.className = "icon";
-            this.iconElement.appendChild(previewImage);
-        } else {
-            this.iconElement = document.createElement("img");
-            this.iconElement.className = "icon";
-        }
-
-        if (previousIconElement)
-            previousIconElement.parentNode.replaceChild(this.iconElement, previousIconElement);
-    },
-
-    refresh: function()
-    {
-        this.refreshTitles();
-
-        if (!this._listItemNode.hasStyleClass("resources-category-" + this.resource.category.name)) {
-            this._listItemNode.removeMatchingStyleClasses("resources-category-\\w+");
-            this._listItemNode.addStyleClass("resources-category-" + this.resource.category.name);
-
-            this.createIconElement();
-        }
-
-        this.tooltip = this.resource.url;
-    },
-
-    resetBubble: function()
-    {
-        this.bubbleText = "";
-        this.bubbleElement.removeStyleClass("search-matches");
-        this.bubbleElement.removeStyleClass("warning");
-        this.bubbleElement.removeStyleClass("error");
-    },
-
-    set searchMatches(matches)
-    {
-        this.resetBubble();
-
-        if (!matches)
-            return;
-
-        this.bubbleText = matches;
-        this.bubbleElement.addStyleClass("search-matches");
-    },
-
-    updateErrorsAndWarnings: function()
-    {
-        this.resetBubble();
-
-        if (this.resource.warnings || this.resource.errors)
-            this.bubbleText = (this.resource.warnings + this.resource.errors);
-
-        if (this.resource.warnings)
-            this.bubbleElement.addStyleClass("warning");
-
-        if (this.resource.errors)
-            this.bubbleElement.addStyleClass("error");
-    }
-}
-
-WebInspector.ResourceSidebarTreeElement.CompareByAscendingStartTime = function(a, b)
-{
-    return WebInspector.Resource.CompareByStartTime(a.resource, b.resource)
-        || WebInspector.Resource.CompareByEndTime(a.resource, b.resource)
-        || WebInspector.Resource.CompareByResponseReceivedTime(a.resource, b.resource);
-}
-
-WebInspector.ResourceSidebarTreeElement.CompareByAscendingResponseReceivedTime = function(a, b)
-{
-    return WebInspector.Resource.CompareByResponseReceivedTime(a.resource, b.resource)
-        || WebInspector.Resource.CompareByStartTime(a.resource, b.resource)
-        || WebInspector.Resource.CompareByEndTime(a.resource, b.resource);
-}
-
-WebInspector.ResourceSidebarTreeElement.CompareByAscendingEndTime = function(a, b)
-{
-    return WebInspector.Resource.CompareByEndTime(a.resource, b.resource)
-        || WebInspector.Resource.CompareByStartTime(a.resource, b.resource)
-        || WebInspector.Resource.CompareByResponseReceivedTime(a.resource, b.resource);
-}
-
-WebInspector.ResourceSidebarTreeElement.CompareByDescendingDuration = function(a, b)
-{
-    return -1 * WebInspector.Resource.CompareByDuration(a.resource, b.resource);
-}
-
-WebInspector.ResourceSidebarTreeElement.CompareByDescendingLatency = function(a, b)
-{
-    return -1 * WebInspector.Resource.CompareByLatency(a.resource, b.resource);
-}
-
-WebInspector.ResourceSidebarTreeElement.CompareByDescendingSize = function(a, b)
-{
-    return -1 * WebInspector.Resource.CompareBySize(a.resource, b.resource);
-}
-
-WebInspector.ResourceSidebarTreeElement.CompareByDescendingTransferSize = function(a, b)
-{
-    return -1 * WebInspector.Resource.CompareByTransferSize(a.resource, b.resource);
-}
-
-WebInspector.ResourceSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
-
-WebInspector.ResourceGraph = function(resource)
-{
-    this.resource = resource;
-
-    this._graphElement = document.createElement("div");
-    this._graphElement.className = "resources-graph-side";
-    this._graphElement.addEventListener("mouseover", this.refreshLabelPositions.bind(this), false);
-
-    if (this.resource.cached)
-        this._graphElement.addStyleClass("resource-cached");
-
-    this._barAreaElement = document.createElement("div");
-    this._barAreaElement.className = "resources-graph-bar-area hidden";
-    this._barAreaElement.resource = resource;
-    this._graphElement.appendChild(this._barAreaElement);
-
-    this._barLeftElement = document.createElement("div");
-    this._barLeftElement.className = "resources-graph-bar waiting";
-    this._barAreaElement.appendChild(this._barLeftElement);
-
-    this._barRightElement = document.createElement("div");
-    this._barRightElement.className = "resources-graph-bar";
-    this._barAreaElement.appendChild(this._barRightElement);
-
-    this._labelLeftElement = document.createElement("div");
-    this._labelLeftElement.className = "resources-graph-label waiting";
-    this._barAreaElement.appendChild(this._labelLeftElement);
-
-    this._labelRightElement = document.createElement("div");
-    this._labelRightElement.className = "resources-graph-label";
-    this._barAreaElement.appendChild(this._labelRightElement);
-
-    this._graphElement.addStyleClass("resources-category-" + resource.category.name);
-}
-
-WebInspector.ResourceGraph.prototype = {
-    get graphElement()
-    {
-        return this._graphElement;
-    },
-
-    refreshLabelPositions: function()
-    {
-        this._labelLeftElement.style.removeProperty("left");
-        this._labelLeftElement.style.removeProperty("right");
-        this._labelLeftElement.removeStyleClass("before");
-        this._labelLeftElement.removeStyleClass("hidden");
-
-        this._labelRightElement.style.removeProperty("left");
-        this._labelRightElement.style.removeProperty("right");
-        this._labelRightElement.removeStyleClass("after");
-        this._labelRightElement.removeStyleClass("hidden");
-
-        const labelPadding = 10;
-        const barRightElementOffsetWidth = this._barRightElement.offsetWidth;
-        const barLeftElementOffsetWidth = this._barLeftElement.offsetWidth;
-
-        if (this._isBarOpaqueAtLeft) {
-            var leftBarWidth = barLeftElementOffsetWidth - labelPadding;
-            var rightBarWidth = (barRightElementOffsetWidth - barLeftElementOffsetWidth) - labelPadding;
-        } else {
-            var leftBarWidth = (barLeftElementOffsetWidth - barRightElementOffsetWidth) - labelPadding;
-            var rightBarWidth = barRightElementOffsetWidth - labelPadding;
-        }
-
-        const labelLeftElementOffsetWidth = this._labelLeftElement.offsetWidth;
-        const labelRightElementOffsetWidth = this._labelRightElement.offsetWidth;
-
-        const labelBefore = (labelLeftElementOffsetWidth > leftBarWidth);
-        const labelAfter = (labelRightElementOffsetWidth > rightBarWidth);
-        const graphElementOffsetWidth = this._graphElement.offsetWidth;
-
-        if (labelBefore && (graphElementOffsetWidth * (this._percentages.start / 100)) < (labelLeftElementOffsetWidth + 10))
-            var leftHidden = true;
-
-        if (labelAfter && (graphElementOffsetWidth * ((100 - this._percentages.end) / 100)) < (labelRightElementOffsetWidth + 10))
-            var rightHidden = true;
-
-        if (barLeftElementOffsetWidth == barRightElementOffsetWidth) {
-            // The left/right label data are the same, so a before/after label can be replaced by an on-bar label.
-            if (labelBefore && !labelAfter)
-                leftHidden = true;
-            else if (labelAfter && !labelBefore)
-                rightHidden = true;
-        }
-
-        if (labelBefore) {
-            if (leftHidden)
-                this._labelLeftElement.addStyleClass("hidden");
-            this._labelLeftElement.style.setProperty("right", (100 - this._percentages.start) + "%");
-            this._labelLeftElement.addStyleClass("before");
-        } else {
-            this._labelLeftElement.style.setProperty("left", this._percentages.start + "%");
-            this._labelLeftElement.style.setProperty("right", (100 - this._percentages.middle) + "%");
-        }
-
-        if (labelAfter) {
-            if (rightHidden)
-                this._labelRightElement.addStyleClass("hidden");
-            this._labelRightElement.style.setProperty("left", this._percentages.end + "%");
-            this._labelRightElement.addStyleClass("after");
-        } else {
-            this._labelRightElement.style.setProperty("left", this._percentages.middle + "%");
-            this._labelRightElement.style.setProperty("right", (100 - this._percentages.end) + "%");
-        }
-    },
-
-    refresh: function(calculator, isBarOpaqueAtLeft)
-    {
-        var percentages = calculator.computeBarGraphPercentages(this.resource);
-        var labels = calculator.computeBarGraphLabels(this.resource);
-
-        this._percentages = percentages;
-
-        this._barAreaElement.removeStyleClass("hidden");
-
-        if (!this._graphElement.hasStyleClass("resources-category-" + this.resource.category.name)) {
-            this._graphElement.removeMatchingStyleClasses("resources-category-\\w+");
-            this._graphElement.addStyleClass("resources-category-" + this.resource.category.name);
-        }
-
-        this._barLeftElement.style.setProperty("left", percentages.start + "%");
-        this._barRightElement.style.setProperty("right", (100 - percentages.end) + "%");
-
-        if (!isBarOpaqueAtLeft) {
-            this._barLeftElement.style.setProperty("right", (100 - percentages.end) + "%");
-            this._barRightElement.style.setProperty("left", percentages.middle + "%");
-
-            if (this._isBarOpaqueAtLeft != isBarOpaqueAtLeft) {
-                this._barLeftElement.addStyleClass("waiting");
-                this._barRightElement.removeStyleClass("waiting-right");
-                this._labelLeftElement.addStyleClass("waiting");
-                this._labelRightElement.removeStyleClass("waiting-right");
-            }
-        } else {
-            this._barLeftElement.style.setProperty("right", (100 - percentages.middle) + "%");
-            this._barRightElement.style.setProperty("left", percentages.start + "%");
-
-            if (this._isBarOpaqueAtLeft != isBarOpaqueAtLeft) {
-                this._barLeftElement.removeStyleClass("waiting");
-                this._barRightElement.addStyleClass("waiting-right");
-                this._labelLeftElement.removeStyleClass("waiting");
-                this._labelRightElement.addStyleClass("waiting-right");
-            }
-        }
-
-        this._isBarOpaqueAtLeft = isBarOpaqueAtLeft;
-
-        this._labelLeftElement.textContent = labels.left;
-        this._labelRightElement.textContent = labels.right;
-
-        var tooltip = (labels.tooltip || "");
-        this._barLeftElement.title = tooltip;
-        this._labelLeftElement.title = tooltip;
-        this._labelRightElement.title = tooltip;
-        this._barRightElement.title = tooltip;
-
-        if (this.resource.cached && !this._graphElement.hasStyleClass("resource-cached"))
-            this._graphElement.addStyleClass("resource-cached");
-    }
-}
index b5f3984..22fa153 100644 (file)
@@ -45,7 +45,6 @@ var Preferences = {
     onlineDetectionEnabled: true,
     nativeInstrumentationEnabled: false,
     resourceExportEnabled: false,
-    networkPanelEnabled: true,
     fileSystemEnabled: false,
     useDataURLForResourceImageIcons: true
 }
index 0205f0a..6f712e5 100644 (file)
@@ -37,11 +37,9 @@ WebInspector.StoragePanel = function(database)
     this.sidebarElement.addStyleClass("outline-disclosure filter-all children small");
     this.sidebarTreeElement.removeStyleClass("sidebar-tree");
 
-    if (Preferences.networkPanelEnabled) {
-        this.resourcesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Frames"), "Frames", "frame-storage-tree-item");
-        this.sidebarTree.appendChild(this.resourcesListTreeElement);
-        this._treeElementForFrameId = {};
-    }
+    this.resourcesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Frames"), "Frames", "frame-storage-tree-item");
+    this.sidebarTree.appendChild(this.resourcesListTreeElement);
+    this._treeElementForFrameId = {};
 
     this.databasesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Databases"), "Databases", "database-storage-tree-item");
     this.sidebarTree.appendChild(this.databasesListTreeElement);
@@ -81,7 +79,7 @@ WebInspector.StoragePanel = function(database)
 WebInspector.StoragePanel.prototype = {
     get toolbarItemLabel()
     {
-        return Preferences.networkPanelEnabled ? WebInspector.UIString("Resources") : WebInspector.UIString("Storage");
+        return WebInspector.UIString("Resources");
     },
 
     get statusBarItems()
@@ -632,9 +630,6 @@ WebInspector.StoragePanel.prototype = {
     {
         var views = [];
 
-        if (!Preferences.networkPanelEnabled)
-            return views;
-
         const visibleView = this.visibleView;
         if (visibleView instanceof WebInspector.ResourceView && visibleView.performSearch)
             views.push(visibleView);
index 0c7a735..793a06d 100644 (file)
@@ -71,7 +71,6 @@
     <file>Resource.js</file>
     <file>ResourceCategory.js</file>
     <file>ResourceManager.js</file>
-    <file>ResourcesPanel.js</file>
     <file>ResourceView.js</file>
     <file>ScopeChainSidebarPane.js</file>
     <file>Script.js</file>
index 93e61c7..c681531 100644 (file)
@@ -96,7 +96,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="SummaryBar.js"></script>
     <script type="text/javascript" src="ElementsPanel.js"></script>
     <script type="text/javascript" src="NetworkPanel.js"></script>
-    <script type="text/javascript" src="ResourcesPanel.js"></script>
     <script type="text/javascript" src="InjectedFakeWorker.js"></script>
     <script type="text/javascript" src="ScriptsPanel.js"></script>
     <script type="text/javascript" src="StoragePanel.js"></script>
index c89d90a..e178371 100644 (file)
@@ -224,15 +224,9 @@ var WebInspector = {
         if (hiddenPanels.indexOf("elements") === -1)
             this.panels.elements = new WebInspector.ElementsPanel();
 
-        if (Preferences.networkPanelEnabled) {
-            if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
-                this.panels.storage = new WebInspector.StoragePanel();
-            if (hiddenPanels.indexOf("network") === -1)
-                this.panels.network = new WebInspector.NetworkPanel();
-        } else if (hiddenPanels.indexOf("resources") === -1)
-            this.panels.resources = new WebInspector.ResourcesPanel();
-
-        if (Preferences.networkPanelEnabled && hiddenPanels.indexOf("network") === -1)
+        if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
+            this.panels.storage = new WebInspector.StoragePanel();
+        if (hiddenPanels.indexOf("network") === -1)
             this.panels.network = new WebInspector.NetworkPanel();
         if (hiddenPanels.indexOf("scripts") === -1)
             this.panels.scripts = new WebInspector.ScriptsPanel();
@@ -244,12 +238,6 @@ var WebInspector = {
             if (Preferences.heapProfilerPresent)
                 this.panels.profiles.registerProfileType(new WebInspector.HeapSnapshotProfileType());
         }
-
-        if (!Preferences.networkPanelEnabled) {
-            if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
-                this.panels.storage = new WebInspector.StoragePanel();
-        }
-
         if (hiddenPanels.indexOf("audits") === -1)
             this.panels.audits = new WebInspector.AuditsPanel();
         if (hiddenPanels.indexOf("console") === -1)
@@ -453,29 +441,17 @@ var WebInspector = {
 
     get networkResources()
     {
-        if (Preferences.networkPanelEnabled)
-            return this.panels.network.resources;
-        else
-            return this.resources;
+        return this.panels.network.resources;
     },
 
     forAllResources: function(callback)
     {
-        if (Preferences.networkPanelEnabled)
-            WebInspector.resourceManager.forAllResources(callback);
-        else {
-            for (var id in this.resources) {
-                if (callback(this.resources[id]))
-                    return;
-            }
-        }
+        WebInspector.resourceManager.forAllResources(callback);
     },
 
     resourceForURL: function(url)
     {
-        if (Preferences.networkPanelEnabled)
-            return this.resourceManager.resourceForURL(url);
-        return this.panels.resources.resourceURLMap[url];
+        return this.resourceManager.resourceForURL(url);
     }
 }
 
@@ -542,8 +518,7 @@ WebInspector.doLoadedDone = function()
     // this.changes = new WebInspector.ChangesView(this.drawer);
     // TODO: Remove class="hidden" from inspector.html on button#changes-status-bar-item
     this.drawer.visibleView = this.console;
-    if (Preferences.networkPanelEnabled)
-        this.resourceManager = new WebInspector.ResourceManager();
+    this.resourceManager = new WebInspector.ResourceManager();
     this.domAgent = new WebInspector.DOMAgent();
 
     this.resourceCategories = {
@@ -571,10 +546,9 @@ WebInspector.doLoadedDone = function()
     for (var panelName in this.panels)
         previousToolbarItem = WebInspector.addPanelToolbarIcon(toolbarElement, this.panels[panelName], previousToolbarItem);
 
-    if (Preferences.networkPanelEnabled) {
-        this.panels.storage._toolbarItem.removeStyleClass("storage");
-        this.panels.storage._toolbarItem.addStyleClass("resources");
-    }
+    // FIXME: fix this once renated StoragePanel.js to ResourcesPanel.js
+    this.panels.storage._toolbarItem.removeStyleClass("storage");
+    this.panels.storage._toolbarItem.addStyleClass("resources");
 
     this.Tips = {
         ResourceNotCompressed: {id: 0, message: WebInspector.UIString("You could save bandwidth by having your web server compress this transfer with gzip or zlib.")}
@@ -628,12 +602,6 @@ WebInspector.doLoadedDone = function()
         WebInspector.monitoringXHREnabled = inspectorState.monitoringXHREnabled;
         if ("pauseOnExceptionsState" in inspectorState)
             WebInspector.panels.scripts.updatePauseOnExceptionsState(inspectorState.pauseOnExceptionsState);
-        if (WebInspector.panels.resources) {
-            if (inspectorState.resourceTrackingEnabled)
-                WebInspector.panels.resources.resourceTrackingWasEnabled();
-            else
-                WebInspector.panels.resources.resourceTrackingWasDisabled();
-        }
     }
     InspectorBackend.getInspectorState(populateInspectorState);
 
@@ -842,13 +810,8 @@ WebInspector.openResource = function(resourceURL, inResourcesPanel)
 {
     var resource = WebInspector.resourceForURL(resourceURL);
     if (inResourcesPanel && resource) {
-        if (Preferences.networkPanelEnabled) {
-            WebInspector.panels.storage.showResource(resource);
-            WebInspector.showPanel("storage");
-        } else {
-            WebInspector.panels.resources.showResource(resource);
-            WebInspector.showPanel("resources");
-        }
+        WebInspector.panels.storage.showResource(resource);
+        WebInspector.showPanel("storage");
     } else
         InspectorBackend.openInInspectedWindow(resource ? resource.url : resourceURL);
 }
@@ -1265,81 +1228,8 @@ WebInspector.selectDOMStorage = function(o)
     WebInspector.panels.storage.selectDOMStorage(o);
 }
 
-WebInspector.updateResource = function(payload)
-{
-    if (Preferences.networkPanelEnabled)
-        return;
-
-    var identifier = payload.id;
-    var resource = this.resources[identifier];
-    if (!resource) {
-        resource = new WebInspector.Resource(identifier, payload.url);
-        this.resources[identifier] = resource;
-        this.panels.resources.addResource(resource);
-        this.panels.audits.resourceStarted(resource);
-    }
-
-    if (payload.didRequestChange) {
-        resource.requestHeaders = payload.requestHeaders;
-        resource.mainResource = payload.mainResource;
-        resource.requestMethod = payload.requestMethod;
-        resource.requestFormData = payload.requestFormData;
-        resource.documentURL = payload.documentURL;
-        if (typeof payload.webSocketRequestKey3 !== "undefined")
-            resource.webSocketRequestKey3 = payload.webSocketRequestKey3;
-
-        if (resource.mainResource)
-            this.mainResource = resource;
-
-        this.panels.storage.addDocumentURL(payload.documentURL);
-    }
-
-    if (payload.didResponseChange) {
-        resource.mimeType = payload.mimeType;
-        resource.suggestedFilename = payload.suggestedFilename;
-        resource.expectedContentLength = payload.expectedContentLength;
-        resource.statusCode = payload.statusCode;
-        resource.statusText = payload.statusText;
-        resource.suggestedFilename = payload.suggestedFilename;
-        resource.responseHeaders = payload.responseHeaders;
-        resource.connectionID = payload.connectionID;
-        resource.connectionReused = payload.connectionReused;
-        resource.timing = payload.timing;
-        resource.cached = payload.cached;
-        if (typeof payload.webSocketChallengeResponse !== "undefined")
-            resource.webSocketChallengeResponse = payload.webSocketChallengeResponse;
-    }
-
-    if (payload.didTypeChange)
-        resource.type = payload.type;
-
-    if (payload.didLengthChange)
-        resource.resourceSize = payload.resourceSize;
-
-    if (payload.didCompletionChange) {
-        resource.failed = payload.failed;
-        resource.localizedFailDescription = payload.localizedFailDescription;
-        resource.finished = payload.finished;
-        if (this.panels.audits)
-            this.panels.audits.resourceFinished(resource);
-        this.extensionServer.notifyResourceFinished(resource);
-    }
-
-    if (payload.didTimingChange) {
-        if (payload.startTime)
-            resource.startTime = payload.startTime;
-        if (payload.responseReceivedTime)
-            resource.responseReceivedTime = payload.responseReceivedTime;
-        if (payload.endTime)
-            resource.endTime = payload.endTime;
-    }
-    this.panels.resources.refreshResource(resource);
-}
-
 WebInspector.domContentEventFired = function(time)
 {
-    if (this.panels.resources)
-        this.panels.resources.mainResourceDOMContentTime = time;
     this.panels.audits.mainResourceDOMContentTime = time;
     if (this.panels.network)
         this.panels.network.mainResourceDOMContentTime = time;
@@ -1348,29 +1238,12 @@ WebInspector.domContentEventFired = function(time)
 
 WebInspector.loadEventFired = function(time)
 {
-    if (this.panels.resources)
-        this.panels.resources.mainResourceLoadTime = time;
     this.panels.audits.mainResourceLoadTime = time;
     if (this.panels.network)
         this.panels.network.mainResourceLoadTime = time;
     this.mainResourceLoadTime = time;
 }
 
-WebInspector.removeResource = function(identifier)
-{
-    if (Preferences.networkPanelEnabled)
-        return;
-
-    var resource = this.resources[identifier];
-    if (!resource)
-        return;
-
-    delete this.resources[identifier];
-
-    if (this.panels.resources)
-        this.panels.resources.removeResource(resource);
-}
-
 WebInspector.addDatabase = function(payload)
 {
     if (!this.panels.storage)
@@ -1498,9 +1371,6 @@ WebInspector.reset = function()
     this.fileSystemOrigins = {};
     this.highlightDOMNode(0);
 
-    if (!Preferences.networkPanelEnabled)
-        delete this.mainResource;
-
     this.console.clearMessages();
     this.extensionServer.notifyInspectorReset();
 }
@@ -1730,13 +1600,14 @@ WebInspector.displayNameForURL = function(url)
 WebInspector._choosePanelToShowSourceLine = function(url, line, preferredPanel)
 {
     preferredPanel = preferredPanel || "resources";
-    if (Preferences.networkPanelEnabled && preferredPanel === "resources")
+    // FIXME: remove this once StoragePanel renamed to ResourcesPanel
+    if (preferredPanel === "resources")
         preferredPanel = "storage";
 
     var panel = this.panels[preferredPanel];
     if (panel && panel.canShowSourceLine(url, line))
         return panel;
-    panel = Preferences.networkPanelEnabled ? this.panels.storage : this.panels.resources;
+    panel = this.panels.storage;
     return panel.canShowSourceLine(url, line) ? panel : null;
 }
 
index e6f11ca..29d88de 100644 (file)
@@ -1,3 +1,14 @@
+2010-11-01  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: remove old resources panel.
+        https://bugs.webkit.org/show_bug.cgi?id=45657
+
+        * src/WebDevToolsAgentImpl.cpp:
+        (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled):
+        * src/WebDevToolsAgentImpl.h:
+
 2010-11-01  Leandro Gracia Gil  <leandrogracia@google.com>
 
         Reviewed by Jeremy Orlow.
index 14d557f..e9ff872 100644 (file)
@@ -265,26 +265,11 @@ void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled)
         if (!ic->hasFrontend())
             connectFrontend(true);
 
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-        m_resourceTrackingWasEnabled = ic->resourceTrackingEnabled();
-#endif
         ic->startTimelineProfiler();
-#if LEGACY_RESOURCE_TRACKING_ENABLED
-        if (!m_resourceTrackingWasEnabled) {
-            // TODO(knorton): Introduce some kind of agents dependency here so that
-            // user could turn off resource tracking while apu agent is on.
-            ic->setResourceTrackingEnabled(true);
-        }
-#endif
         m_debuggerAgentImpl->setAutoContinueOnException(true);
-    } else {
+    } else
       ic->stopTimelineProfiler();
-#if LEGACY_RESOURCE_TRACKING_ENABLED        
-      if (!m_resourceTrackingWasEnabled)
-          ic->setResourceTrackingEnabled(false);
-      m_resourceTrackingWasEnabled = false;
-#endif
-    }
+
     m_client->runtimePropertyChanged(
         kApuAgentFeatureName,
         enabled ? String("true") : String("false"));
index 47c4ccf..feb4bdd 100644 (file)
@@ -109,7 +109,6 @@ private:
     WebViewImpl* m_webViewImpl;
     OwnPtr<DebuggerAgentImpl> m_debuggerAgentImpl;
     bool m_apuAgentEnabled;
-    bool m_resourceTrackingWasEnabled;
     bool m_attached;
 };