Source/WebCore: Web Inspector: extracting NetworkRequest from Resource (step 1)
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Apr 2012 15:29:42 +0000 (15:29 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Apr 2012 15:29:42 +0000 (15:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83684

Reviewed by Yury Semikhatsky.

Meta bug: https://bugs.webkit.org/show_bug.cgi?id=61363.
In this step, NetworkRequest is introduced. It temporarily inherits from
the Resource, but all the call sites are now referring to it as to request.

* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/compile-front-end.py:
* inspector/front-end/ApplicationCacheItemsView.js:
(WebInspector.ApplicationCacheItemsView.prototype._updateCallback):
* inspector/front-end/AuditLauncherView.js:
(WebInspector.AuditLauncherView):
(WebInspector.AuditLauncherView.prototype._onRequestStarted):
(WebInspector.AuditLauncherView.prototype._onRequestFinished):
* inspector/front-end/AuditRules.js:
(WebInspector.AuditRules.getDomainToResourcesMap):
(WebInspector.AuditRules.GzipRule.prototype.doRun):
(WebInspector.AuditRules.GzipRule.prototype._isCompressed):
(WebInspector.AuditRules.GzipRule.prototype._shouldCompress):
(WebInspector.AuditRules.CombineExternalResourcesRule.prototype.doRun):
(WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.doRun):
(WebInspector.AuditRules.ParallelizeDownloadRule.prototype.doRun):
(WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback.selectorsCallback):
(WebInspector.AuditRules.CacheControlRule.prototype.doRun):
(WebInspector.AuditRules.CacheControlRule.prototype.handleNonCacheableResources):
(WebInspector.AuditRules.CacheControlRule.prototype._cacheableAndNonCacheableResources):
(WebInspector.AuditRules.CacheControlRule.prototype.execCheck):
(WebInspector.AuditRules.CacheControlRule.prototype.freshnessLifetimeGreaterThan):
(WebInspector.AuditRules.CacheControlRule.prototype.responseHeader):
(WebInspector.AuditRules.CacheControlRule.prototype.hasResponseHeader):
(WebInspector.AuditRules.CacheControlRule.prototype.isCompressible):
(WebInspector.AuditRules.CacheControlRule.prototype.isPubliclyCacheable):
(WebInspector.AuditRules.CacheControlRule.prototype.responseHeaderMatch):
(WebInspector.AuditRules.CacheControlRule.prototype.hasExplicitExpiration):
(WebInspector.AuditRules.CacheControlRule.prototype._isExplicitlyNonCacheable):
(WebInspector.AuditRules.CacheControlRule.prototype.isCacheableResource):
(WebInspector.AuditRules.BrowserCacheControlRule.prototype.handleNonCacheableResources):
(WebInspector.AuditRules.BrowserCacheControlRule.prototype.runChecks):
(WebInspector.AuditRules.BrowserCacheControlRule.prototype._missingExpirationCheck):
(WebInspector.AuditRules.BrowserCacheControlRule.prototype._varyCheck):
(WebInspector.AuditRules.BrowserCacheControlRule.prototype._oneMonthExpirationCheck):
(WebInspector.AuditRules.BrowserCacheControlRule.prototype._oneYearExpirationCheck):
(WebInspector.AuditRules.ProxyCacheControlRule.prototype.runChecks):
(WebInspector.AuditRules.ProxyCacheControlRule.prototype._questionMarkCheck):
(WebInspector.AuditRules.ProxyCacheControlRule.prototype._publicCachingCheck):
(WebInspector.AuditRules.ProxyCacheControlRule.prototype._setCookieCacheableCheck):
(WebInspector.AuditRules.CookieRuleBase.prototype.doRun.resultCallback):
(WebInspector.AuditRules.CookieRuleBase.prototype.doRun):
(WebInspector.AuditRules.CookieRuleBase.prototype.mapResourceCookies):
(WebInspector.AuditRules.CookieRuleBase.prototype._callbackForResourceCookiePairs):
(WebInspector.AuditRules.CookieSizeRule.prototype.processCookies):
(WebInspector.AuditRules.StaticCookielessRule.prototype.processCookies):
(WebInspector.AuditRules.StaticCookielessRule.prototype._collectorCallback):
* inspector/front-end/AuditsPanel.js:
(WebInspector.AuditsPanel.prototype._executeAudit):
(WebInspector.AuditCategory.prototype.run):
(WebInspector.AuditRule.prototype.run):
(WebInspector.AuditRule.prototype.doRun):
* inspector/front-end/ConsoleMessage.js:
* inspector/front-end/ConsoleModel.js:
(WebInspector.ConsoleDispatcher.prototype.messageAdded):
* inspector/front-end/ContentProviders.js:
(WebInspector.ResourceContentProvider):
(WebInspector.ResourceContentProvider.prototype.requestContent):
(WebInspector.ResourceContentProvider.prototype.searchInContent):
* inspector/front-end/DebuggerPresentationModel.js:
* inspector/front-end/ExtensionServer.js:
(WebInspector.ExtensionServer.prototype._onGetHAR):
(WebInspector.ExtensionServer.prototype._notifyRequestFinished):
* inspector/front-end/HAREntry.js:
(WebInspector.HAREntry):
(WebInspector.HAREntry.prototype.build):
(WebInspector.HAREntry.prototype._buildRequest):
(WebInspector.HAREntry.prototype._buildResponse):
(WebInspector.HAREntry.prototype._buildContent):
(WebInspector.HAREntry.prototype._buildTimings):
(WebInspector.HAREntry.prototype._buildPostData):
(WebInspector.HAREntry.prototype._buildCookie):
(WebInspector.HAREntry.prototype._interval):
(WebInspector.HAREntry.prototype.get requestBodySize):
(WebInspector.HAREntry.prototype.get responseBodySize):
(WebInspector.HAREntry.prototype.get responseCompression):
(WebInspector.HARLog):
(WebInspector.HARLog.prototype.build):
(WebInspector.HARLog.prototype._buildPages):
(WebInspector.HARLog.prototype._convertResource):
* inspector/front-end/NetworkItemView.js:
(WebInspector.NetworkItemView):
* inspector/front-end/NetworkLog.js:
(WebInspector.NetworkLog):
(WebInspector.NetworkLog.prototype.get requests):
(WebInspector.NetworkLog.prototype.pageLoadForRequest):
(WebInspector.NetworkLog.prototype._onMainFrameNavigated):
(WebInspector.NetworkLog.prototype._onRequestStarted):
(WebInspector.NetworkLog.prototype._onLoad):
(WebInspector.PageLoad):
* inspector/front-end/NetworkManager.js:
(WebInspector.NetworkManager.get this):
(WebInspector.NetworkManager.get NetworkAgent):
(WebInspector.NetworkManager):
(WebInspector.NetworkManager.prototype.inflightRequestForURL):
(WebInspector.NetworkDispatcher):
(WebInspector.NetworkDispatcher.prototype._updateNetworkRequestWithRequest):
(WebInspector.NetworkDispatcher.prototype._updateNetworkRequestWithResponse):
(WebInspector.NetworkDispatcher.prototype._mimeTypeIsConsistentWithType):
(WebInspector.NetworkDispatcher.prototype._updateNetworkRequestWithCachedResource):
(WebInspector.NetworkDispatcher.prototype.requestWillBeSent):
(WebInspector.NetworkDispatcher.prototype.requestServedFromCache):
(WebInspector.NetworkDispatcher.prototype.responseReceived):
(WebInspector.NetworkDispatcher.prototype.dataReceived):
(WebInspector.NetworkDispatcher.prototype.loadingFinished):
(WebInspector.NetworkDispatcher.prototype.loadingFailed):
(WebInspector.NetworkDispatcher.prototype.requestServedFromMemoryCache):
(WebInspector.NetworkDispatcher.prototype.webSocketCreated):
(WebInspector.NetworkDispatcher.prototype.webSocketWillSendHandshakeRequest):
(WebInspector.NetworkDispatcher.prototype.webSocketHandshakeResponseReceived):
(WebInspector.NetworkDispatcher.prototype.webSocketClosed):
(WebInspector.NetworkDispatcher.prototype._appendRedirect):
(WebInspector.NetworkDispatcher.prototype._startNetworkRequest):
(WebInspector.NetworkDispatcher.prototype._updateNetworkRequest):
(WebInspector.NetworkDispatcher.prototype._finishNetworkRequest):
(WebInspector.NetworkDispatcher.prototype._dispatchEventToListeners):
(WebInspector.NetworkDispatcher.prototype._createNetworkRequest):
(get WebInspector):
* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkLogView.prototype._initializeView):
(WebInspector.NetworkLogView.prototype.get statusBarItems):
(WebInspector.NetworkLogView.prototype._createSortingFunctions):
(WebInspector.NetworkLogView.prototype._updateSummaryBar):
(WebInspector.NetworkLogView.prototype._updateDividersIfNeeded):
(WebInspector.NetworkLogView.prototype._invalidateAllItems):
(WebInspector.NetworkLogView.prototype._requestGridNode):
(WebInspector.NetworkLogView.prototype._createRequestGridNode):
(WebInspector.NetworkLogView.prototype._onLoadEventFired):
(WebInspector.NetworkLogView.prototype._domContentLoadedEventFired):
(WebInspector.NetworkLogView.prototype.refresh):
(WebInspector.NetworkLogView.prototype._reset):
(WebInspector.NetworkLogView.prototype.get requests):
(WebInspector.NetworkLogView.prototype.requestById):
(WebInspector.NetworkLogView.prototype._onRequestStarted):
(WebInspector.NetworkLogView.prototype._appendRequest):
(WebInspector.NetworkLogView.prototype._onRequestUpdated):
(WebInspector.NetworkLogView.prototype._refreshRequest):
(WebInspector.NetworkLogView.prototype._mainFrameNavigated):
(WebInspector.NetworkLogView.prototype.get _setLargerRequests):
(WebInspector.NetworkLogView.prototype._getPopoverAnchor):
(WebInspector.NetworkLogView.prototype._showPopover):
(WebInspector.NetworkLogView.prototype._contextMenu):
(WebInspector.NetworkLogView.prototype._copyAll):
(WebInspector.NetworkLogView.prototype._copyRequest):
(WebInspector.NetworkLogView.prototype._copyLocation):
(WebInspector.NetworkLogView.prototype._copyRequestHeaders):
(WebInspector.NetworkLogView.prototype._copyResponseHeaders):
(WebInspector.NetworkLogView.prototype._exportAll):
(WebInspector.NetworkLogView.prototype._exportRequest):
(WebInspector.NetworkLogView.prototype._matchRequest):
(WebInspector.NetworkLogView.prototype._clearSearchMatchedList):
(WebInspector.NetworkLogView.prototype._updateSearchMatchedListAfterRequestIdChanged):
(WebInspector.NetworkLogView.prototype._updateHighlightIfMatched):
(WebInspector.NetworkLogView.prototype._highlightNthMatchedRequest):
(WebInspector.NetworkLogView.prototype.performSearch):
(WebInspector.NetworkLogView.prototype.jumpToPreviousSearchResult):
(WebInspector.NetworkLogView.prototype.jumpToNextSearchResult):
(WebInspector.NetworkLogView.prototype.revealAndHighlightRequest):
(WebInspector.NetworkPanel.prototype.handleShortcut):
(WebInspector.NetworkPanel.prototype.get requests):
(WebInspector.NetworkPanel.prototype.requestById):
(WebInspector.NetworkPanel.prototype._requestByAnchor):
(WebInspector.NetworkPanel.prototype.canShowAnchorLocation):
(WebInspector.NetworkPanel.prototype.showAnchorLocation):
(WebInspector.NetworkPanel.prototype.revealAndHighlightRequest):
(WebInspector.NetworkPanel.prototype._onViewCleared):
(WebInspector.NetworkPanel.prototype._onRequestSelected):
(WebInspector.NetworkPanel.prototype._showRequest):
(WebInspector.NetworkPanel.prototype._closeVisibleRequest):
(WebInspector.NetworkPanel.prototype._toggleGridMode):
(WebInspector.NetworkPanel.prototype._toggleViewingRequestMode):
(WebInspector.NetworkTimeCalculator.prototype.computeBarGraphPercentages):
(WebInspector.NetworkTimeCalculator.prototype.computeBarGraphLabels):
(WebInspector.NetworkTimeCalculator.prototype.updateBoundaries):
(WebInspector.NetworkTimeCalculator.prototype._lowerBound):
(WebInspector.NetworkTimeCalculator.prototype._upperBound):
(WebInspector.NetworkTransferTimeCalculator.prototype._lowerBound):
(WebInspector.NetworkTransferTimeCalculator.prototype._upperBound):
(WebInspector.NetworkTransferDurationCalculator.prototype._upperBound):
(WebInspector.NetworkDataGridNode):
(WebInspector.NetworkDataGridNode.prototype.isFilteredOut):
(WebInspector.NetworkDataGridNode.prototype.select):
(WebInspector.NetworkDataGridNode.prototype._openInNewTab):
(WebInspector.NetworkDataGridNode.prototype.get selectable):
(WebInspector.NetworkDataGridNode.prototype._createTimelineCell):
(WebInspector.NetworkDataGridNode.prototype.refreshRequest):
(WebInspector.NetworkDataGridNode.prototype._refreshNameCell):
(WebInspector.NetworkDataGridNode.prototype._fileName):
(WebInspector.NetworkDataGridNode.prototype._refreshStatusCell):
(WebInspector.NetworkDataGridNode.prototype._refreshTypeCell):
(WebInspector.NetworkDataGridNode.prototype._refreshInitiatorCell):
(WebInspector.NetworkDataGridNode.prototype._refreshSizeCell):
(WebInspector.NetworkDataGridNode.prototype._refreshTimeCell):
(WebInspector.NetworkDataGridNode.prototype.refreshGraph):
(WebInspector.NetworkDataGridNode.NameComparator):
(WebInspector.NetworkDataGridNode.SizeComparator):
(WebInspector.NetworkDataGridNode.InitiatorComparator):
(WebInspector.NetworkDataGridNode.RequestPropertyComparator):
* inspector/front-end/NetworkRequest.js: Added.
(WebInspector.NetworkRequest):
* inspector/front-end/RawSourceCode.js:
(WebInspector.RawSourceCode):
(WebInspector.RawSourceCode.prototype._requestFinished):
(WebInspector.RawSourceCode.prototype._createContentProvider):
* inspector/front-end/Resource.js:
(WebInspector.Resource):
(WebInspector.Resource.displayName):
(WebInspector.Resource.prototype.get request):
(WebInspector.Resource.prototype.set finished):
(WebInspector.Resource.prototype.set timing):
(WebInspector.Resource.prototype.set requestHeaders):
(WebInspector.Resource.prototype.set requestHeadersText):
(WebInspector.Resource.prototype.set responseHeaders):
(WebInspector.Resource.prototype.set responseHeadersText):
(WebInspector.Resource.prototype.requestContent):
* inspector/front-end/ResourceCookiesView.js:
(WebInspector.ResourceCookiesView):
(WebInspector.ResourceCookiesView.prototype.get _gotCookies):
(WebInspector.ResourceCookiesView.prototype._buildCookiesTable):
* inspector/front-end/ResourceHeadersView.js:
(WebInspector.ResourceHeadersView):
(WebInspector.ResourceHeadersView.prototype._refreshURL):
(WebInspector.ResourceHeadersView.prototype._refreshQueryString):
(WebInspector.ResourceHeadersView.prototype._refreshUrlFragment):
(WebInspector.ResourceHeadersView.prototype._refreshFormData):
(WebInspector.ResourceHeadersView.prototype._refreshRequestHeaders):
(WebInspector.ResourceHeadersView.prototype._refreshResponseHeaders):
(WebInspector.ResourceHeadersView.prototype._refreshHTTPInformation):
* inspector/front-end/ResourceScriptMapping.js:
(WebInspector.ResourceScriptMapping.prototype.addScript):
* inspector/front-end/ResourceTimingView.js:
(WebInspector.ResourceTimingView):
(WebInspector.ResourceTimingView.prototype.wasShown):
(WebInspector.ResourceTimingView.prototype._refresh):
(WebInspector.ResourceTimingView.createTimingTable):
* inspector/front-end/ResourceTreeModel.js:
(WebInspector.ResourceTreeModel):
(WebInspector.ResourceTreeModel.prototype._frontendReused):
(WebInspector.ResourceTreeModel.prototype._onRequestUpdated):
(WebInspector.ResourceTreeModel.prototype._onRequestUpdateDropped):
(WebInspector.ResourceTreeModel.prototype._createResource):
(WebInspector.ResourceTreeFrame):
(WebInspector.ResourceTreeFrame.prototype._addRequest):
* inspector/front-end/ResourceUtils.js:
* inspector/front-end/ResourcesPanel.js:
(WebInspector.FrameResourceTreeElement.prototype._appendOpenInNetworkPanelAction):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/externs.js:
(WebInspector.networkRequestById):
* inspector/front-end/inspector.html:
* inspector/front-end/inspector.js:
(WebInspector.networkRequestById):
(WebInspector.openRequestInNetworkPanel):

Tools: Web Inspector: Disabling Inspector causes build failure on Windows
https://bugs.webkit.org/show_bug.cgi?id=83557

Patch by Vivek Galatage <vivekgalatage@gmail.com> on 2012-04-11
Reviewed by Pavel Feldman.

The calls to inspector APIs are not put under ENABLE(INSPECTOR) guard.
This change brings all such API calls under the guard.

* WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR):
* WebKitTestRunner/InjectedBundle/LayoutTestController.h:
(LayoutTestController):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):

LayoutTests: Web Inspector: extracting NetworkRequest from Resource (step 1)
https://bugs.webkit.org/show_bug.cgi?id=83684

Reviewed by Yury Semikhatsky.

* http/tests/inspector/network-preflight-options.html:
* http/tests/inspector/network-test.js:
* http/tests/inspector/network/async-xhr-json-mime-type.html:
* http/tests/inspector/network/download.html:
* http/tests/inspector/network/network-cachedresources-with-same-urls.html:
* http/tests/inspector/network/network-content-replacement-embed.html:
* http/tests/inspector/network/network-content-replacement-xhr.html:
* http/tests/inspector/network/network-cyrillic-xhr.html:
* http/tests/inspector/network/network-disable-cache-memory.html:
* http/tests/inspector/network/network-disable-cache-xhrs.html:
* http/tests/inspector/network/network-disabling-check-no-memory-leak.html:
* http/tests/inspector/network/network-embed.html:
* http/tests/inspector/network/network-empty-xhr.html:
* http/tests/inspector/network/network-iframe-load-and-delete.html:
* http/tests/inspector/network/network-initiator-from-console.html:
* http/tests/inspector/network/network-initiator.html:
* http/tests/inspector/network/network-request-revision-content.html:
* http/tests/inspector/network/network-shared-worker.html:
* http/tests/inspector/network/network-sidebar-width.html:
* http/tests/inspector/network/network-size-chunked.html:
* http/tests/inspector/network/network-size-sync.html:
* http/tests/inspector/network/network-size.html:
* http/tests/inspector/network/network-timing.html:
* http/tests/inspector/network/network-worker.html:
* http/tests/inspector/network/network-xhr-async.html:
* http/tests/inspector/network/network-xhr-same-url-as-main-resource.html:
* http/tests/inspector/network/network-xhr-sync.html:
* http/tests/inspector/network/ping.html:
* http/tests/inspector/network/x-frame-options-deny.html:
* http/tests/inspector/resource-har-conversion.html:
* http/tests/inspector/resource-har-headers.html:
* http/tests/inspector/resource-har-pages.html:
* http/tests/inspector/resource-parameters.html:
* http/tests/inspector/resources-test.js:
(initialize_ResourceTest.InspectorTest.requestURLComparer):
* inspector/debugger/raw-source-code.html:
* inspector/debugger/source-frame.html:
* inspector/network-status-non-http.html:

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

71 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/network-preflight-options.html
LayoutTests/http/tests/inspector/network-test.js
LayoutTests/http/tests/inspector/network/async-xhr-json-mime-type.html
LayoutTests/http/tests/inspector/network/download.html
LayoutTests/http/tests/inspector/network/network-cachedresources-with-same-urls.html
LayoutTests/http/tests/inspector/network/network-content-replacement-embed.html
LayoutTests/http/tests/inspector/network/network-content-replacement-xhr.html
LayoutTests/http/tests/inspector/network/network-cyrillic-xhr.html
LayoutTests/http/tests/inspector/network/network-disable-cache-memory.html
LayoutTests/http/tests/inspector/network/network-disable-cache-xhrs.html
LayoutTests/http/tests/inspector/network/network-disabling-check-no-memory-leak.html
LayoutTests/http/tests/inspector/network/network-embed.html
LayoutTests/http/tests/inspector/network/network-empty-xhr.html
LayoutTests/http/tests/inspector/network/network-iframe-load-and-delete.html
LayoutTests/http/tests/inspector/network/network-initiator-from-console.html
LayoutTests/http/tests/inspector/network/network-initiator.html
LayoutTests/http/tests/inspector/network/network-request-revision-content.html
LayoutTests/http/tests/inspector/network/network-shared-worker.html
LayoutTests/http/tests/inspector/network/network-sidebar-width.html
LayoutTests/http/tests/inspector/network/network-size-chunked.html
LayoutTests/http/tests/inspector/network/network-size-sync.html
LayoutTests/http/tests/inspector/network/network-size.html
LayoutTests/http/tests/inspector/network/network-timing.html
LayoutTests/http/tests/inspector/network/network-worker.html
LayoutTests/http/tests/inspector/network/network-xhr-async.html
LayoutTests/http/tests/inspector/network/network-xhr-same-url-as-main-resource.html
LayoutTests/http/tests/inspector/network/network-xhr-sync.html
LayoutTests/http/tests/inspector/network/ping.html
LayoutTests/http/tests/inspector/network/x-frame-options-deny.html
LayoutTests/http/tests/inspector/resource-har-conversion.html
LayoutTests/http/tests/inspector/resource-har-headers.html
LayoutTests/http/tests/inspector/resource-har-pages.html
LayoutTests/http/tests/inspector/resource-parameters.html
LayoutTests/http/tests/inspector/resources-test.js
LayoutTests/inspector/debugger/raw-source-code.html
LayoutTests/inspector/debugger/source-frame.html
LayoutTests/inspector/network-status-non-http.html
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/inspector/compile-front-end.py
Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js
Source/WebCore/inspector/front-end/AuditLauncherView.js
Source/WebCore/inspector/front-end/AuditRules.js
Source/WebCore/inspector/front-end/AuditsPanel.js
Source/WebCore/inspector/front-end/ConsoleMessage.js
Source/WebCore/inspector/front-end/ConsoleModel.js
Source/WebCore/inspector/front-end/ContentProviders.js
Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
Source/WebCore/inspector/front-end/ExtensionServer.js
Source/WebCore/inspector/front-end/HAREntry.js
Source/WebCore/inspector/front-end/NetworkItemView.js
Source/WebCore/inspector/front-end/NetworkLog.js
Source/WebCore/inspector/front-end/NetworkManager.js
Source/WebCore/inspector/front-end/NetworkPanel.js
Source/WebCore/inspector/front-end/NetworkRequest.js [new file with mode: 0644]
Source/WebCore/inspector/front-end/RawSourceCode.js
Source/WebCore/inspector/front-end/Resource.js
Source/WebCore/inspector/front-end/ResourceCookiesView.js
Source/WebCore/inspector/front-end/ResourceHeadersView.js
Source/WebCore/inspector/front-end/ResourceScriptMapping.js
Source/WebCore/inspector/front-end/ResourceTimingView.js
Source/WebCore/inspector/front-end/ResourceTreeModel.js
Source/WebCore/inspector/front-end/ResourceUtils.js
Source/WebCore/inspector/front-end/ResourcesPanel.js
Source/WebCore/inspector/front-end/WebKit.qrc
Source/WebCore/inspector/front-end/externs.js
Source/WebCore/inspector/front-end/inspector.html
Source/WebCore/inspector/front-end/inspector.js
Tools/ChangeLog

index 6c67db4..a32ef28 100644 (file)
@@ -1,3 +1,49 @@
+2012-04-11  Pavel Feldman  <pfeldman@chromium.org>
+
+        Web Inspector: extracting NetworkRequest from Resource (step 1)
+        https://bugs.webkit.org/show_bug.cgi?id=83684
+
+        Reviewed by Yury Semikhatsky.
+
+        * http/tests/inspector/network-preflight-options.html:
+        * http/tests/inspector/network-test.js:
+        * http/tests/inspector/network/async-xhr-json-mime-type.html:
+        * http/tests/inspector/network/download.html:
+        * http/tests/inspector/network/network-cachedresources-with-same-urls.html:
+        * http/tests/inspector/network/network-content-replacement-embed.html:
+        * http/tests/inspector/network/network-content-replacement-xhr.html:
+        * http/tests/inspector/network/network-cyrillic-xhr.html:
+        * http/tests/inspector/network/network-disable-cache-memory.html:
+        * http/tests/inspector/network/network-disable-cache-xhrs.html:
+        * http/tests/inspector/network/network-disabling-check-no-memory-leak.html:
+        * http/tests/inspector/network/network-embed.html:
+        * http/tests/inspector/network/network-empty-xhr.html:
+        * http/tests/inspector/network/network-iframe-load-and-delete.html:
+        * http/tests/inspector/network/network-initiator-from-console.html:
+        * http/tests/inspector/network/network-initiator.html:
+        * http/tests/inspector/network/network-request-revision-content.html:
+        * http/tests/inspector/network/network-shared-worker.html:
+        * http/tests/inspector/network/network-sidebar-width.html:
+        * http/tests/inspector/network/network-size-chunked.html:
+        * http/tests/inspector/network/network-size-sync.html:
+        * http/tests/inspector/network/network-size.html:
+        * http/tests/inspector/network/network-timing.html:
+        * http/tests/inspector/network/network-worker.html:
+        * http/tests/inspector/network/network-xhr-async.html:
+        * http/tests/inspector/network/network-xhr-same-url-as-main-resource.html:
+        * http/tests/inspector/network/network-xhr-sync.html:
+        * http/tests/inspector/network/ping.html:
+        * http/tests/inspector/network/x-frame-options-deny.html:
+        * http/tests/inspector/resource-har-conversion.html:
+        * http/tests/inspector/resource-har-headers.html:
+        * http/tests/inspector/resource-har-pages.html:
+        * http/tests/inspector/resource-parameters.html:
+        * http/tests/inspector/resources-test.js:
+        (initialize_ResourceTest.InspectorTest.requestURLComparer):
+        * inspector/debugger/raw-source-code.html:
+        * inspector/debugger/source-frame.html:
+        * inspector/network-status-non-http.html:
+
 2012-04-11  Stephen Chenney  <schenney@chromium.org>
 
         svg/text/svg-zoom-large-value.xhtml ASSERTs on Chromium Linux Debug
index dda4212..3aff0d9 100644 (file)
@@ -63,21 +63,21 @@ var test = function()
 {
     var requestMessages = [];
     var postRequestsCount = 0;
-    function onResource(event)
+    function onRequest(event)
     {
-        var resource = event.data;
-        var idMatch = /\?id=([0-9]*)&/.exec(resource.url);
+        var request = event.data;
+        var idMatch = /\?id=([0-9]*)&/.exec(request.url);
         var requestId = idMatch[1];
-        var requestMessage = requestId + ":" + resource.requestMethod + " " + resource.url.replace(/[&?]date=\d+/, "");
+        var requestMessage = requestId + ":" + request.requestMethod + " " + request.url.replace(/[&?]date=\d+/, "");
         requestMessages.push(requestMessage);
-        if (resource.requestMethod === "POST" && ++postRequestsCount === 4) {
+        if (request.requestMethod === "POST" && ++postRequestsCount === 4) {
             requestMessages.sort();
             for (var i = 0; i < requestMessages.length; i++)
                 InspectorTest.addResult(requestMessages[i]);
             InspectorTest.completeTest();
         }
     }
-    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, onResource);
+    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, onRequest);
     InspectorTest.evaluateInPage("doCrossOriginXHR();");
 }
 </script>
index 3382fef..0a7a66a 100644 (file)
@@ -1,12 +1,12 @@
 var initialize_NetworkTest = function() {
 
-InspectorTest.dumpNetworkResources = function()
+InspectorTest.dumpNetworkRequests = function()
 {
-    var resources = WebInspector.panels.network.resources.slice();
-    resources.sort(function(a, b) {return a.url.localeCompare(b.url);});
-    InspectorTest.addResult("resources count = " + resources.length);
-    for (i = 0; i < resources.length; i++)
-        InspectorTest.addResult(resources[i].url);
+    var requests = WebInspector.panels.network.requests.slice();
+    requests.sort(function(a, b) {return a.url.localeCompare(b.url);});
+    InspectorTest.addResult("resources count = " + requests.length);
+    for (i = 0; i < requests.length; i++)
+        InspectorTest.addResult(requests[i].url);
 }
 
 InspectorTest.resetInspectorResourcesData = function(callback)
index f44a8f1..ca0f769 100644 (file)
@@ -20,18 +20,18 @@ function test()
 
     function step2()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.addResult("resource.type: " + resource1.type);
-        InspectorTest.addResult("resource.content before requesting content: " + resource1.content);
-        InspectorTest.assertTrue(!resource1.failed, "Resource loading failed.");
-        resource1.requestContent(step3);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult(request1.url);
+        InspectorTest.addResult("resource.type: " + request1.type);
+        InspectorTest.addResult("resource.content before requesting content: " + request1.content);
+        InspectorTest.assertTrue(!request1.failed, "Resource loading failed.");
+        request1.requestContent(step3);
     }
 
     function step3()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult("resource.content after requesting content: " + resource1.content);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         InspectorTest.completeTest();
     }
index 8b6e7e3..72a0dde 100644 (file)
@@ -18,8 +18,8 @@ function test()
 
     function responseReceived(requestId, time, resourceType, response)
     {
-        var resource = WebInspector.networkResourceById(requestId);
-        if (/download\.zzz/.exec(resource.url)) {
+        var request = WebInspector.networkRequestById(requestId);
+        if (/download\.zzz/.exec(request.url)) {
             InspectorTest.addResult("Received response for download.zzz");
             InspectorTest.addResult("SUCCESS");
             InspectorTest.completeTest();
@@ -28,15 +28,15 @@ function test()
 
     function loadingFinished(requestId, finishTime)
     {
-        var resource = WebInspector.networkResourceById(requestId);
-        if (/download\.zzz/.exec(resource.url))
+        var request = WebInspector.networkRequestById(requestId);
+        if (/download\.zzz/.exec(request.url))
             InspectorTest.completeTest();
     }
 
     function loadingFailed(requestId, time, localizedDescription, canceled)
     {
-        var resource = WebInspector.networkResourceById(requestId);
-        if (/download\.zzz/.exec(resource.url))
+        var request = WebInspector.networkRequestById(requestId);
+        if (/download\.zzz/.exec(request.url))
             InspectorTest.completeTest();
     }
 }
index ec1c259..259392e 100644 (file)
@@ -31,12 +31,12 @@ function test()
     function step2(msg)
     {
         // inspector-test.js appears in network panel occasionally in Safari on
-        // Mac, so checking two last resources.
-        var resourcesCount = WebInspector.panels.network.resources.length;
-        var resource1 = WebInspector.panels.network.resources[resourcesCount - 2];
-        var resource2 = WebInspector.panels.network.resources[resourcesCount - 1];
-        resource1.requestContent(contentLoaded);
-        resource2.requestContent(contentLoaded);
+        // Mac, so checking two last requests.
+        var requestsCount = WebInspector.panels.network.requests.length;
+        var request1 = WebInspector.panels.network.requests[requestsCount - 2];
+        var request2 = WebInspector.panels.network.requests[requestsCount - 1];
+        request1.requestContent(contentLoaded);
+        request2.requestContent(contentLoaded);
     }
 
     var contentLoadedCount = 0;
@@ -45,13 +45,13 @@ function test()
         if (++contentLoadedCount !== 2)
             return;
 
-        var resourcesCount = WebInspector.panels.network.resources.length;
-        var resource1 = WebInspector.panels.network.resources[resourcesCount - 2];
-        var resource2 = WebInspector.panels.network.resources[resourcesCount - 1];
+        var requestsCount = WebInspector.panels.network.requests.length;
+        var request1 = WebInspector.panels.network.requests[requestsCount - 2];
+        var request2 = WebInspector.panels.network.requests[requestsCount - 1];
 
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.addResult(resource2.url);
-        InspectorTest.assertTrue(resource1.content !== resource2.content);
+        InspectorTest.addResult(request1.url);
+        InspectorTest.addResult(request2.url);
+        InspectorTest.assertTrue(request1.content !== request2.content);
         InspectorTest.completeTest();
     }
 
index e1d5698..8a0996e 100644 (file)
@@ -65,43 +65,43 @@ function test()
     InspectorTest.addConsoleSniffer(step1);
     InspectorTest.evaluateInPage("onSnifferInstalled()");
 
-    function dumpResource(resource, callback)
+    function dumpRequest(request, callback)
     {
-        if (!resource)
+        if (!request)
             return callback();
-        InspectorTest.addResult(resource.url);
+        InspectorTest.addResult(request.url);
 
         function contentLoaded()
         {
-            InspectorTest.addResult("resource.content after requesting content: " + resource.content);
+            InspectorTest.addResult("resource.content after requesting content: " + request.content);
             callback();
         }
 
-        resource.requestContent(contentLoaded);
+        request.requestContent(contentLoaded);
     }
 
     function step1()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 4];
-        dumpResource(resource, step2);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 4];
+        dumpRequest(request, step2);
     }
 
     function step2()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 3];
-        dumpResource(resource, step3);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 3];
+        dumpRequest(request, step3);
     }
 
     function step3()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 2];
-        dumpResource(resource, step4);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+        dumpRequest(request, step4);
     }
 
     function step4()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        dumpResource(resource, step5);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        dumpRequest(request, step5);
     }
 
     function step5()
index 0c76f8b..2eb293d 100644 (file)
@@ -44,43 +44,43 @@ function test()
     InspectorTest.addConsoleSniffer(step1);
     InspectorTest.evaluateInPage("loadData()");
 
-    function dumpResource(resource, callback)
+    function dumpRequest(request, callback)
     {
-        if (!resource)
+        if (!request)
             return callback();
-        InspectorTest.addResult(resource.url);
+        InspectorTest.addResult(request.url);
 
         function contentLoaded()
         {
-            InspectorTest.addResult("resource.content: " + resource.content);
+            InspectorTest.addResult("resource.content: " + request.content);
             callback();
         }
 
-        resource.requestContent(contentLoaded);
+        request.requestContent(contentLoaded);
     }
 
     function step1()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 4];
-        dumpResource(resource, step2);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 4];
+        dumpRequest(request, step2);
     }
 
     function step2()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 3];
-        dumpResource(resource, step3);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 3];
+        dumpRequest(request, step3);
     }
 
     function step3()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 2];
-        dumpResource(resource, step4);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+        dumpRequest(request, step4);
     }
 
     function step4()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        dumpResource(resource, step5);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        dumpRequest(request, step5);
     }
 
     function step5()
index bda5f84..8fecbd3 100644 (file)
@@ -24,19 +24,19 @@ function test()
     // tests, we need to reset size limits to default ones.
     InspectorTest.resetInspectorResourcesData(step1);
 
-    function dumpResource(resource, callback)
+    function dumpRequest(request, callback)
     {
-        if (!resource)
+        if (!request)
             return callback();
-        InspectorTest.addResult(resource.url);
+        InspectorTest.addResult(request.url);
 
         function contentLoaded()
         {
-            InspectorTest.addResult("resource.content: " + resource.content);
+            InspectorTest.addResult("resource.content: " + request.content);
             callback();
         }
 
-        resource.requestContent(contentLoaded);
+        request.requestContent(contentLoaded);
     }
 
     function step1()
@@ -47,14 +47,14 @@ function test()
 
     function step2()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 2];
-        dumpResource(resource, step3);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+        dumpRequest(request, step3);
     }
 
     function step3()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        dumpResource(resource, step4);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        dumpRequest(request, step4);
     }
 
     function step4()
index 980d720..5850d6b 100644 (file)
@@ -27,16 +27,16 @@ function test()
 
         function scriptLoaded()
         {
-            var resourcesCount = WebInspector.panels.network.resources.length;
-            var resource = WebInspector.panels.network.resources[resourcesCount - 1];
-            resource.requestContent(contentLoaded);
+            var requestsCount = WebInspector.panels.network.requests.length;
+            var request = WebInspector.panels.network.requests[requestsCount - 1];
+            request.requestContent(contentLoaded);
         }
 
         function contentLoaded()
         {
-            var resourcesCount = WebInspector.panels.network.resources.length;
-            var resource = WebInspector.panels.network.resources[resourcesCount - 1];
-            callback(resource.content);
+            var requestsCount = WebInspector.panels.network.requests.length;
+            var request = WebInspector.panels.network.requests[requestsCount - 1];
+            callback(request.content);
         }
     }
 
index d50a4be..9d9c363 100644 (file)
@@ -60,13 +60,13 @@ function test()
     {
         // inspector-test.js appears in network panel occasionally in Safari on
         // Mac, so checking two last resources.
-        var resourcesCount = WebInspector.panels.network.resources.length;
-        var resource1 = WebInspector.panels.network.resources[resourcesCount - 3];
-        var resource2 = WebInspector.panels.network.resources[resourcesCount - 2];
-        var resource3 = WebInspector.panels.network.resources[resourcesCount - 1];
-        resource1.requestContent(contentLoaded);
-        resource2.requestContent(contentLoaded);
-        resource3.requestContent(contentLoaded);
+        var requestsCount = WebInspector.panels.network.requests.length;
+        var request1 = WebInspector.panels.network.requests[requestsCount - 3];
+        var request2 = WebInspector.panels.network.requests[requestsCount - 2];
+        var request3 = WebInspector.panels.network.requests[requestsCount - 1];
+        request1.requestContent(contentLoaded);
+        request2.requestContent(contentLoaded);
+        request3.requestContent(contentLoaded);
     }
 
     var contentLoadedCount = 0;
@@ -75,16 +75,16 @@ function test()
         if (++contentLoadedCount !== 3)
             return;
 
-        var resourcesCount = WebInspector.panels.network.resources.length;
-        var resource1 = WebInspector.panels.network.resources[resourcesCount - 3];
-        var resource2 = WebInspector.panels.network.resources[resourcesCount - 2];
-        var resource3 = WebInspector.panels.network.resources[resourcesCount - 1];
+        var requestsCount = WebInspector.panels.network.requests.length;
+        var request1 = WebInspector.panels.network.requests[requestsCount - 3];
+        var request2 = WebInspector.panels.network.requests[requestsCount - 2];
+        var request3 = WebInspector.panels.network.requests[requestsCount - 1];
 
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.addResult(resource2.url);
-        InspectorTest.addResult(resource3.url);
-        InspectorTest.assertTrue(resource1.content === resource2.content, "First and second resources are equal");
-        InspectorTest.assertTrue(resource2.content !== resource3.content, "Second and third resources differ");
+        InspectorTest.addResult(request1.url);
+        InspectorTest.addResult(request2.url);
+        InspectorTest.addResult(request3.url);
+        InspectorTest.assertTrue(request1.content === request2.content, "First and second resources are equal");
+        InspectorTest.assertTrue(request2.content !== request3.content, "Second and third resources differ");
         NetworkAgent.setCacheDisabled(false, step5);
     }
 
index 7881efc..5dc0db3 100644 (file)
@@ -32,14 +32,14 @@ function test()
 
     function step3()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        resource1.requestContent(step4);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        request1.requestContent(step4);
     }
 
     function step4()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult("resource.content after disabling network domain: " + resource1.content);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult("resource.content after disabling network domain: " + request1.content);
         NetworkAgent.enable(step5);
     }
 
index add189b..f21a2a5 100644 (file)
@@ -70,51 +70,51 @@ function test()
         InspectorTest.evaluateInPage("onSnifferInstalled()");
     }
 
-    function dumpResource(resource, callback)
+    function dumpRequest(request, callback)
     {
-        if (!resource)
+        if (!request)
             return callback();
-        InspectorTest.addResult(resource.url);
-        InspectorTest.addResult("resource.type: " + resource.type);
-        InspectorTest.addResult("resource.content before requesting content: " + resource.content);
+        InspectorTest.addResult(request.url);
+        InspectorTest.addResult("resource.type: " + request.type);
+        InspectorTest.addResult("resource.content before requesting content: " + request.content);
 
         function contentLoaded()
         {
-            InspectorTest.addResult("resource.content after requesting content: " + resource.content);
+            InspectorTest.addResult("resource.content after requesting content: " + request.content);
             callback();
         }
 
-        resource.requestContent(contentLoaded);
+        request.requestContent(contentLoaded);
     }
 
     function step2()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 5];
-        dumpResource(resource, step3);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 5];
+        dumpRequest(request, step3);
     }
 
     function step3()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 4];
-        dumpResource(resource, step4);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 4];
+        dumpRequest(request, step4);
     }
 
     function step4()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 3];
-        dumpResource(resource, step5);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 3];
+        dumpRequest(request, step5);
     }
 
     function step5()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 2];
-        dumpResource(resource, step6);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+        dumpRequest(request, step6);
     }
 
     function step6()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        dumpResource(resource, step7);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        dumpRequest(request, step7);
     }
 
     function step7()
index 1c7abab..5985603 100644 (file)
@@ -24,19 +24,19 @@ function test()
     // tests, we need to reset size limits to default ones.
     InspectorTest.resetInspectorResourcesData(step1);
 
-    function dumpResource(resource, callback)
+    function dumpRequest(request, callback)
     {
-        if (!resource)
+        if (!request)
             return callback();
-        InspectorTest.addResult(resource.url);
+        InspectorTest.addResult(request.url);
 
         function contentLoaded()
         {
-            InspectorTest.addResult("resource.content: " + resource.content);
+            InspectorTest.addResult("resource.content: " + request.content);
             callback();
         }
 
-        resource.requestContent(contentLoaded);
+        request.requestContent(contentLoaded);
     }
 
     function step1()
@@ -47,14 +47,14 @@ function test()
 
     function step2()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 2];
-        dumpResource(resource, step3);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+        dumpRequest(request, step3);
     }
 
     function step3()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        dumpResource(resource, step4);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        dumpRequest(request, step4);
     }
 
     function step4()
index fe677b5..3ea2cec 100644 (file)
@@ -43,29 +43,29 @@ function test()
 
     function step2()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 3];
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.addResult("resource.type: " + resource1.type);
-        InspectorTest.addResult("resource.content before requesting content: " + resource1.content);
-        resource1.requestContent(step3);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 3];
+        InspectorTest.addResult(request1.url);
+        InspectorTest.addResult("resource.type: " + request1.type);
+        InspectorTest.addResult("resource.content before requesting content: " + request1.content);
+        request1.requestContent(step3);
     }
 
     function step3()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 3];
-        InspectorTest.addResult("resource.content after requesting content: " + resource1.content);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 3];
+        InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
-        var resource2 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult(resource2.url);
-        InspectorTest.addResult("resource.type: " + resource2.type);
-        InspectorTest.addResult("resource.content before requesting content: " + resource2.content);
-        resource2.requestContent(step4);
+        var request2 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult(request2.url);
+        InspectorTest.addResult("resource.type: " + request2.type);
+        InspectorTest.addResult("resource.content before requesting content: " + request2.content);
+        request2.requestContent(step4);
     }
 
     function step4()
     {
-        var resource2 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult("resource.content after requesting content: " + resource2.content);
+        var request2 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult("resource.content after requesting content: " + request2.content);
 
         InspectorTest.completeTest();
     }
index f6d1f01..d108023 100644 (file)
@@ -7,19 +7,19 @@ var test = function()
 {
     InspectorTest.reloadPage(step1);
 
-    function findResourceByURL(url)
+    function findRequestByURL(url)
     {
-        var resources = WebInspector.networkLog.resources;
-        for (var i = 0; i < resources.length; ++i) {
-            if (url.test(resources[i].url))
-                return resources[i];
+        var requests = WebInspector.networkLog.requests;
+        for (var i = 0; i < requests.length; ++i) {
+            if (url.test(requests[i].url))
+                return requests[i];
         }
     }
 
     function step1()
     {
         InspectorTest.addConsoleSniffer(step2);
-        WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceStarted, onResource);
+        WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestStarted, onRequest);
         var str = "";
         str += "var s = document.createElement(\"script\");";
         str += "s.src = \"resources/script.js\";";
@@ -27,16 +27,16 @@ var test = function()
         WebInspector.consoleView.evalInInspectedWindow(str, "console", true, undefined, undefined, function(){})
     }
 
-    function onResource(event)
+    function onRequest(event)
     {
-        var resource = event.data;
-        if (/script.js/.test(resource.url))
+        var request = event.data;
+        if (/script.js/.test(request.url))
             step2();
     }
 
     function step2()
     {
-        if (!findResourceByURL(/script.js/))
+        if (!findRequestByURL(/script.js/))
             return;
 
         WebInspector.panels.network.show();
index fd48cce..d1da6ac 100644 (file)
@@ -38,31 +38,31 @@ var test = function()
 {
     InspectorTest.reloadPage(step1);
 
-    function findResourceByURL(url)
+    function findRequestByURL(url)
     {
-        var resources = WebInspector.networkLog.resources;
-        for (var i = 0; i < resources.length; ++i) {
-            if (url.test(resources[i].url))
-                return resources[i];
+        var requests = WebInspector.networkLog.requests;
+        for (var i = 0; i < requests.length; ++i) {
+            if (url.test(requests[i].url))
+                return requests[i];
         }
     }
 
     function step1()
     {
-        WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, onResource);
+        WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, onRequest);
         InspectorTest.evaluateInPage("addClassToDiv()", step2);
     }
 
-    function onResource(event)
+    function onRequest(event)
     {
-        var resource = event.data;
-        if (/size=300/.test(resource.url))
+        var request = event.data;
+        if (/size=300/.test(request.url))
             step2();
     }
 
     function step2()
     {
-        if (!findResourceByURL(/size=300/))
+        if (!findRequestByURL(/size=300/))
             return;
 
         InspectorTest.addConsoleSniffer(step3);
@@ -71,21 +71,21 @@ var test = function()
 
     function step3()
     {
-        function dumpInitiator(resource)
+        function dumpInitiator(request)
         {
-            var initiator = resource.initiator;
-            InspectorTest.addResult(resource.url + ": " + initiator.type);
+            var initiator = request.initiator;
+            InspectorTest.addResult(request.url + ": " + initiator.type);
             if (initiator.url)
                 InspectorTest.addResult("    " + initiator.url + " " + initiator.lineNumber);
             if (initiator.stackTrace)
                 InspectorTest.addResult("    " + initiator.stackTrace[0].url + " " + initiator.stackTrace[0].lineNumber);
         }
 
-        dumpInitiator(findResourceByURL(/initiator\.css/));
-        dumpInitiator(findResourceByURL(/size=100/));
-        dumpInitiator(findResourceByURL(/size=200/));
-        dumpInitiator(findResourceByURL(/size=300/));
-        dumpInitiator(findResourceByURL(/size=400/));
+        dumpInitiator(findRequestByURL(/initiator\.css/));
+        dumpInitiator(findRequestByURL(/size=100/));
+        dumpInitiator(findRequestByURL(/size=200/));
+        dumpInitiator(findRequestByURL(/size=300/));
+        dumpInitiator(findRequestByURL(/size=400/));
 
         InspectorTest.completeTest();
     }
index c4de94f..3cc0863 100644 (file)
@@ -16,16 +16,16 @@ function test()
 
     function step2(msg)
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        resource.addRevision("");
-        resource.history[0].requestContent(step3);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        request.addRevision("");
+        request.history[0].requestContent(step3);
     }
 
     function step3()
     {
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult(resource.url);
-        InspectorTest.addResult(resource.content);
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult(request.url);
+        InspectorTest.addResult(request.content);
         InspectorTest.completeTest();
     }
 }
index fd9b595..495fa0d 100644 (file)
@@ -28,17 +28,17 @@ function test()
 
     function step2()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.addResult("resource.type: " + resource1.type);
-        InspectorTest.addResult("resource.content before requesting content: " + resource1.content);
-        resource1.requestContent(step3);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult(request1.url);
+        InspectorTest.addResult("resource.type: " + request1.type);
+        InspectorTest.addResult("resource.content before requesting content: " + request1.content);
+        request1.requestContent(step3);
     }
 
     function step3()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult("resource.content after requesting content: " + resource1.content);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         InspectorTest.completeTest();
     }
index 14ec859..9e5b47c 100644 (file)
@@ -23,20 +23,20 @@ function test()
     {
         var panel = WebInspector.panels.network;
         var setting = WebInspector.settings[panel._sidebarWidthSettingName()];
-        var resource = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
+        var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
 
         oldSetting = setting.get();
         panel.show();
 
         setting.set(undefined);
-        panel._showResource(resource);
+        panel._showRequest(request);
         InspectorTest.addResult("Sidebar width: " + panel.sidebarElement.offsetWidth);
         panel._toggleGridMode();
 
         setting.set(242);
-        panel._showResource(resource);
+        panel._showRequest(request);
         InspectorTest.addResult("Sidebar width: " + panel.sidebarElement.offsetWidth);
-        panel._closeVisibleResource(resource);
+        panel._closeVisibleRequest(request);
 
         setting.set(oldSetting);
 
index 557c4f4..c07f6b4 100644 (file)
@@ -22,10 +22,10 @@ function test()
 
     function step2()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.addResult("resourceSize: " + resource1.resourceSize);
-        InspectorTest.addResult("transferSize: " + resource1.transferSize);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult(request1.url);
+        InspectorTest.addResult("resourceSize: " + request1.resourceSize);
+        InspectorTest.addResult("transferSize: " + request1.transferSize);
 
         InspectorTest.completeTest();
     }
index 2dc7ad3..51b3b09 100644 (file)
@@ -20,10 +20,10 @@ function test()
 
     function step2()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.addResult("resourceSize: " + resource1.resourceSize);
-        InspectorTest.addResult("transferSize: " + resource1.transferSize);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult(request1.url);
+        InspectorTest.addResult("resourceSize: " + request1.resourceSize);
+        InspectorTest.addResult("transferSize: " + request1.transferSize);
 
         InspectorTest.completeTest();
     }
index b582c00..7090ea9 100644 (file)
@@ -32,16 +32,16 @@ function test()
     {
         // inspector-test.js appears in network panel occasionally in Safari on
         // Mac, so checking two last resources.
-        var resourcesCount = WebInspector.panels.network.resources.length;
-        var resource1 = WebInspector.panels.network.resources[resourcesCount - 2];
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.addResult("resourceSize: " + resource1.resourceSize);
-        InspectorTest.addResult("transferSize: " + (resource1.transferSize - resource1.responseHeadersSize));
+        var requestsCount = WebInspector.panels.network.requests.length;
+        var request1 = WebInspector.panels.network.requests[requestsCount - 2];
+        InspectorTest.addResult(request1.url);
+        InspectorTest.addResult("resourceSize: " + request1.resourceSize);
+        InspectorTest.addResult("transferSize: " + (request1.transferSize - request1.responseHeadersSize));
 
-        var resource2 = WebInspector.panels.network.resources[resourcesCount - 1];
-        InspectorTest.addResult(resource2.url);
-        InspectorTest.addResult("resourceSize: " + resource2.resourceSize);
-        InspectorTest.addResult("transferSize: " + (resource2.transferSize - resource2.responseHeadersSize));
+        var request2 = WebInspector.panels.network.requests[requestsCount - 1];
+        InspectorTest.addResult(request2.url);
+        InspectorTest.addResult("resourceSize: " + request2.resourceSize);
+        InspectorTest.addResult("transferSize: " + (request2.transferSize - request2.responseHeadersSize));
 
         InspectorTest.completeTest();
     }
index 6e53e78..65eb2c2 100644 (file)
@@ -30,18 +30,18 @@ function test()
     function step2()
     {
         // inspector-test.js appears in network panel occasionally in Safari on
-        // Mac, so checking two last resources.
-        var resources = WebInspector.networkLog.resources;
-        var resourcesCount = resources.length;
-        var resource1 = resources[resourcesCount - 2];
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.assertGreaterOrEqual(resource1.latency * 1000, 100, "Latency of the first resource");
-        InspectorTest.assertGreaterOrEqual(resource1.duration * 1000, 300, "Duration of the first resource");
+        // Mac, so checking two last requests.
+        var requests = WebInspector.networkLog.requests;
+        var requestsCount = requests.length;
+        var request1 = requests[requestsCount - 2];
+        InspectorTest.addResult(request1.url);
+        InspectorTest.assertGreaterOrEqual(request1.latency * 1000, 100, "Latency of the first resource");
+        InspectorTest.assertGreaterOrEqual(request1.duration * 1000, 300, "Duration of the first resource");
 
-        var resource2 = resources[resourcesCount - 1];
-        InspectorTest.addResult(resource2.url);
-        InspectorTest.assertGreaterOrEqual(resource2.latency * 1000, 100, "Latency of the second resource");
-        InspectorTest.assertGreaterOrEqual(resource2.duration * 1000, 100, "Duration of the second resource");
+        var request2 = requests[requestsCount - 1];
+        InspectorTest.addResult(request2.url);
+        InspectorTest.assertGreaterOrEqual(request2.latency * 1000, 100, "Latency of the second resource");
+        InspectorTest.assertGreaterOrEqual(request2.duration * 1000, 100, "Duration of the second resource");
         InspectorTest.completeTest();
     }
 }
index f30ad1d..fe16b85 100644 (file)
@@ -28,17 +28,17 @@ function test()
 
     function step2()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.addResult("resource.type: " + resource1.type);
-        InspectorTest.addResult("resource.content before requesting content: " + resource1.content);
-        resource1.requestContent(step3);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult(request1.url);
+        InspectorTest.addResult("resource.type: " + request1.type);
+        InspectorTest.addResult("resource.content before requesting content: " + request1.content);
+        request1.requestContent(step3);
     }
 
     function step3()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult("resource.content after requesting content: " + resource1.content);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         InspectorTest.completeTest();
     }
index 2078463..1c0995b 100644 (file)
@@ -27,18 +27,18 @@ function test()
 
     function step2()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.addResult("resource.type: " + resource1.type);
-        InspectorTest.addResult("resource.content before requesting content: " + resource1.content);
-        InspectorTest.assertTrue(!resource1.failed, "Resource loading failed.");
-        resource1.requestContent(step3);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult(request1.url);
+        InspectorTest.addResult("resource.type: " + request1.type);
+        InspectorTest.addResult("resource.content before requesting content: " + request1.content);
+        InspectorTest.assertTrue(!request1.failed, "Resource loading failed.");
+        request1.requestContent(step3);
     }
 
     function step3()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult("resource.content after requesting content: " + resource1.content);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         InspectorTest.completeTest();
     }
index b3a72de..dfff4a3 100644 (file)
@@ -20,8 +20,8 @@ function test()
 
     function step2()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult(resource1.type.name());
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult(request1.type.name());
         InspectorTest.completeTest();
     }
 }
index f287566..48850d7 100644 (file)
@@ -27,18 +27,18 @@ function test()
 
     function step2()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult(resource1.url);
-        InspectorTest.addResult("resource.type: " + resource1.type);
-        InspectorTest.addResult("resource.content before requesting content: " + resource1.content);
-        InspectorTest.assertTrue(!resource1.failed, "Resource loading failed.");
-        resource1.requestContent(step3);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult(request1.url);
+        InspectorTest.addResult("resource.type: " + request1.type);
+        InspectorTest.addResult("resource.content before requesting content: " + request1.content);
+        InspectorTest.assertTrue(!request1.failed, "Resource loading failed.");
+        request1.requestContent(step3);
     }
 
     function step3()
     {
-        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
-        InspectorTest.addResult("resource.content after requesting content: " + resource1.content);
+        var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+        InspectorTest.addResult("resource.content after requesting content: " + request1.content);
 
         InspectorTest.completeTest();
     }
index e29b810..486801c 100644 (file)
@@ -25,14 +25,14 @@ function test()
     function step2()
     {
         // inspector-test.js appears in network panel occasionally in Safari on
-        // Mac, so checking last resource.
-        var resources = WebInspector.networkLog.resources;
-        var resourcesCount = resources.length;
-        var resource = resources[resourcesCount - 1];
+        // Mac, so checking last request.
+        var requests = WebInspector.networkLog.requests;
+        var requestsCount = requests.length;
+        var request = requests[requestsCount - 1];
 
-        InspectorTest.addResult(resource.url);
-        InspectorTest.addResult("resource.isPingRequest(): " + resource.isPingRequest());
-        InspectorTest.addResult("resource.requestContentType: " + resource.requestContentType());
+        InspectorTest.addResult(request.url);
+        InspectorTest.addResult("resource.isPingRequest(): " + request.isPingRequest());
+        InspectorTest.addResult("resource.requestContentType: " + request.requestContentType());
 
         InspectorTest.completeTest();
     }
index 877989f..b9339c5 100644 (file)
@@ -18,8 +18,8 @@ function test()
 
     function responseReceived(requestId, time, resourceType, response)
     {
-        var resource = WebInspector.networkResourceById(requestId);
-        if (/x-frame-options-deny\.cgi/.exec(resource.url)) {
+        var request = WebInspector.networkRequestById(requestId);
+        if (/x-frame-options-deny\.cgi/.exec(request.url)) {
             InspectorTest.addResult("Received response for x-frame-options-deny.cgi");
             InspectorTest.addResult("SUCCESS");
             InspectorTest.completeTest();
@@ -28,15 +28,15 @@ function test()
 
     function loadingFinished(requestId, finishTime)
     {
-        var resource = WebInspector.networkResourceById(requestId);
-        if (/x-frame-options-deny\.cgi/.exec(resource.url))
+        var request = WebInspector.networkRequestById(requestId);
+        if (/x-frame-options-deny\.cgi/.exec(request.url))
             InspectorTest.completeTest();
     }
 
     function loadingFailed(requestId, time, localizedDescription, canceled)
     {
-        var resource = WebInspector.networkResourceById(requestId);
-        if (/x-frame-options-deny\.cgi/.exec(resource.url))
+        var request = WebInspector.networkRequestById(requestId);
+        if (/x-frame-options-deny\.cgi/.exec(request.url))
             InspectorTest.completeTest();
     }
 }
index 163ffdd..75353b8 100644 (file)
@@ -25,33 +25,33 @@ var test = function()
 
     function step2()
     {
-        function findResourceByURL(url)
+        function findRequestByURL(url)
         {
-            var resources = WebInspector.networkLog.resources;
-            for (var i = 0; i < resources.length; ++i) {
-                if (url.test(resources[i].url))
-                    return resources[i];
+            var requests = WebInspector.networkLog.requests;
+            for (var i = 0; i < requests.length; ++i) {
+                if (url.test(requests[i].url))
+                    return requests[i];
             }
         }
 
-        function addCookieHeadersToResource(resource)
+        function addCookieHeadersToRequest(request)
         {
-            resource.requestHeaders = {
+            request.requestHeaders = {
                 "Cookie": "a=b; $Path=/path; $Domain=example.com; a1=b1\nc1=d1"
             };
 
-            resource.responseHeaders = {
+            request.responseHeaders = {
                 "Set-Cookie": "x=y; Path=/path; Domain=example.com; Discard; httpOnly; Secure; Version=1\nx1=y1\nz2=y2"
             };
         }
 
-        addCookieHeadersToResource(findResourceByURL(/inspector-test\.js$/));
-        var log = (new WebInspector.HARLog(WebInspector.networkLog.resources)).build();
+        addCookieHeadersToRequest(findRequestByURL(/inspector-test\.js$/));
+        var log = (new WebInspector.HARLog(WebInspector.networkLog.requests)).build();
         // Filter out favicon.ico requests that only appear on certain platforms.
         log.entries = log.entries.filter(function(entry) {
             return !/favicon\.ico$/.test(entry.request.url);
         });
-        log.entries.sort(InspectorTest.resourceURLComparer);
+        log.entries.sort(InspectorTest.requestURLComparer);
         InspectorTest.addObject(log, InspectorTest.HARPropertyFormattersWithSize);
         var pageTimings = log.pages[0].pageTimings;
         InspectorTest.completeTest();
index 7ce6d00..6dbda15 100644 (file)
@@ -12,51 +12,51 @@ var test = function()
         return s.replace(/\r/, "\\r").replace(/\n/, "\\n");
     }
 
-    function setResourceValues(resource)
+    function setRequestValues(request)
     {
-        resource.requestHeaders = {
+        request.requestHeaders = {
             "Request": "request-value"
         };
-        resource.requestHeadersText = "GET http://example.com/inspector-test.js HTTP/1.1\r\nRequest: headers-text";
+        request.requestHeadersText = "GET http://example.com/inspector-test.js HTTP/1.1\r\nRequest: headers-text";
 
-        resource.responseHeaders = {
+        request.responseHeaders = {
             "Response": "response-value"
         };
-        resource.responseHeadersText = "HTTP/1.1 200 OK\r\nResponse: headers-text";
+        request.responseHeadersText = "HTTP/1.1 200 OK\r\nResponse: headers-text";
 
-        resource.documentURL = "http://example.com/inspector-test.js";
-        resource.requestMethod = "GET";
-        resource.mimeType = "text/html";
-        resource.statusCode = 200;
-        resource.statusText = "OK";
-        resource.resourceSize = 1000;
-        resource._transferSize = 539; // 39 = header size at the end of the day
+        request.documentURL = "http://example.com/inspector-test.js";
+        request.requestMethod = "GET";
+        request.mimeType = "text/html";
+        request.statusCode = 200;
+        request.statusText = "OK";
+        request.resourceSize = 1000;
+        request._transferSize = 539; // 39 = header size at the end of the day
     }
 
-    var testResource = new WebInspector.Resource("testResource", "http://example.com/inspector-test.js", 1); 
-    setResourceValues(testResource);
-    var resourceResults = {
+    var testRequest = new WebInspector.NetworkRequest("testRequest", "http://example.com/inspector-test.js", 1); 
+    setRequestValues(testRequest);
+    var requestResults = {
         "request": {
-            "headers": testResource.requestHeaders,
-            "headersText": visibleNewlines(testResource.requestHeadersText),
-            "headersSize": testResource.requestHeadersSize,
+            "headers": testRequest.requestHeaders,
+            "headersText": visibleNewlines(testRequest.requestHeadersText),
+            "headersSize": testRequest.requestHeadersSize,
         },
         "response": {
-            "headers": testResource.responseHeaders,
-            "headersText": visibleNewlines(testResource.responseHeadersText),
-            "headersSize": testResource.responseHeadersSize,
-            "resourceSize": testResource.resourceSize,
-            "transferSize": testResource.transferSize
+            "headers": testRequest.responseHeaders,
+            "headersText": visibleNewlines(testRequest.responseHeadersText),
+            "headersSize": testRequest.responseHeadersSize,
+            "resourceSize": testRequest.resourceSize,
+            "transferSize": testRequest.transferSize
         }
     };
-    InspectorTest.addObject(resourceResults, {}, "", "Resource:");
+    InspectorTest.addObject(requestResults, {}, "", "Resource:");
 
     var stillNondeterministic = {
         "startedDateTime": "formatAsTypeName",
         "time": "formatAsTypeName",
         "timings": "formatAsTypeName"
     };
-    InspectorTest.addObject(new WebInspector.HAREntry(testResource).build(), stillNondeterministic, "", "HAR:");
+    InspectorTest.addObject(new WebInspector.HAREntry(testRequest).build(), stillNondeterministic, "", "HAR:");
     InspectorTest.completeTest();
 }
 </script>
index 48e0779..c57d14e 100644 (file)
@@ -12,13 +12,13 @@ var test = function()
     {
         var hadNavigation = false;
 
-        function onResourceFinished(event)
+        function onRequestFinished(event)
         {
-            var resource = event.data;
-            if (/\/har-pages-navigation-target\.html$/.test(resource.url))
+            var request = event.data;
+            if (/\/har-pages-navigation-target\.html$/.test(request.url))
                 hadNavigation = true;
-            if (hadNavigation && /\/resource-har-pages\.html$/.test(resource.url)) {
-                WebInspector.networkManager.removeEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, onResourceFinished)
+            if (hadNavigation && /\/resource-har-pages\.html$/.test(request.url)) {
+                WebInspector.networkManager.removeEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, onRequestFinished)
                 step2();
             }
         }
@@ -26,20 +26,20 @@ var test = function()
         var networkLogView = WebInspector.panels.network._networkLogView;
         // networkLogView.clear();
         networkLogView._preserveLogToggle.toggled = true;
-        WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, onResourceFinished);
+        WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, onRequestFinished);
         InspectorTest.evaluateInPage("location.href = '/resources/redirect.php?url=/inspector/resources/har-pages-navigation-target.html';");
     }
 
     function step2()
     {
-        var log = (new WebInspector.HARLog(WebInspector.panels.network._networkLogView._resources)).build();
+        var log = (new WebInspector.HARLog(WebInspector.panels.network._networkLogView._requests)).build();
         InspectorTest.addObject(log.pages, InspectorTest.HARPropertyFormattersWithSize);
 
         // Filter out favicon.ico requests that only appear on certain platforms.
         log.entries = log.entries.filter(function(entry) {
             return !/favicon\.ico$/.test(entry.request.url);
         });
-        log.entries.sort(InspectorTest.resourceURLComparer);
+        log.entries.sort(InspectorTest.requestURLComparer);
         for (var i = 0; i < log.entries.length; ++i) {
             var entry = log.entries[i];
             InspectorTest.addResult("page: " + entry.pageref + " url: " + entry.request.url);
index a94bc4a..53d87a2 100644 (file)
@@ -12,14 +12,14 @@ function submit()
 function test()
 {
     InspectorTest.evaluateInPage("submit()");
-    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, onResourceFinished);
+    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, onRequestFinished);
 
-    function onResourceFinished(event)
+    function onRequestFinished(event)
     {
-        var resource = event.data;
-        if (resource.url !== "http://localhost:8000/inspector/resources/post-target.cgi?queryParam1=queryValue1&queryParam2=#fragmentParam1=fragmentValue1&fragmentParam2=")
+        var request = event.data;
+        if (request.url !== "http://localhost:8000/inspector/resources/post-target.cgi?queryParam1=queryValue1&queryParam2=#fragmentParam1=fragmentValue1&fragmentParam2=")
             return;
-        InspectorTest.addObject(new WebInspector.HAREntry(resource).build(), InspectorTest.HARPropertyFormatters);
+        InspectorTest.addObject(new WebInspector.HAREntry(request).build(), InspectorTest.HARPropertyFormatters);
         InspectorTest.completeTest();
     }
 }
index 7a7611a..e623e30 100644 (file)
@@ -22,7 +22,7 @@ InspectorTest.HARPropertyFormattersWithSize = JSON.parse(JSON.stringify(Inspecto
 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName";
 
 
-InspectorTest.resourceURLComparer = function(r1, r2)
+InspectorTest.requestURLComparer = function(r1, r2)
 {
     return r1.request.url.localeCompare(r2.request.url);
 }
index fda8800..b8ea01c 100644 (file)
@@ -7,19 +7,26 @@
 
 function test()
 {
-    function createResourceMock(type, finished, content)
+    var mockContentsMap = {};
+    var lastRequestId = 1;
+
+    NetworkAgent.getResponseBody = function(requestId, callback)
     {
-        var resource = {};
-        resource.type = type === "document" ? WebInspector.resourceTypes.Document : WebInspector.resourceTypes.Script;
-        resource.finished = finished;
-        resource.content = content;
-        resource.requestContent = function(callback) { callback(resource.content); };
-        resource.finish = function() { resource.finished = true; resource.dispatchEventToListeners("finished"); };
-        resource.__proto__ = WebInspector.Object.prototype;
-        return resource;
+        callback(undefined, mockContentsMap[requestId], false);
     }
-    function createPendingResourceMock(type, content) { return createResourceMock(type, false, content); }
-    function createFinishedResourceMock(type, content) { return createResourceMock(type, true, content); }
+
+    function createRequestMock(type, finished, content)
+    {
+        var requestId = ++lastRequestId + "";
+        var request = new WebInspector.NetworkRequest(requestId, "http://fake.url", "", "");
+        request.type = type === "document" ? WebInspector.resourceTypes.Document : WebInspector.resourceTypes.Script;
+        request.finished = finished;
+        mockContentsMap[requestId] = content;
+        return request;
+    }
+
+    function createPendingRequestMock(type, content) { return createRequestMock(type, false, content); }
+    function createFinishedRequestMock(type, content) { return createRequestMock(type, true, content); }
 
     function createScriptFormatterMock()
     {
@@ -34,9 +41,9 @@ function test()
         return formatter;
       };
 
-    function createRawSourceCode(script, resource, formatted, compilerSourceMapping)
+    function createRawSourceCode(script, request, formatted, compilerSourceMapping)
     {
-        var rawSourceCode = new WebInspector.RawSourceCode("id", script, resource, createScriptFormatterMock(), !!formatted, compilerSourceMapping);
+        var rawSourceCode = new WebInspector.RawSourceCode("id", script, request, createScriptFormatterMock(), !!formatted, compilerSourceMapping);
         rawSourceCode.addEventListener(WebInspector.RawSourceCode.Events.UISourceCodeChanged, defaultUISourceCodeChangedHandler);
         return rawSourceCode;
     }
@@ -91,12 +98,12 @@ function test()
             WebInspector.debuggerModel._scripts = [];
             var script1 = InspectorTest.createScriptMock("index.html", 0, 10, false, "<script source 1>");
             var script2 = InspectorTest.createScriptMock("index.html", 0, 45, false, "<script source 2>");
-            var resource = createPendingResourceMock("document", "<resource content>");
-            var rawSourceCode = createRawSourceCode(script1, resource);
+            var request = createPendingRequestMock("document", "<resource content>");
+            var rawSourceCode = createRawSourceCode(script1, request);
 
             InspectorTest.assertTrue(!rawSourceCode.uiSourceCode());
             waitForUISourceCodeChangedEvent(rawSourceCode, uiSourceCodeChanged);
-            resource.finish();
+            request.finished = true;
 
             function uiSourceCodeChanged(event)
             {
@@ -124,8 +131,8 @@ function test()
             WebInspector.debuggerModel._scripts = [];
             var script1 = InspectorTest.createScriptMock("index.html", 1, 10, false, "<script source 1>");
             var script2 = InspectorTest.createScriptMock("index.html", 5, 45, false, "<script\nsource\n2>");
-            var resource = createFinishedResourceMock("document", "<resource content>");
-            var rawSourceCode = createRawSourceCode(script1, resource);
+            var request = createFinishedRequestMock("document", "<resource content>");
+            var rawSourceCode = createRawSourceCode(script1, request);
 
             InspectorTest.assertTrue(!!rawSourceCode.uiSourceCode());
             var uiSourceCode = rawSourceCode.uiSourceCode();
@@ -154,8 +161,8 @@ function test()
             var script1 = InspectorTest.createScriptMock("index.html", 0, 10, false, "<script source 1>");
             var script2 = InspectorTest.createScriptMock("index.html", 0, 45, false, "<script source 2>");
             var script3 = InspectorTest.createScriptMock("index.html", 1, 10, false, "<script source 3>");
-            var resource = createPendingResourceMock("document", "<resource content>");
-            var rawSourceCode = createRawSourceCode(script1, resource);
+            var request = createPendingRequestMock("document", "<resource content>");
+            var rawSourceCode = createRawSourceCode(script1, request);
 
             InspectorTest.assertTrue(!rawSourceCode.uiSourceCode());
             waitForUISourceCodeChangedEvent(rawSourceCode, requestContent);
@@ -192,18 +199,18 @@ function test()
                 InspectorTest.assertEquals("  <script><script source 1></" + "script> <script><script source 2></" + "script>", content);
 
                 rawSourceCode.forceUpdateSourceMapping();
-                waitForUISourceCodeChangedEvent(rawSourceCode, requestContentResource);
-                resource.finish();
+                waitForUISourceCodeChangedEvent(rawSourceCode, requestContentRequest);
+                request.finished = true;
             }
 
-            function requestContentResource()
+            function requestContentRequest()
             {
                 InspectorTest.assertTrue(!!rawSourceCode.uiSourceCode());
                 var uiSourceCode = rawSourceCode.uiSourceCode();
-                uiSourceCode.requestContent(didRequestContentResource);
+                uiSourceCode.requestContent(didRequestContentRequest);
             }
 
-            function didRequestContentResource(mimeType, content)
+            function didRequestContentRequest(mimeType, content)
             {
                 InspectorTest.assertEquals(mimeType, "text/html");
                 InspectorTest.assertEquals("<resource content>", content);
@@ -219,8 +226,8 @@ function test()
         {
             WebInspector.debuggerModel._scripts = [];
             var script = InspectorTest.createScriptMock("foo.js", 0, 0, true, "<script source>");
-            var resource = createFinishedResourceMock("script", "<resource content>");
-            var rawSourceCode = createRawSourceCode(script, resource, false);
+            var request = createFinishedRequestMock("script", "<resource content>");
+            var rawSourceCode = createRawSourceCode(script, request, false);
 
             InspectorTest.assertTrue(!!rawSourceCode.uiSourceCode());
             var uiSourceCode = rawSourceCode.uiSourceCode();
@@ -278,11 +285,11 @@ function test()
         {
             WebInspector.debuggerModel._scripts = [];
             var script = InspectorTest.createScriptMock("foo.js", 0, 0, true, "<script source>");
-            var resource = createPendingResourceMock("script", "<resource content>");
-            var rawSourceCode = createRawSourceCode(script, resource, true);
+            var request = createPendingRequestMock("script", "<resource content>");
+            var rawSourceCode = createRawSourceCode(script, request, true);
 
             InspectorTest.assertTrue(!rawSourceCode.uiSourceCode());
-            resource.finish();
+            request.finished = true;
             waitForUISourceCodeChangedEvent(rawSourceCode, checkMapping);
             rawSourceCode._formatter.finish();
 
index bd23bbe..20299be 100644 (file)
@@ -72,7 +72,7 @@ function test()
             function visit(resource)
             {
                 if (resource.url.indexOf("debugger-test.js") !== -1) {
-                    WebInspector.panels.network._showResource(resource, 1);
+                    WebInspector.panels.network._showRequest(resource.request, 1);
                     return true;
                 }
             }
index 819293d..d5e6db9 100644 (file)
@@ -3,10 +3,10 @@
 <script src="../http/tests/inspector/inspector-test.js"></script>
 <script>
 function test() {
-    var resourcesToWatch = /\/network-test\.js$|\/non-existent-file.js$|^data:application\/javascript,|/;
-    var seenResources = 0;
+    var requestsToWatch = /\/network-test\.js$|\/non-existent-file.js$|^data:application\/javascript,|/;
+    var seenRequests = 0;
 
-    function dumpResources()
+    function dumpRequests()
     {
         var logView = WebInspector.panels.network._networkLogView;
         logView.refresh();
@@ -16,7 +16,7 @@ function test() {
 
         for (var i = 0; i < urls.snapshotLength; ++i) {
             var url = urls.snapshotItem(i).value;
-            if (resourcesToWatch.test(url)) {
+            if (requestsToWatch.test(url)) {
                 var urlFragment = /^data:/.test(url) ? url.replace(/,.*$/, "") : url.replace(/.*\//, "");
                 var status = document.evaluate("ancestor::tr/td[position()=3]", urls.snapshotItem(i), null, XPathResult.STRING_TYPE, null);
                 outputStrings.push(urlFragment + ": " + status.stringValue);
@@ -27,15 +27,15 @@ function test() {
         InspectorTest.completeTest();
     }
 
-    function onResourceFinished(resource)
+    function onRequestFinished(request)
     {
-        if (!resourcesToWatch.test(resource.url))
+        if (!requestsToWatch.test(request.url))
             return;
-        if (++seenResources === 3)
-            dumpResources();
+        if (++seenRequests === 3)
+            dumpRequests();
     }
 
-    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, onResourceFinished);
+    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, onRequestFinished);
     WebInspector.showPanel("network");
     InspectorTest.evaluateInPage("loadResources()");
 }
index 0d218bc..391627a 100644 (file)
@@ -1,3 +1,329 @@
+2012-04-11  Pavel Feldman  <pfeldman@chromium.org>
+
+        Web Inspector: extracting NetworkRequest from Resource (step 1)
+        https://bugs.webkit.org/show_bug.cgi?id=83684
+
+        Reviewed by Yury Semikhatsky.
+
+        Meta bug: https://bugs.webkit.org/show_bug.cgi?id=61363.
+        In this step, NetworkRequest is introduced. It temporarily inherits from
+        the Resource, but all the call sites are now referring to it as to request.
+
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * inspector/compile-front-end.py:
+        * inspector/front-end/ApplicationCacheItemsView.js:
+        (WebInspector.ApplicationCacheItemsView.prototype._updateCallback):
+        * inspector/front-end/AuditLauncherView.js:
+        (WebInspector.AuditLauncherView):
+        (WebInspector.AuditLauncherView.prototype._onRequestStarted):
+        (WebInspector.AuditLauncherView.prototype._onRequestFinished):
+        * inspector/front-end/AuditRules.js:
+        (WebInspector.AuditRules.getDomainToResourcesMap):
+        (WebInspector.AuditRules.GzipRule.prototype.doRun):
+        (WebInspector.AuditRules.GzipRule.prototype._isCompressed):
+        (WebInspector.AuditRules.GzipRule.prototype._shouldCompress):
+        (WebInspector.AuditRules.CombineExternalResourcesRule.prototype.doRun):
+        (WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype.doRun):
+        (WebInspector.AuditRules.ParallelizeDownloadRule.prototype.doRun):
+        (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback.selectorsCallback):
+        (WebInspector.AuditRules.CacheControlRule.prototype.doRun):
+        (WebInspector.AuditRules.CacheControlRule.prototype.handleNonCacheableResources):
+        (WebInspector.AuditRules.CacheControlRule.prototype._cacheableAndNonCacheableResources):
+        (WebInspector.AuditRules.CacheControlRule.prototype.execCheck):
+        (WebInspector.AuditRules.CacheControlRule.prototype.freshnessLifetimeGreaterThan):
+        (WebInspector.AuditRules.CacheControlRule.prototype.responseHeader):
+        (WebInspector.AuditRules.CacheControlRule.prototype.hasResponseHeader):
+        (WebInspector.AuditRules.CacheControlRule.prototype.isCompressible):
+        (WebInspector.AuditRules.CacheControlRule.prototype.isPubliclyCacheable):
+        (WebInspector.AuditRules.CacheControlRule.prototype.responseHeaderMatch):
+        (WebInspector.AuditRules.CacheControlRule.prototype.hasExplicitExpiration):
+        (WebInspector.AuditRules.CacheControlRule.prototype._isExplicitlyNonCacheable):
+        (WebInspector.AuditRules.CacheControlRule.prototype.isCacheableResource):
+        (WebInspector.AuditRules.BrowserCacheControlRule.prototype.handleNonCacheableResources):
+        (WebInspector.AuditRules.BrowserCacheControlRule.prototype.runChecks):
+        (WebInspector.AuditRules.BrowserCacheControlRule.prototype._missingExpirationCheck):
+        (WebInspector.AuditRules.BrowserCacheControlRule.prototype._varyCheck):
+        (WebInspector.AuditRules.BrowserCacheControlRule.prototype._oneMonthExpirationCheck):
+        (WebInspector.AuditRules.BrowserCacheControlRule.prototype._oneYearExpirationCheck):
+        (WebInspector.AuditRules.ProxyCacheControlRule.prototype.runChecks):
+        (WebInspector.AuditRules.ProxyCacheControlRule.prototype._questionMarkCheck):
+        (WebInspector.AuditRules.ProxyCacheControlRule.prototype._publicCachingCheck):
+        (WebInspector.AuditRules.ProxyCacheControlRule.prototype._setCookieCacheableCheck):
+        (WebInspector.AuditRules.CookieRuleBase.prototype.doRun.resultCallback):
+        (WebInspector.AuditRules.CookieRuleBase.prototype.doRun):
+        (WebInspector.AuditRules.CookieRuleBase.prototype.mapResourceCookies):
+        (WebInspector.AuditRules.CookieRuleBase.prototype._callbackForResourceCookiePairs):
+        (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies):
+        (WebInspector.AuditRules.StaticCookielessRule.prototype.processCookies):
+        (WebInspector.AuditRules.StaticCookielessRule.prototype._collectorCallback):
+        * inspector/front-end/AuditsPanel.js:
+        (WebInspector.AuditsPanel.prototype._executeAudit):
+        (WebInspector.AuditCategory.prototype.run):
+        (WebInspector.AuditRule.prototype.run):
+        (WebInspector.AuditRule.prototype.doRun):
+        * inspector/front-end/ConsoleMessage.js:
+        * inspector/front-end/ConsoleModel.js:
+        (WebInspector.ConsoleDispatcher.prototype.messageAdded):
+        * inspector/front-end/ContentProviders.js:
+        (WebInspector.ResourceContentProvider):
+        (WebInspector.ResourceContentProvider.prototype.requestContent):
+        (WebInspector.ResourceContentProvider.prototype.searchInContent):
+        * inspector/front-end/DebuggerPresentationModel.js:
+        * inspector/front-end/ExtensionServer.js:
+        (WebInspector.ExtensionServer.prototype._onGetHAR):
+        (WebInspector.ExtensionServer.prototype._notifyRequestFinished):
+        * inspector/front-end/HAREntry.js:
+        (WebInspector.HAREntry):
+        (WebInspector.HAREntry.prototype.build):
+        (WebInspector.HAREntry.prototype._buildRequest):
+        (WebInspector.HAREntry.prototype._buildResponse):
+        (WebInspector.HAREntry.prototype._buildContent):
+        (WebInspector.HAREntry.prototype._buildTimings):
+        (WebInspector.HAREntry.prototype._buildPostData):
+        (WebInspector.HAREntry.prototype._buildCookie):
+        (WebInspector.HAREntry.prototype._interval):
+        (WebInspector.HAREntry.prototype.get requestBodySize):
+        (WebInspector.HAREntry.prototype.get responseBodySize):
+        (WebInspector.HAREntry.prototype.get responseCompression):
+        (WebInspector.HARLog):
+        (WebInspector.HARLog.prototype.build):
+        (WebInspector.HARLog.prototype._buildPages):
+        (WebInspector.HARLog.prototype._convertResource):
+        * inspector/front-end/NetworkItemView.js:
+        (WebInspector.NetworkItemView):
+        * inspector/front-end/NetworkLog.js:
+        (WebInspector.NetworkLog):
+        (WebInspector.NetworkLog.prototype.get requests):
+        (WebInspector.NetworkLog.prototype.pageLoadForRequest):
+        (WebInspector.NetworkLog.prototype._onMainFrameNavigated):
+        (WebInspector.NetworkLog.prototype._onRequestStarted):
+        (WebInspector.NetworkLog.prototype._onLoad):
+        (WebInspector.PageLoad):
+        * inspector/front-end/NetworkManager.js:
+        (WebInspector.NetworkManager.get this):
+        (WebInspector.NetworkManager.get NetworkAgent):
+        (WebInspector.NetworkManager):
+        (WebInspector.NetworkManager.prototype.inflightRequestForURL):
+        (WebInspector.NetworkDispatcher):
+        (WebInspector.NetworkDispatcher.prototype._updateNetworkRequestWithRequest):
+        (WebInspector.NetworkDispatcher.prototype._updateNetworkRequestWithResponse):
+        (WebInspector.NetworkDispatcher.prototype._mimeTypeIsConsistentWithType):
+        (WebInspector.NetworkDispatcher.prototype._updateNetworkRequestWithCachedResource):
+        (WebInspector.NetworkDispatcher.prototype.requestWillBeSent):
+        (WebInspector.NetworkDispatcher.prototype.requestServedFromCache):
+        (WebInspector.NetworkDispatcher.prototype.responseReceived):
+        (WebInspector.NetworkDispatcher.prototype.dataReceived):
+        (WebInspector.NetworkDispatcher.prototype.loadingFinished):
+        (WebInspector.NetworkDispatcher.prototype.loadingFailed):
+        (WebInspector.NetworkDispatcher.prototype.requestServedFromMemoryCache):
+        (WebInspector.NetworkDispatcher.prototype.webSocketCreated):
+        (WebInspector.NetworkDispatcher.prototype.webSocketWillSendHandshakeRequest):
+        (WebInspector.NetworkDispatcher.prototype.webSocketHandshakeResponseReceived):
+        (WebInspector.NetworkDispatcher.prototype.webSocketClosed):
+        (WebInspector.NetworkDispatcher.prototype._appendRedirect):
+        (WebInspector.NetworkDispatcher.prototype._startNetworkRequest):
+        (WebInspector.NetworkDispatcher.prototype._updateNetworkRequest):
+        (WebInspector.NetworkDispatcher.prototype._finishNetworkRequest):
+        (WebInspector.NetworkDispatcher.prototype._dispatchEventToListeners):
+        (WebInspector.NetworkDispatcher.prototype._createNetworkRequest):
+        (get WebInspector):
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkLogView.prototype._initializeView):
+        (WebInspector.NetworkLogView.prototype.get statusBarItems):
+        (WebInspector.NetworkLogView.prototype._createSortingFunctions):
+        (WebInspector.NetworkLogView.prototype._updateSummaryBar):
+        (WebInspector.NetworkLogView.prototype._updateDividersIfNeeded):
+        (WebInspector.NetworkLogView.prototype._invalidateAllItems):
+        (WebInspector.NetworkLogView.prototype._requestGridNode):
+        (WebInspector.NetworkLogView.prototype._createRequestGridNode):
+        (WebInspector.NetworkLogView.prototype._onLoadEventFired):
+        (WebInspector.NetworkLogView.prototype._domContentLoadedEventFired):
+        (WebInspector.NetworkLogView.prototype.refresh):
+        (WebInspector.NetworkLogView.prototype._reset):
+        (WebInspector.NetworkLogView.prototype.get requests):
+        (WebInspector.NetworkLogView.prototype.requestById):
+        (WebInspector.NetworkLogView.prototype._onRequestStarted):
+        (WebInspector.NetworkLogView.prototype._appendRequest):
+        (WebInspector.NetworkLogView.prototype._onRequestUpdated):
+        (WebInspector.NetworkLogView.prototype._refreshRequest):
+        (WebInspector.NetworkLogView.prototype._mainFrameNavigated):
+        (WebInspector.NetworkLogView.prototype.get _setLargerRequests):
+        (WebInspector.NetworkLogView.prototype._getPopoverAnchor):
+        (WebInspector.NetworkLogView.prototype._showPopover):
+        (WebInspector.NetworkLogView.prototype._contextMenu):
+        (WebInspector.NetworkLogView.prototype._copyAll):
+        (WebInspector.NetworkLogView.prototype._copyRequest):
+        (WebInspector.NetworkLogView.prototype._copyLocation):
+        (WebInspector.NetworkLogView.prototype._copyRequestHeaders):
+        (WebInspector.NetworkLogView.prototype._copyResponseHeaders):
+        (WebInspector.NetworkLogView.prototype._exportAll):
+        (WebInspector.NetworkLogView.prototype._exportRequest):
+        (WebInspector.NetworkLogView.prototype._matchRequest):
+        (WebInspector.NetworkLogView.prototype._clearSearchMatchedList):
+        (WebInspector.NetworkLogView.prototype._updateSearchMatchedListAfterRequestIdChanged):
+        (WebInspector.NetworkLogView.prototype._updateHighlightIfMatched):
+        (WebInspector.NetworkLogView.prototype._highlightNthMatchedRequest):
+        (WebInspector.NetworkLogView.prototype.performSearch):
+        (WebInspector.NetworkLogView.prototype.jumpToPreviousSearchResult):
+        (WebInspector.NetworkLogView.prototype.jumpToNextSearchResult):
+        (WebInspector.NetworkLogView.prototype.revealAndHighlightRequest):
+        (WebInspector.NetworkPanel.prototype.handleShortcut):
+        (WebInspector.NetworkPanel.prototype.get requests):
+        (WebInspector.NetworkPanel.prototype.requestById):
+        (WebInspector.NetworkPanel.prototype._requestByAnchor):
+        (WebInspector.NetworkPanel.prototype.canShowAnchorLocation):
+        (WebInspector.NetworkPanel.prototype.showAnchorLocation):
+        (WebInspector.NetworkPanel.prototype.revealAndHighlightRequest):
+        (WebInspector.NetworkPanel.prototype._onViewCleared):
+        (WebInspector.NetworkPanel.prototype._onRequestSelected):
+        (WebInspector.NetworkPanel.prototype._showRequest):
+        (WebInspector.NetworkPanel.prototype._closeVisibleRequest):
+        (WebInspector.NetworkPanel.prototype._toggleGridMode):
+        (WebInspector.NetworkPanel.prototype._toggleViewingRequestMode):
+        (WebInspector.NetworkTimeCalculator.prototype.computeBarGraphPercentages):
+        (WebInspector.NetworkTimeCalculator.prototype.computeBarGraphLabels):
+        (WebInspector.NetworkTimeCalculator.prototype.updateBoundaries):
+        (WebInspector.NetworkTimeCalculator.prototype._lowerBound):
+        (WebInspector.NetworkTimeCalculator.prototype._upperBound):
+        (WebInspector.NetworkTransferTimeCalculator.prototype._lowerBound):
+        (WebInspector.NetworkTransferTimeCalculator.prototype._upperBound):
+        (WebInspector.NetworkTransferDurationCalculator.prototype._upperBound):
+        (WebInspector.NetworkDataGridNode):
+        (WebInspector.NetworkDataGridNode.prototype.isFilteredOut):
+        (WebInspector.NetworkDataGridNode.prototype.select):
+        (WebInspector.NetworkDataGridNode.prototype._openInNewTab):
+        (WebInspector.NetworkDataGridNode.prototype.get selectable):
+        (WebInspector.NetworkDataGridNode.prototype._createTimelineCell):
+        (WebInspector.NetworkDataGridNode.prototype.refreshRequest):
+        (WebInspector.NetworkDataGridNode.prototype._refreshNameCell):
+        (WebInspector.NetworkDataGridNode.prototype._fileName):
+        (WebInspector.NetworkDataGridNode.prototype._refreshStatusCell):
+        (WebInspector.NetworkDataGridNode.prototype._refreshTypeCell):
+        (WebInspector.NetworkDataGridNode.prototype._refreshInitiatorCell):
+        (WebInspector.NetworkDataGridNode.prototype._refreshSizeCell):
+        (WebInspector.NetworkDataGridNode.prototype._refreshTimeCell):
+        (WebInspector.NetworkDataGridNode.prototype.refreshGraph):
+        (WebInspector.NetworkDataGridNode.NameComparator):
+        (WebInspector.NetworkDataGridNode.SizeComparator):
+        (WebInspector.NetworkDataGridNode.InitiatorComparator):
+        (WebInspector.NetworkDataGridNode.RequestPropertyComparator):
+        * inspector/front-end/NetworkRequest.js: Added.
+        (WebInspector.NetworkRequest):
+        * inspector/front-end/RawSourceCode.js:
+        (WebInspector.RawSourceCode):
+        (WebInspector.RawSourceCode.prototype._requestFinished):
+        (WebInspector.RawSourceCode.prototype._createContentProvider):
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource):
+        (WebInspector.Resource.displayName):
+        (WebInspector.Resource.prototype.get request):
+        (WebInspector.Resource.prototype.set finished):
+        (WebInspector.Resource.prototype.set timing):
+        (WebInspector.Resource.prototype.set requestHeaders):
+        (WebInspector.Resource.prototype.set requestHeadersText):
+        (WebInspector.Resource.prototype.set responseHeaders):
+        (WebInspector.Resource.prototype.set responseHeadersText):
+        (WebInspector.Resource.prototype.requestContent):
+        * inspector/front-end/ResourceCookiesView.js:
+        (WebInspector.ResourceCookiesView):
+        (WebInspector.ResourceCookiesView.prototype.get _gotCookies):
+        (WebInspector.ResourceCookiesView.prototype._buildCookiesTable):
+        * inspector/front-end/ResourceHeadersView.js:
+        (WebInspector.ResourceHeadersView):
+        (WebInspector.ResourceHeadersView.prototype._refreshURL):
+        (WebInspector.ResourceHeadersView.prototype._refreshQueryString):
+        (WebInspector.ResourceHeadersView.prototype._refreshUrlFragment):
+        (WebInspector.ResourceHeadersView.prototype._refreshFormData):
+        (WebInspector.ResourceHeadersView.prototype._refreshRequestHeaders):
+        (WebInspector.ResourceHeadersView.prototype._refreshResponseHeaders):
+        (WebInspector.ResourceHeadersView.prototype._refreshHTTPInformation):
+        * inspector/front-end/ResourceScriptMapping.js:
+        (WebInspector.ResourceScriptMapping.prototype.addScript):
+        * inspector/front-end/ResourceTimingView.js:
+        (WebInspector.ResourceTimingView):
+        (WebInspector.ResourceTimingView.prototype.wasShown):
+        (WebInspector.ResourceTimingView.prototype._refresh):
+        (WebInspector.ResourceTimingView.createTimingTable):
+        * inspector/front-end/ResourceTreeModel.js:
+        (WebInspector.ResourceTreeModel):
+        (WebInspector.ResourceTreeModel.prototype._frontendReused):
+        (WebInspector.ResourceTreeModel.prototype._onRequestUpdated):
+        (WebInspector.ResourceTreeModel.prototype._onRequestUpdateDropped):
+        (WebInspector.ResourceTreeModel.prototype._createResource):
+        (WebInspector.ResourceTreeFrame):
+        (WebInspector.ResourceTreeFrame.prototype._addRequest):
+        * inspector/front-end/ResourceUtils.js:
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.FrameResourceTreeElement.prototype._appendOpenInNetworkPanelAction):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/externs.js:
+        (WebInspector.networkRequestById):
+        * inspector/front-end/inspector.html:
+        * inspector/front-end/inspector.js:
+        (WebInspector.networkRequestById):
+        (WebInspector.openRequestInNetworkPanel):
+
+2012-04-11  Pavel Feldman  <pfeldman@chromium.org>
+
+        Web Inspector: fix category -> type refactoring implications.
+        https://bugs.webkit.org/show_bug.cgi?id=83680
+
+        Reviewed by Yury Semikhatsky.
+
+        We are now using type identifiers (singulars) as opposed to category identifier (plurals) in the style.
+
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkLogView.prototype._createFilterStatusBarItems.createFilterElement):
+        (WebInspector.NetworkLogView.prototype._createFilterStatusBarItems):
+        (WebInspector.NetworkLogView.prototype._showCategory):
+        (WebInspector.NetworkLogView.prototype._hideCategory):
+        (WebInspector.NetworkLogView.prototype._filter):
+        (WebInspector.NetworkDataGridNode.prototype.refreshResource):
+        (WebInspector.NetworkDataGridNode.prototype.refreshGraph):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.FrameResourceTreeElement):
+        (WebInspector.ResourceRevisionTreeElement):
+        * inspector/front-end/networkLogView.css:
+        (.network-log-grid.data-grid .network-type-script .icon):
+        (.network-log-grid.data-grid.small .network-type-script .icon):
+        (.network-log-grid.data-grid .network-type-document .icon):
+        (.network-log-grid.data-grid.small .network-type-document .icon):
+        (.network-log-grid.data-grid .network-type-stylesheet .icon):
+        (.network-log-grid.data-grid.small .network-type-stylesheet .icon):
+        (.network-log-grid.data-grid .network-type-image .icon):
+        (.network-log-grid.data-grid.small .network-type-image .icon):
+        (.network-type-document .network-graph-bar):
+        (.network-type-document.resource-cached .network-graph-bar):
+        (.network-type-stylesheet .network-graph-bar):
+        (.network-type-stylesheet.resource-cached .network-graph-bar):
+        (.network-type-image .network-graph-bar):
+        (.network-type-image.resource-cached .network-graph-bar):
+        (.network-type-font .network-graph-bar):
+        (.network-type-font.resource-cached .network-graph-bar):
+        (.network-type-script .network-graph-bar):
+        (.network-type-script.resource-cached .network-graph-bar):
+        (.network-type-xhr .network-graph-bar):
+        (.network-type-xhr.resource-cached .network-graph-bar):
+        (.network-type-websocket .network-graph-bar):
+        (.network-type-websocket.resource-cached .network-graph-bar):
+        (.network-log-grid.data-grid.filter-other table.data tr.revealed.network-type-other):
+        * inspector/front-end/resourcesPanel.css:
+        (.resource-sidebar-tree-item.resources-type-image .icon):
+        (.resources-type-image .image-resource-icon-preview):
+        (.children.small .resource-sidebar-tree-item.resources-type-image .icon):
+        (.children.small .resources-type-image .image-resource-icon-preview):
+        (.resource-sidebar-tree-item.resources-type-document .icon):
+        (.children.small .resource-sidebar-tree-item.resources-type-document .icon):
+        (.resource-sidebar-tree-item.resources-type-stylesheet .icon):
+        (.children.small .resource-sidebar-tree-item.resources-type-stylesheet .icon):
+        (.resource-sidebar-tree-item.resources-type-font .icon):
+        (.children.small .resource-sidebar-tree-item.resources-type-font .icon):
+        (.resource-sidebar-tree-item.resources-type-script .icon):
+        (.children.small .resource-sidebar-tree-item.resources-type-script .icon):
+        (.resource-sidebar-tree-item.resources-type-xhr .icon):
+        (.children.small .resource-sidebar-tree-item.resources-type-xhr .icon):
+
 2012-04-11   Arko Saha  <arko@motorola.com>
 
         Microdata: Implement cache mechanism for HTMLPropertiesCollection.
index a22fbac..af4b3c7 100644 (file)
             'inspector/front-end/NetworkManager.js',
             'inspector/front-end/NetworkLog.js',
             'inspector/front-end/NetworkPanel.js',
+            'inspector/front-end/NetworkRequest.js',
             'inspector/front-end/Object.js',
             'inspector/front-end/ObjectPopoverHelper.js',
             'inspector/front-end/ObjectPropertiesSection.js',
index c5e2727..36861d2 100755 (executable)
                                        >
                                </File>
                                <File
+                                       RelativePath="..\inspector\front-end\NetworkRequest.js"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\inspector\front-end\Object.js"
                                        >
                                </File>
index 684c7d5..f30695d 100755 (executable)
@@ -92,6 +92,7 @@ modules = [
             "ResourceType.js",
             "ResourceUtils.js",
             "NetworkManager.js",
+            "NetworkRequest.js",
             "UISourceCode.js",
             "UserAgentSupport.js",
         ]
index e89de1b..2231151 100644 (file)
@@ -180,8 +180,6 @@ WebInspector.ApplicationCacheItemsView.prototype = {
         this._size = applicationCache.size;
         this._resources = applicationCache.resources;
 
-        var lastPathComponent = applicationCache.lastPathComponent;
-
         if (!this._dataGrid)
             this._createDataGrid();
 
index aaaf40a..4f3dd48 100644 (file)
@@ -58,8 +58,8 @@ WebInspector.AuditLauncherView = function(runnerCallback, stopCallback)
     this._headerElement.textContent = WebInspector.UIString("No audits to run");
     this._contentElement.appendChild(this._headerElement);
 
-    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceStarted, this._onResourceStarted, this);
-    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, this._onResourceFinished, this);
+    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this);
+    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, this._onRequestFinished, this);
 }
 
 WebInspector.AuditLauncherView.prototype = {
@@ -69,21 +69,21 @@ WebInspector.AuditLauncherView.prototype = {
         this._totalResources = 0;
     },
 
-    _onResourceStarted: function(event)
+    _onRequestStarted: function(event)
     {
-        var resource = event.data;
+        var request = /** @type {WebInspector.NetworkRequest} */ event.data;
         // Ignore long-living WebSockets for the sake of progress indicator, as we won't be waiting them anyway.
-        if (resource.type === WebInspector.resourceTypes.WebSocket)
+        if (request.type === WebInspector.resourceTypes.WebSocket)
             return;
         ++this._totalResources;
         this._updateResourceProgress();
     },
 
-    _onResourceFinished: function(event)
+    _onRequestFinished: function(event)
     {
-        var resource = event.data;
+        var request = /** @type {WebInspector.NetworkRequest} */ event.data;
         // See resorceStarted for details.
-        if (resource.type === WebInspector.resourceTypes.WebSocket)
+        if (request.type === WebInspector.resourceTypes.WebSocket)
             return;
         ++this._loadedResources;
         this._updateResourceProgress();
index a2ddc43..813dbc6 100644 (file)
@@ -39,17 +39,17 @@ WebInspector.AuditRules.CacheableResponseCodes =
     301: true,
     410: true,
 
-    304: true // Underlying resource is cacheable
+    304: true // Underlying request is cacheable
 }
 
-WebInspector.AuditRules.getDomainToResourcesMap = function(resources, types, needFullResources)
+WebInspector.AuditRules.getDomainToResourcesMap = function(requests, types, needFullResources)
 {
     var domainToResourcesMap = {};
-    for (var i = 0, size = resources.length; i < size; ++i) {
-        var resource = resources[i];
-        if (types && types.indexOf(resource.type) === -1)
+    for (var i = 0, size = requests.length; i < size; ++i) {
+        var request = requests[i];
+        if (types && types.indexOf(request.type) === -1)
             continue;
-        var parsedURL = resource.url.asParsedURL();
+        var parsedURL = request.url.asParsedURL();
         if (!parsedURL)
             continue;
         var domain = parsedURL.host;
@@ -58,7 +58,7 @@ WebInspector.AuditRules.getDomainToResourcesMap = function(resources, types, nee
           domainResources = [];
           domainToResourcesMap[domain] = domainResources;
         }
-        domainResources.push(needFullResources ? resource : resource.url);
+        domainResources.push(needFullResources ? request : request.url);
     }
     return domainToResourcesMap;
 }
@@ -73,26 +73,29 @@ WebInspector.AuditRules.GzipRule = function()
 }
 
 WebInspector.AuditRules.GzipRule.prototype = {
-    doRun: function(resources, result, callback, progressMonitor)
+    /**
+     * @param {Array.<WebInspector.NetworkRequest>} requests
+     */
+    doRun: function(requests, result, callback, progressMonitor)
     {
         var totalSavings = 0;
         var compressedSize = 0;
         var candidateSize = 0;
         var summary = result.addChild("", true);
-        for (var i = 0, length = resources.length; i < length; ++i) {
-            var resource = resources[i];
-            if (resource.statusCode === 304)
-                continue; // Do not test 304 Not Modified resources as their contents are always empty.
-            if (this._shouldCompress(resource)) {
-                var size = resource.resourceSize;
+        for (var i = 0, length = requests.length; i < length; ++i) {
+            var request = requests[i];
+            if (request.statusCode === 304)
+                continue; // Do not test 304 Not Modified requests as their contents are always empty.
+            if (this._shouldCompress(request)) {
+                var size = request.resourceSize;
                 candidateSize += size;
-                if (this._isCompressed(resource)) {
+                if (this._isCompressed(request)) {
                     compressedSize += size;
                     continue;
                 }
                 var savings = 2 * size / 3;
                 totalSavings += savings;
-                summary.addFormatted("%r could save ~%s", resource.url, Number.bytesToString(savings));
+                summary.addFormatted("%r could save ~%s", request.url, Number.bytesToString(savings));
                 result.violationCount++;
             }
         }
@@ -102,18 +105,18 @@ WebInspector.AuditRules.GzipRule.prototype = {
         callback(result);
     },
 
-    _isCompressed: function(resource)
+    _isCompressed: function(request)
     {
-        var encodingHeader = resource.responseHeaders["Content-Encoding"];
+        var encodingHeader = request.responseHeaders["Content-Encoding"];
         if (!encodingHeader)
             return false;
 
         return /\b(?:gzip|deflate)\b/.test(encodingHeader);
     },
 
-    _shouldCompress: function(resource)
+    _shouldCompress: function(request)
     {
-        return resource.type.isTextType() && resource.domain && resource.resourceSize !== undefined && resource.resourceSize > 150;
+        return request.type.isTextType() && request.domain && request.resourceSize !== undefined && request.resourceSize > 150;
     }
 }
 
@@ -132,9 +135,9 @@ WebInspector.AuditRules.CombineExternalResourcesRule = function(id, name, type,
 }
 
 WebInspector.AuditRules.CombineExternalResourcesRule.prototype = {
-    doRun: function(resources, result, callback, progressMonitor)
+    doRun: function(requests, result, callback, progressMonitor)
     {
-        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, [this._type], false);
+        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(requests, [this._type], false);
         var penalizedResourceCount = 0;
         // TODO: refactor according to the chosen i18n approach
         var summary = result.addChild("", true);
@@ -187,10 +190,10 @@ WebInspector.AuditRules.MinimizeDnsLookupsRule = function(hostCountThreshold) {
 }
 
 WebInspector.AuditRules.MinimizeDnsLookupsRule.prototype = {
-    doRun: function(resources, result, callback, progressMonitor)
+    doRun: function(requests, result, callback, progressMonitor)
     {
         var summary = result.addChild("");
-        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources, undefined, false);
+        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(requests, undefined, false);
         for (var domain in domainToResourcesMap) {
             if (domainToResourcesMap[domain].length > 1)
                 continue;
@@ -225,7 +228,7 @@ WebInspector.AuditRules.ParallelizeDownloadRule = function(optimalHostnameCount,
 }
 
 WebInspector.AuditRules.ParallelizeDownloadRule.prototype = {
-    doRun: function(resources, result, callback, progressMonitor)
+    doRun: function(requests, result, callback, progressMonitor)
     {
         function hostSorter(a, b)
         {
@@ -235,7 +238,7 @@ WebInspector.AuditRules.ParallelizeDownloadRule.prototype = {
         }
 
         var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(
-            resources,
+            requests,
             [WebInspector.resourceTypes.Stylesheet, WebInspector.resourceTypes.Image],
             true);
 
@@ -253,8 +256,8 @@ WebInspector.AuditRules.ParallelizeDownloadRule.prototype = {
             hosts.splice(optimalHostnameCount);
 
         var busiestHostResourceCount = domainToResourcesMap[hosts[0]].length;
-        var resourceCountAboveThreshold = busiestHostResourceCount - this._minRequestThreshold;
-        if (resourceCountAboveThreshold <= 0)
+        var requestCountAboveThreshold = busiestHostResourceCount - this._minRequestThreshold;
+        if (requestCountAboveThreshold <= 0)
             return callback(null);
 
         var avgResourcesPerHost = 0;
@@ -265,17 +268,17 @@ WebInspector.AuditRules.ParallelizeDownloadRule.prototype = {
         avgResourcesPerHost /= optimalHostnameCount;
         avgResourcesPerHost = Math.max(avgResourcesPerHost, 1);
 
-        var pctAboveAvg = (resourceCountAboveThreshold / avgResourcesPerHost) - 1.0;
+        var pctAboveAvg = (requestCountAboveThreshold / avgResourcesPerHost) - 1.0;
         var minBalanceThreshold = this._minBalanceThreshold;
         if (pctAboveAvg < minBalanceThreshold)
             return callback(null);
 
-        var resourcesOnBusiestHost = domainToResourcesMap[hosts[0]];
+        var requestsOnBusiestHost = domainToResourcesMap[hosts[0]];
         var entry = result.addChild(String.sprintf("This page makes %d parallelizable requests to %s. Increase download parallelization by distributing the following requests across multiple hostnames.", busiestHostResourceCount, hosts[0]), true);
-        for (var i = 0; i < resourcesOnBusiestHost.length; ++i)
-            entry.addURL(resourcesOnBusiestHost[i].url);
+        for (var i = 0; i < requestsOnBusiestHost.length; ++i)
+            entry.addURL(requestsOnBusiestHost[i].url);
 
-        result.violationCount = resourcesOnBusiestHost.length;
+        result.violationCount = requestsOnBusiestHost.length;
         callback(result);
     }
 }
@@ -294,7 +297,7 @@ WebInspector.AuditRules.UnusedCssRule = function()
 }
 
 WebInspector.AuditRules.UnusedCssRule.prototype = {
-    doRun: function(resources, result, callback, progressMonitor)
+    doRun: function(requests, result, callback, progressMonitor)
     {
         var self = this;
 
@@ -353,7 +356,7 @@ WebInspector.AuditRules.UnusedCssRule.prototype = {
                         continue;
 
                     var resource = WebInspector.resourceForURL(styleSheet.sourceURL);
-                    var isInlineBlock = resource && resource.type == WebInspector.resourceTypes.Document;
+                    var isInlineBlock = resource && resource.request && resource.request.type == WebInspector.resourceTypes.Document;
                     var url = !isInlineBlock ? WebInspector.AuditRuleResult.linkifyDisplayName(styleSheet.sourceURL) : String.sprintf("Inline block #%d", ++inlineBlockOrdinal);
                     var pctUnused = Math.round(100 * unusedStylesheetSize / stylesheetSize);
                     if (!summary)
@@ -441,9 +444,9 @@ WebInspector.AuditRules.CacheControlRule.MillisPerMonth = 1000 * 60 * 60 * 24 *
 
 WebInspector.AuditRules.CacheControlRule.prototype = {
 
-    doRun: function(resources, result, callback, progressMonitor)
+    doRun: function(requests, result, callback, progressMonitor)
     {
-        var cacheableAndNonCacheableResources = this._cacheableAndNonCacheableResources(resources);
+        var cacheableAndNonCacheableResources = this._cacheableAndNonCacheableResources(requests);
         if (cacheableAndNonCacheableResources[0].length)
             this.runChecks(cacheableAndNonCacheableResources[0], result);
         this.handleNonCacheableResources(cacheableAndNonCacheableResources[1], result);
@@ -451,32 +454,32 @@ WebInspector.AuditRules.CacheControlRule.prototype = {
         callback(result);
     },
 
-    handleNonCacheableResources: function(resources, result)
+    handleNonCacheableResources: function(requests, result)
     {
     },
 
-    _cacheableAndNonCacheableResources: function(resources)
+    _cacheableAndNonCacheableResources: function(requests)
     {
         var processedResources = [[], []];
-        for (var i = 0; i < resources.length; ++i) {
-            var resource = resources[i];
-            if (!this.isCacheableResource(resource))
+        for (var i = 0; i < requests.length; ++i) {
+            var request = requests[i];
+            if (!this.isCacheableResource(request))
                 continue;
-            if (this._isExplicitlyNonCacheable(resource))
-                processedResources[1].push(resource);
+            if (this._isExplicitlyNonCacheable(request))
+                processedResources[1].push(request);
             else
-                processedResources[0].push(resource);
+                processedResources[0].push(request);
         }
         return processedResources;
     },
 
-    execCheck: function(messageText, resourceCheckFunction, resources, result)
+    execCheck: function(messageText, requestCheckFunction, requests, result)
     {
-        var resourceCount = resources.length;
+        var requestCount = requests.length;
         var urls = [];
-        for (var i = 0; i < resourceCount; ++i) {
-            if (resourceCheckFunction.call(this, resources[i]))
-                urls.push(resources[i].url);
+        for (var i = 0; i < requestCount; ++i) {
+            if (requestCheckFunction.call(this, requests[i]))
+                urls.push(requests[i].url);
         }
         if (urls.length) {
             var entry = result.addChild(messageText, true);
@@ -485,9 +488,9 @@ WebInspector.AuditRules.CacheControlRule.prototype = {
         }
     },
 
-    freshnessLifetimeGreaterThan: function(resource, timeMs)
+    freshnessLifetimeGreaterThan: function(request, timeMs)
     {
-        var dateHeader = this.responseHeader(resource, "Date");
+        var dateHeader = this.responseHeader(request, "Date");
         if (!dateHeader)
             return false;
 
@@ -496,12 +499,12 @@ WebInspector.AuditRules.CacheControlRule.prototype = {
             return false;
 
         var freshnessLifetimeMs;
-        var maxAgeMatch = this.responseHeaderMatch(resource, "Cache-Control", "max-age=(\\d+)");
+        var maxAgeMatch = this.responseHeaderMatch(request, "Cache-Control", "max-age=(\\d+)");
 
         if (maxAgeMatch)
             freshnessLifetimeMs = (maxAgeMatch[1]) ? 1000 * maxAgeMatch[1] : 0;
         else {
-            var expiresHeader = this.responseHeader(resource, "Expires");
+            var expiresHeader = this.responseHeader(request, "Expires");
             if (expiresHeader) {
                 var expDate = Date.parse(expiresHeader);
                 if (!isNaN(expDate))
@@ -512,58 +515,58 @@ WebInspector.AuditRules.CacheControlRule.prototype = {
         return (isNaN(freshnessLifetimeMs)) ? false : freshnessLifetimeMs > timeMs;
     },
 
-    responseHeader: function(resource, header)
+    responseHeader: function(request, header)
     {
-        return resource.responseHeaders[header];
+        return request.responseHeaders[header];
     },
 
-    hasResponseHeader: function(resource, header)
+    hasResponseHeader: function(request, header)
     {
-        return resource.responseHeaders[header] !== undefined;
+        return request.responseHeaders[header] !== undefined;
     },
 
-    isCompressible: function(resource)
+    isCompressible: function(request)
     {
-        return resource.type.isTextType();
+        return request.type.isTextType();
     },
 
-    isPubliclyCacheable: function(resource)
+    isPubliclyCacheable: function(request)
     {
-        if (this._isExplicitlyNonCacheable(resource))
+        if (this._isExplicitlyNonCacheable(request))
             return false;
 
-        if (this.responseHeaderMatch(resource, "Cache-Control", "public"))
+        if (this.responseHeaderMatch(request, "Cache-Control", "public"))
             return true;
 
-        return resource.url.indexOf("?") == -1 && !this.responseHeaderMatch(resource, "Cache-Control", "private");
+        return request.url.indexOf("?") == -1 && !this.responseHeaderMatch(request, "Cache-Control", "private");
     },
 
-    responseHeaderMatch: function(resource, header, regexp)
+    responseHeaderMatch: function(request, header, regexp)
     {
-        return resource.responseHeaders[header]
-            ? resource.responseHeaders[header].match(new RegExp(regexp, "im"))
+        return request.responseHeaders[header]
+            ? request.responseHeaders[header].match(new RegExp(regexp, "im"))
             : undefined;
     },
 
-    hasExplicitExpiration: function(resource)
+    hasExplicitExpiration: function(request)
     {
-        return this.hasResponseHeader(resource, "Date") &&
-            (this.hasResponseHeader(resource, "Expires") || this.responseHeaderMatch(resource, "Cache-Control", "max-age"));
+        return this.hasResponseHeader(request, "Date") &&
+            (this.hasResponseHeader(request, "Expires") || this.responseHeaderMatch(request, "Cache-Control", "max-age"));
     },
 
-    _isExplicitlyNonCacheable: function(resource)
+    _isExplicitlyNonCacheable: function(request)
     {
-        var hasExplicitExp = this.hasExplicitExpiration(resource);
-        return this.responseHeaderMatch(resource, "Cache-Control", "(no-cache|no-store|must-revalidate)") ||
-            this.responseHeaderMatch(resource, "Pragma", "no-cache") ||
-            (hasExplicitExp && !this.freshnessLifetimeGreaterThan(resource, 0)) ||
-            (!hasExplicitExp && resource.url && resource.url.indexOf("?") >= 0) ||
-            (!hasExplicitExp && !this.isCacheableResource(resource));
+        var hasExplicitExp = this.hasExplicitExpiration(request);
+        return this.responseHeaderMatch(request, "Cache-Control", "(no-cache|no-store|must-revalidate)") ||
+            this.responseHeaderMatch(request, "Pragma", "no-cache") ||
+            (hasExplicitExp && !this.freshnessLifetimeGreaterThan(request, 0)) ||
+            (!hasExplicitExp && request.url && request.url.indexOf("?") >= 0) ||
+            (!hasExplicitExp && !this.isCacheableResource(request));
     },
 
-    isCacheableResource: function(resource)
+    isCacheableResource: function(request)
     {
-        return resource.statusCode !== undefined && WebInspector.AuditRules.CacheableResponseCodes[resource.statusCode];
+        return request.statusCode !== undefined && WebInspector.AuditRules.CacheableResponseCodes[request.statusCode];
     }
 }
 
@@ -579,60 +582,60 @@ WebInspector.AuditRules.BrowserCacheControlRule = function()
 }
 
 WebInspector.AuditRules.BrowserCacheControlRule.prototype = {
-    handleNonCacheableResources: function(resources, result)
+    handleNonCacheableResources: function(requests, result)
     {
-        if (resources.length) {
+        if (requests.length) {
             var entry = result.addChild("The following resources are explicitly non-cacheable. Consider making them cacheable if possible:", true);
-            result.violationCount += resources.length;
-            for (var i = 0; i < resources.length; ++i)
-                entry.addURL(resources[i].url);
+            result.violationCount += requests.length;
+            for (var i = 0; i < requests.length; ++i)
+                entry.addURL(requests[i].url);
         }
     },
 
-    runChecks: function(resources, result, callback)
+    runChecks: function(requests, result, callback)
     {
         this.execCheck("The following resources are missing a cache expiration. Resources that do not specify an expiration may not be cached by browsers:",
-            this._missingExpirationCheck, resources, result);
+            this._missingExpirationCheck, requests, result);
         this.execCheck("The following resources specify a \"Vary\" header that disables caching in most versions of Internet Explorer:",
-            this._varyCheck, resources, result);
+            this._varyCheck, requests, result);
         this.execCheck("The following cacheable resources have a short freshness lifetime:",
-            this._oneMonthExpirationCheck, resources, result);
+            this._oneMonthExpirationCheck, requests, result);
 
         // Unable to implement the favicon check due to the WebKit limitations.
         this.execCheck("To further improve cache hit rate, specify an expiration one year in the future for the following cacheable resources:",
-            this._oneYearExpirationCheck, resources, result);
+            this._oneYearExpirationCheck, requests, result);
     },
 
-    _missingExpirationCheck: function(resource)
+    _missingExpirationCheck: function(request)
     {
-        return this.isCacheableResource(resource) && !this.hasResponseHeader(resource, "Set-Cookie") && !this.hasExplicitExpiration(resource);
+        return this.isCacheableResource(request) && !this.hasResponseHeader(request, "Set-Cookie") && !this.hasExplicitExpiration(request);
     },
 
-    _varyCheck: function(resource)
+    _varyCheck: function(request)
     {
-        var varyHeader = this.responseHeader(resource, "Vary");
+        var varyHeader = this.responseHeader(request, "Vary");
         if (varyHeader) {
             varyHeader = varyHeader.replace(/User-Agent/gi, "");
             varyHeader = varyHeader.replace(/Accept-Encoding/gi, "");
             varyHeader = varyHeader.replace(/[, ]*/g, "");
         }
-        return varyHeader && varyHeader.length && this.isCacheableResource(resource) && this.freshnessLifetimeGreaterThan(resource, 0);
+        return varyHeader && varyHeader.length && this.isCacheableResource(request) && this.freshnessLifetimeGreaterThan(request, 0);
     },
 
-    _oneMonthExpirationCheck: function(resource)
+    _oneMonthExpirationCheck: function(request)
     {
-        return this.isCacheableResource(resource) &&
-            !this.hasResponseHeader(resource, "Set-Cookie") &&
-            !this.freshnessLifetimeGreaterThan(resource, WebInspector.AuditRules.CacheControlRule.MillisPerMonth) &&
-            this.freshnessLifetimeGreaterThan(resource, 0);
+        return this.isCacheableResource(request) &&
+            !this.hasResponseHeader(request, "Set-Cookie") &&
+            !this.freshnessLifetimeGreaterThan(request, WebInspector.AuditRules.CacheControlRule.MillisPerMonth) &&
+            this.freshnessLifetimeGreaterThan(request, 0);
     },
 
-    _oneYearExpirationCheck: function(resource)
+    _oneYearExpirationCheck: function(request)
     {
-        return this.isCacheableResource(resource) &&
-            !this.hasResponseHeader(resource, "Set-Cookie") &&
-            !this.freshnessLifetimeGreaterThan(resource, 11 * WebInspector.AuditRules.CacheControlRule.MillisPerMonth) &&
-            this.freshnessLifetimeGreaterThan(resource, WebInspector.AuditRules.CacheControlRule.MillisPerMonth);
+        return this.isCacheableResource(request) &&
+            !this.hasResponseHeader(request, "Set-Cookie") &&
+            !this.freshnessLifetimeGreaterThan(request, 11 * WebInspector.AuditRules.CacheControlRule.MillisPerMonth) &&
+            this.freshnessLifetimeGreaterThan(request, WebInspector.AuditRules.CacheControlRule.MillisPerMonth);
     }
 }
 
@@ -647,32 +650,32 @@ WebInspector.AuditRules.ProxyCacheControlRule = function() {
 }
 
 WebInspector.AuditRules.ProxyCacheControlRule.prototype = {
-    runChecks: function(resources, result, callback)
+    runChecks: function(requests, result, callback)
     {
         this.execCheck("Resources with a \"?\" in the URL are not cached by most proxy caching servers:",
-            this._questionMarkCheck, resources, result);
+            this._questionMarkCheck, requests, result);
         this.execCheck("Consider adding a \"Cache-Control: public\" header to the following resources:",
-            this._publicCachingCheck, resources, result);
+            this._publicCachingCheck, requests, result);
         this.execCheck("The following publicly cacheable resources contain a Set-Cookie header. This security vulnerability can cause cookies to be shared by multiple users.",
-            this._setCookieCacheableCheck, resources, result);
+            this._setCookieCacheableCheck, requests, result);
     },
 
-    _questionMarkCheck: function(resource)
+    _questionMarkCheck: function(request)
     {
-        return resource.url.indexOf("?") >= 0 && !this.hasResponseHeader(resource, "Set-Cookie") && this.isPubliclyCacheable(resource);
+        return request.url.indexOf("?") >= 0 && !this.hasResponseHeader(request, "Set-Cookie") && this.isPubliclyCacheable(request);
     },
 
-    _publicCachingCheck: function(resource)
+    _publicCachingCheck: function(request)
     {
-        return this.isCacheableResource(resource) &&
-            !this.isCompressible(resource) &&
-            !this.responseHeaderMatch(resource, "Cache-Control", "public") &&
-            !this.hasResponseHeader(resource, "Set-Cookie");
+        return this.isCacheableResource(request) &&
+            !this.isCompressible(request) &&
+            !this.responseHeaderMatch(request, "Cache-Control", "public") &&
+            !this.hasResponseHeader(request, "Set-Cookie");
     },
 
-    _setCookieCacheableCheck: function(resource)
+    _setCookieCacheableCheck: function(request)
     {
-        return this.hasResponseHeader(resource, "Set-Cookie") && this.isPubliclyCacheable(resource);
+        return this.hasResponseHeader(request, "Set-Cookie") && this.isPubliclyCacheable(request);
     }
 }
 
@@ -688,7 +691,7 @@ WebInspector.AuditRules.ImageDimensionsRule = function()
 }
 
 WebInspector.AuditRules.ImageDimensionsRule.prototype = {
-    doRun: function(resources, result, callback, progressMonitor)
+    doRun: function(requests, result, callback, progressMonitor)
     {
         var urlToNoDimensionCount = {};
 
@@ -814,7 +817,7 @@ WebInspector.AuditRules.CssInHeadRule = function()
 }
 
 WebInspector.AuditRules.CssInHeadRule.prototype = {
-    doRun: function(resources, result, callback, progressMonitor)
+    doRun: function(requests, result, callback, progressMonitor)
     {
         function evalCallback(evalResult)
         {
@@ -898,7 +901,7 @@ WebInspector.AuditRules.StylesScriptsOrderRule = function()
 }
 
 WebInspector.AuditRules.StylesScriptsOrderRule.prototype = {
-    doRun: function(resources, result, callback, progressMonitor)
+    doRun: function(requests, result, callback, progressMonitor)
     {
         function evalCallback(resultValue)
         {
@@ -980,7 +983,7 @@ WebInspector.AuditRules.CSSRuleBase = function(id, name)
 }
 
 WebInspector.AuditRules.CSSRuleBase.prototype = {
-    doRun: function(resources, result, callback, progressMonitor)
+    doRun: function(requests, result, callback, progressMonitor)
     {
         CSSAgent.getAllStyleSheets(sheetsCallback.bind(this));
 
@@ -1141,37 +1144,37 @@ WebInspector.AuditRules.CookieRuleBase = function(id, name)
 }
 
 WebInspector.AuditRules.CookieRuleBase.prototype = {
-    doRun: function(resources, result, callback, progressMonitor)
+    doRun: function(requests, result, callback, progressMonitor)
     {
         var self = this;
         function resultCallback(receivedCookies, isAdvanced) {
             if (progressMonitor.canceled)
                 return;
 
-            self.processCookies(isAdvanced ? receivedCookies : [], resources, result);
+            self.processCookies(isAdvanced ? receivedCookies : [], requests, result);
             callback(result);
         }
 
         WebInspector.Cookies.getCookiesAsync(resultCallback);
     },
 
-    mapResourceCookies: function(resourcesByDomain, allCookies, callback)
+    mapResourceCookies: function(requestsByDomain, allCookies, callback)
     {
         for (var i = 0; i < allCookies.length; ++i) {
-            for (var resourceDomain in resourcesByDomain) {
-                if (WebInspector.Cookies.cookieDomainMatchesResourceDomain(allCookies[i].domain, resourceDomain))
-                    this._callbackForResourceCookiePairs(resourcesByDomain[resourceDomain], allCookies[i], callback);
+            for (var requestDomain in requestsByDomain) {
+                if (WebInspector.Cookies.cookieDomainMatchesResourceDomain(allCookies[i].domain, requestDomain))
+                    this._callbackForResourceCookiePairs(requestsByDomain[requestDomain], allCookies[i], callback);
             }
         }
     },
 
-    _callbackForResourceCookiePairs: function(resources, cookie, callback)
+    _callbackForResourceCookiePairs: function(requests, cookie, callback)
     {
-        if (!resources)
+        if (!requests)
             return;
-        for (var i = 0; i < resources.length; ++i) {
-            if (WebInspector.Cookies.cookieMatchesResourceURL(cookie, resources[i].url))
-                callback(resources[i], cookie);
+        for (var i = 0; i < requests.length; ++i) {
+            if (WebInspector.Cookies.cookieMatchesResourceURL(cookie, requests[i].url))
+                callback(requests[i], cookie);
         }
     }
 }
@@ -1206,7 +1209,7 @@ WebInspector.AuditRules.CookieSizeRule.prototype = {
         return result;
     },
 
-    processCookies: function(allCookies, resources, result)
+    processCookies: function(allCookies, requests, result)
     {
         function maxSizeSorter(a, b)
         {
@@ -1220,12 +1223,12 @@ WebInspector.AuditRules.CookieSizeRule.prototype = {
 
         var cookiesPerResourceDomain = {};
 
-        function collectorCallback(resource, cookie)
+        function collectorCallback(request, cookie)
         {
-            var cookies = cookiesPerResourceDomain[resource.domain];
+            var cookies = cookiesPerResourceDomain[request.domain];
             if (!cookies) {
                 cookies = [];
-                cookiesPerResourceDomain[resource.domain] = cookies;
+                cookiesPerResourceDomain[request.domain] = cookies;
             }
             cookies.push(cookie);
         }
@@ -1235,16 +1238,16 @@ WebInspector.AuditRules.CookieSizeRule.prototype = {
 
         var sortedCookieSizes = [];
 
-        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources,
+        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(requests,
                 null,
                 true);
         var matchingResourceData = {};
         this.mapResourceCookies(domainToResourcesMap, allCookies, collectorCallback.bind(this));
 
-        for (var resourceDomain in cookiesPerResourceDomain) {
-            var cookies = cookiesPerResourceDomain[resourceDomain];
+        for (var requestDomain in cookiesPerResourceDomain) {
+            var cookies = cookiesPerResourceDomain[requestDomain];
             sortedCookieSizes.push({
-                domain: resourceDomain,
+                domain: requestDomain,
                 avgCookieSize: this._average(cookies),
                 maxCookieSize: this._max(cookies)
             });
@@ -1298,9 +1301,9 @@ WebInspector.AuditRules.StaticCookielessRule = function(minResources)
 }
 
 WebInspector.AuditRules.StaticCookielessRule.prototype = {
-    processCookies: function(allCookies, resources, result)
+    processCookies: function(allCookies, requests, result)
     {
-        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(resources,
+        var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(requests,
                 [WebInspector.resourceTypes.Stylesheet,
                  WebInspector.resourceTypes.Image],
                 true);
@@ -1326,9 +1329,9 @@ WebInspector.AuditRules.StaticCookielessRule.prototype = {
         result.violationCount = badUrls.length;
     },
 
-    _collectorCallback: function(matchingResourceData, resource, cookie)
+    _collectorCallback: function(matchingResourceData, request, cookie)
     {
-        matchingResourceData[resource.url] = (matchingResourceData[resource.url] || 0) + cookie.size;
+        matchingResourceData[request.url] = (matchingResourceData[request.url] || 0) + cookie.size;
     }
 }
 
index 5200477..b834a0b 100644 (file)
@@ -103,7 +103,7 @@ WebInspector.AuditsPanel.prototype = {
 
     _executeAudit: function(categories, resultCallback)
     {
-        var resources = WebInspector.networkLog.resources;
+        var requests = WebInspector.networkLog.requests;
 
         var rulesRemaining = 0;
         for (var i = 0; i < categories.length; ++i)
@@ -138,7 +138,7 @@ WebInspector.AuditsPanel.prototype = {
             var category = categories[i];
             var result = new WebInspector.AuditCategoryResult(category);
             results.push(result);
-            category.run(resources, ruleResultReadyCallback.bind(this, result), this._progressMonitor);
+            category.run(requests, ruleResultReadyCallback.bind(this, result), this._progressMonitor);
         }
     },
 
@@ -284,11 +284,14 @@ WebInspector.AuditCategory.prototype = {
         this._rules.push(rule);
     },
 
-    run: function(resources, callback, progressMonitor)
+    /**
+     * @param {Array.<WebInspector.NetworkRequest>} requests
+     */
+    run: function(requests, callback, progressMonitor)
     {
         this._ensureInitialized();
         for (var i = 0; i < this._rules.length; ++i)
-            this._rules[i].run(resources, callback, progressMonitor);
+            this._rules[i].run(requests, callback, progressMonitor);
     },
 
     _ensureInitialized: function()
@@ -338,17 +341,23 @@ WebInspector.AuditRule.prototype = {
         this._severity = severity;
     },
 
-    run: function(resources, callback, progressMonitor)
+    /**
+     * @param {Array.<WebInspector.NetworkRequest>} requests
+     */
+    run: function(requests, callback, progressMonitor)
     {
         if (progressMonitor.canceled)
             return;
 
         var result = new WebInspector.AuditRuleResult(this.displayName);
         result.severity = this._severity;
-        this.doRun(resources, result, callback, progressMonitor);
+        this.doRun(requests, result, callback, progressMonitor);
     },
 
-    doRun: function(resources, result, callback, progressMonitor)
+    /**
+     * @param {Array.<WebInspector.NetworkRequest>} requests
+     */
+    doRun: function(requests, result, callback, progressMonitor)
     {
         throw new Error("doRun() not implemented");
     }
index ca9d6a6..dbbe406 100644 (file)
@@ -42,7 +42,7 @@
  * @param {number=} repeatCount
  * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
  * @param {ConsoleAgent.StackTrace=} stackTrace
- * @param {WebInspector.Resource=} request
+ * @param {WebInspector.NetworkRequest=} request
  */
 WebInspector.ConsoleMessageImpl = function(source, level, message, linkifier, type, url, line, repeatCount, parameters, stackTrace, request)
 {
index 70b087f..70e8aa0 100644 (file)
@@ -189,7 +189,7 @@ WebInspector.ConsoleMessage.prototype = {
  * @param {number=} repeatCount
  * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
  * @param {ConsoleAgent.StackTrace=} stackTrace
- * @param {WebInspector.Resource=} request
+ * @param {WebInspector.NetworkRequest=} request
  *
  * @return {WebInspector.ConsoleMessage}
  */
@@ -254,7 +254,7 @@ WebInspector.ConsoleDispatcher.prototype = {
             payload.repeatCount,
             payload.parameters,
             payload.stackTrace,
-            payload.networkRequestId ? WebInspector.networkResourceById(payload.networkRequestId) : undefined);
+            payload.networkRequestId ? WebInspector.networkRequestById(payload.networkRequestId) : undefined);
         this._console.addMessage(consoleMessage);
     },
 
index 8a84847..c14a530 100644 (file)
@@ -205,11 +205,12 @@ WebInspector.ConcatenatedScriptsContentProvider.prototype.__proto__ = WebInspect
 /**
  * @constructor
  * @implements {WebInspector.ContentProvider}
+ * @param {WebInspector.NetworkRequest} request
  */
-WebInspector.ResourceContentProvider = function(resource)
+WebInspector.ResourceContentProvider = function(request)
 {
-    this._mimeType = resource.type === WebInspector.resourceTypes.Script ? "text/javascript" : "text/html";
-    this._resource = resource;
+    this._mimeType = request.type === WebInspector.resourceTypes.Script ? "text/javascript" : "text/html";
+    this._request = request;
 };
 
 WebInspector.ResourceContentProvider.prototype = {
@@ -222,7 +223,7 @@ WebInspector.ResourceContentProvider.prototype = {
         {
             callback(this._mimeType, content);
         }
-        this._resource.requestContent(didRequestContent.bind(this));
+        this._request.requestContent(didRequestContent.bind(this));
     },
 
     /**
@@ -233,7 +234,7 @@ WebInspector.ResourceContentProvider.prototype = {
      */
     searchInContent: function(query, caseSensitive, isRegex, callback)
     {
-        this._resource.searchInContent(query, caseSensitive, isRegex, callback);
+        this._request.searchInContent(query, caseSensitive, isRegex, callback);
     }
 }
 
index b710d70..a17e71e 100644 (file)
@@ -809,7 +809,7 @@ WebInspector.DebuggerPresentationModelResourceBinding.prototype = {
      * @param {string} content
      * @param {function(?string)} userCallback
      * @param {?string} oldContent
-     * @param {?string} oldContentEncoded
+     * @param {boolean} oldContentEncoded
      */
     _setContentWithInitialContent: function(uiSourceCode, content, userCallback, oldContent, oldContentEncoded)
     {
index 6013349..4b4feae 100644 (file)
@@ -411,7 +411,7 @@ WebInspector.ExtensionServer.prototype = {
 
     _onGetHAR: function()
     {
-        var requests = WebInspector.networkLog.resources;
+        var requests = WebInspector.networkLog.requests;
         var harLog = (new WebInspector.HARLog(requests)).build();
         for (var i = 0; i < harLog.entries.length; ++i)
             harLog.entries[i]._requestId = this._requestId(requests[i]);
@@ -537,7 +537,7 @@ WebInspector.ExtensionServer.prototype = {
         this._registerAutosubscriptionHandler(WebInspector.extensionAPI.Events.ConsoleMessageAdded,
             WebInspector.console, WebInspector.ConsoleModel.Events.MessageAdded, this._notifyConsoleMessageAdded);
         this._registerAutosubscriptionHandler(WebInspector.extensionAPI.Events.NetworkRequestFinished,
-            WebInspector.networkManager, WebInspector.NetworkManager.EventTypes.ResourceFinished, this._notifyRequestFinished);
+            WebInspector.networkManager, WebInspector.NetworkManager.EventTypes.RequestFinished, this._notifyRequestFinished);
         this._registerAutosubscriptionHandler(WebInspector.extensionAPI.Events.ResourceAdded,
             WebInspector.resourceTreeModel,
             WebInspector.ResourceTreeModel.EventTypes.ResourceAdded,
@@ -592,7 +592,7 @@ WebInspector.ExtensionServer.prototype = {
 
     _notifyRequestFinished: function(event)
     {
-        var request = event.data;
+        var request = /** @type {WebInspector.NetworkRequest} */ event.data;
         this._postNotification(WebInspector.extensionAPI.Events.NetworkRequestFinished, this._requestId(request), (new WebInspector.HAREntry(request)).build());
     },
 
index e9c1d38..f541b23 100644 (file)
 
 /**
  * @constructor
- * @param {WebInspector.Resource} resource
+ * @param {WebInspector.NetworkRequest} request
  */
-WebInspector.HAREntry = function(resource)
+WebInspector.HAREntry = function(request)
 {
-    this._resource = resource;
+    this._request = request;
 }
 
 WebInspector.HAREntry.prototype = {
@@ -50,14 +50,14 @@ WebInspector.HAREntry.prototype = {
     build: function()
     {
         var entry =  {
-            startedDateTime: new Date(this._resource.startTime * 1000),
-            time: WebInspector.HAREntry._toMilliseconds(this._resource.duration),
+            startedDateTime: new Date(this._request.startTime * 1000),
+            time: WebInspector.HAREntry._toMilliseconds(this._request.duration),
             request: this._buildRequest(),
             response: this._buildResponse(),
             cache: { }, // Not supported yet.
             timings: this._buildTimings()
         };
-        var page = WebInspector.networkLog.pageLoadForResource(this._resource);
+        var page = WebInspector.networkLog.pageLoadForRequest(this._request);
         if (page)
             entry.pageref = "page_" + page.id;
         return entry;
@@ -69,16 +69,16 @@ WebInspector.HAREntry.prototype = {
     _buildRequest: function()
     {
         var res = {
-            method: this._resource.requestMethod,
-            url: this._buildRequestURL(this._resource.url),
-            httpVersion: this._resource.requestHttpVersion,
-            headers: this._buildHeaders(this._resource.requestHeaders),
-            queryString: this._buildParameters(this._resource.queryParameters || []),
-            cookies: this._buildCookies(this._resource.requestCookies || []),
-            headersSize: this._resource.requestHeadersSize,
+            method: this._request.requestMethod,
+            url: this._buildRequestURL(this._request.url),
+            httpVersion: this._request.requestHttpVersion,
+            headers: this._buildHeaders(this._request.requestHeaders),
+            queryString: this._buildParameters(this._request.queryParameters || []),
+            cookies: this._buildCookies(this._request.requestCookies || []),
+            headersSize: this._request.requestHeadersSize,
             bodySize: this.requestBodySize
         };
-        if (this._resource.requestFormData)
+        if (this._request.requestFormData)
             res.postData = this._buildPostData();
 
         return res;
@@ -90,14 +90,14 @@ WebInspector.HAREntry.prototype = {
     _buildResponse: function()
     {
         return {
-            status: this._resource.statusCode,
-            statusText: this._resource.statusText,
-            httpVersion: this._resource.responseHttpVersion,
-            headers: this._buildHeaders(this._resource.responseHeaders),
-            cookies: this._buildCookies(this._resource.responseCookies || []),
+            status: this._request.statusCode,
+            statusText: this._request.statusText,
+            httpVersion: this._request.responseHttpVersion,
+            headers: this._buildHeaders(this._request.responseHeaders),
+            cookies: this._buildCookies(this._request.responseCookies || []),
             content: this._buildContent(),
-            redirectURL: this._resource.responseHeaderValue("Location") || "",
-            headersSize: this._resource.responseHeadersSize,
+            redirectURL: this._request.responseHeaderValue("Location") || "",
+            headersSize: this._request.responseHeadersSize,
             bodySize: this.responseBodySize
         };
     },
@@ -108,9 +108,9 @@ WebInspector.HAREntry.prototype = {
     _buildContent: function()
     {
         var content = {
-            size: this._resource.resourceSize,
-            mimeType: this._resource.mimeType,
-            // text: this._resource.content // TODO: pull out into a boolean flag, as content can be huge (and needs to be requested with an async call)
+            size: this._request.resourceSize,
+            mimeType: this._request.mimeType,
+            // text: this._request.content // TODO: pull out into a boolean flag, as content can be huge (and needs to be requested with an async call)
         };
         var compression = this.responseCompression;
         if (typeof compression === "number")
@@ -133,7 +133,7 @@ WebInspector.HAREntry.prototype = {
         if (ssl !== -1 && send !== -1)
             send -= ssl;
 
-        if (this._resource.connectionReused) {
+        if (this._request.connectionReused) {
             connect = -1;
             blocked = waitForConnection;
         } else {
@@ -149,7 +149,7 @@ WebInspector.HAREntry.prototype = {
             connect: connect,
             send: send,
             wait: this._interval("sendEnd", "receiveHeadersEnd"),
-            receive: WebInspector.HAREntry._toMilliseconds(this._resource.receiveDuration),
+            receive: WebInspector.HAREntry._toMilliseconds(this._request.receiveDuration),
             ssl: ssl
         };
     },
@@ -171,11 +171,11 @@ WebInspector.HAREntry.prototype = {
     _buildPostData: function()
     {
         var res = {
-            mimeType: this._resource.requestHeaderValue("Content-Type"),
-            text: this._resource.requestFormData
+            mimeType: this._request.requestHeaderValue("Content-Type"),
+            text: this._request.requestFormData
         };
-        if (this._resource.formParameters)
-           res.params = this._buildParameters(this._resource.formParameters);
+        if (this._request.formParameters)
+           res.params = this._buildParameters(this._request.formParameters);
         return res;
     },
 
@@ -217,7 +217,7 @@ WebInspector.HAREntry.prototype = {
             value: cookie.value,
             path: cookie.path,
             domain: cookie.domain,
-            expires: cookie.expires(new Date(this._resource.startTime * 1000)),
+            expires: cookie.expires(new Date(this._request.startTime * 1000)),
             httpOnly: cookie.httpOnly,
             secure: cookie.secure
         };
@@ -230,7 +230,7 @@ WebInspector.HAREntry.prototype = {
      */
     _interval: function(start, end)
     {
-        var timing = this._resource.timing;
+        var timing = this._request.timing;
         if (!timing)
             return -1;
         var startTime = timing[start];
@@ -242,7 +242,7 @@ WebInspector.HAREntry.prototype = {
      */
     get requestBodySize()
     {
-        return !this._resource.requestFormData ? 0 : this._resource.requestFormData.length;
+        return !this._request.requestFormData ? 0 : this._request.requestFormData.length;
     },
 
     /**
@@ -250,9 +250,9 @@ WebInspector.HAREntry.prototype = {
      */
     get responseBodySize()
     {
-        if (this._resource.cached || this._resource.statusCode === 304)
+        if (this._request.cached || this._request.statusCode === 304)
             return 0;
-        return this._resource.transferSize - this._resource.responseHeadersSize
+        return this._request.transferSize - this._request.responseHeadersSize
     },
 
     /**
@@ -260,9 +260,9 @@ WebInspector.HAREntry.prototype = {
      */
     get responseCompression()
     {
-        if (this._resource.cached || this._resource.statusCode === 304)
+        if (this._request.cached || this._request.statusCode === 304)
             return;
-        return this._resource.resourceSize - (this._resource.transferSize - this._resource.responseHeadersSize);
+        return this._request.resourceSize - (this._request.transferSize - this._request.responseHeadersSize);
     }
 }
 
@@ -277,11 +277,11 @@ WebInspector.HAREntry._toMilliseconds = function(time)
 
 /**
  * @constructor
- * @param {Array.<WebInspector.Resource>} resources
+ * @param {Array.<WebInspector.NetworkRequest>} requests
  */
-WebInspector.HARLog = function(resources)
+WebInspector.HARLog = function(requests)
 {
-    this._resources = resources;
+    this._requests = requests;
 }
 
 WebInspector.HARLog.prototype = {
@@ -299,7 +299,7 @@ WebInspector.HARLog.prototype = {
                 version: webKitVersion ? webKitVersion[1] : "n/a"
             },
             pages: this._buildPages(),
-            entries: this._resources.map(this._convertResource.bind(this))
+            entries: this._requests.map(this._convertResource.bind(this))
         }
     },
 
@@ -310,8 +310,8 @@ WebInspector.HARLog.prototype = {
     {
         var seenIdentifiers = {};
         var pages = [];
-        for (var i = 0; i < this._resources.length; ++i) {
-            var page = WebInspector.networkLog.pageLoadForResource(this._resources[i]);
+        for (var i = 0; i < this._requests.length; ++i) {
+            var page = WebInspector.networkLog.pageLoadForRequest(this._requests[i]);
             if (!page || seenIdentifiers[page.id])
                 continue;
             seenIdentifiers[page.id] = true;
@@ -338,12 +338,12 @@ WebInspector.HARLog.prototype = {
     },
 
     /**
-     * @param {WebInspector.Resource} resource
+     * @param {WebInspector.NetworkRequest} request
      * @return {Object}
      */
-    _convertResource: function(resource)
+    _convertResource: function(request)
     {
-        return (new WebInspector.HAREntry(resource)).build();
+        return (new WebInspector.HAREntry(request)).build();
     },
 
     /**
index 5aaeb41..9c9cac3 100644 (file)
@@ -38,7 +38,7 @@ WebInspector.NetworkItemView = function(resource)
 
     this.element.addStyleClass("network-item-view");
 
-    var headersView = new WebInspector.ResourceHeadersView(resource);
+    var headersView = new WebInspector.ResourceHeadersView(resource.request);
     this.appendTab("headers", WebInspector.UIString("Headers"), headersView);
 
     var responseView = new WebInspector.ResourceResponseView(resource);
@@ -48,12 +48,12 @@ WebInspector.NetworkItemView = function(resource)
     this.appendTab("response", WebInspector.UIString("Response"), responseView);
 
     if (resource.requestCookies || resource.responseCookies) {
-        this._cookiesView = new WebInspector.ResourceCookiesView(resource);
+        this._cookiesView = new WebInspector.ResourceCookiesView(resource.request);
         this.appendTab("cookies", WebInspector.UIString("Cookies"), this._cookiesView);
     }
 
     if (resource.timing) {
-        var timingView = new WebInspector.ResourceTimingView(resource);
+        var timingView = new WebInspector.ResourceTimingView(resource.request);
         this.appendTab("timing", WebInspector.UIString("Timing"), timingView);
     }
 
index 3cb164e..8bf6422 100644 (file)
@@ -33,8 +33,8 @@
  */
 WebInspector.NetworkLog = function()
 {
-    this._resources = [];
-    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceStarted, this._onResourceStarted, this);
+    this._requests = [];
+    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this);
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._onMainFrameNavigated, this);
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.OnLoad, this._onLoad, this);
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.DOMContentLoaded, this._onDOMContentLoaded, this);
@@ -42,20 +42,20 @@ WebInspector.NetworkLog = function()
 
 WebInspector.NetworkLog.prototype = {
     /**
-     * @return {Array.<WebInspector.Resource>}
+     * @return {Array.<WebInspector.NetworkRequest>}
      */
-    get resources()
+    get requests()
     {
-        return this._resources;
+        return this._requests;
     },
 
     /**
-     * @param {WebInspector.Resource} resource
+     * @param {WebInspector.NetworkRequest} request
      * @return {WebInspector.PageLoad}
      */
-    pageLoadForResource: function(resource)
+    pageLoadForRequest: function(request)
     {
-        return resource.__page;
+        return request.__page;
     },
 
     /**
@@ -64,16 +64,16 @@ WebInspector.NetworkLog.prototype = {
     _onMainFrameNavigated: function(event)
     {
         var mainFrame = /** type {WebInspector.ResourceTreeFrame} */ event.data;
-        // Preserve resources from the new session.
+        // Preserve requests from the new session.
         this._currentPageLoad = null;
-        var oldResources = this._resources.splice(0, this._resources.length);
-        for (var i = 0; i < oldResources.length; ++i) {
-            var resource = oldResources[i];
-            if (resource.loaderId === mainFrame.loaderId) {
+        var oldRequests = this._requests.splice(0, this._requests.length);
+        for (var i = 0; i < oldRequests.length; ++i) {
+            var request = oldRequests[i];
+            if (request.loaderId === mainFrame.loaderId) {
                 if (!this._currentPageLoad)
-                    this._currentPageLoad = new WebInspector.PageLoad(resource);
-                this._resources.push(resource);
-                resource.__page = this._currentPageLoad;
+                    this._currentPageLoad = new WebInspector.PageLoad(request);
+                this._requests.push(request);
+                request.__page = this._currentPageLoad;
             }
         }
     },
@@ -81,11 +81,11 @@ WebInspector.NetworkLog.prototype = {
     /**
      * @param {WebInspector.Event} event
      */
-    _onResourceStarted: function(event)
+    _onRequestStarted: function(event)
     {
-        var resource = /** @type {WebInspector.Resource} */ event.data;
-        this._resources.push(resource);
-        resource.__page = this._currentPageLoad;
+        var request = /** @type {WebInspector.NetworkRequest} */ event.data;
+        this._requests.push(request);
+        request.__page = this._currentPageLoad;
     },
 
     /**
@@ -104,8 +104,7 @@ WebInspector.NetworkLog.prototype = {
     {
         if (this._currentPageLoad)
             this._currentPageLoad.loadTime = event.data;
-    },
-
+    }
 }
 
 /**
@@ -115,13 +114,13 @@ WebInspector.networkLog = null;
 
 /**
  * @constructor
- * @param {WebInspector.Resource} mainResource
+ * @param {WebInspector.NetworkRequest} mainRequest
  */
-WebInspector.PageLoad = function(mainResource)
+WebInspector.PageLoad = function(mainRequest)
 {
     this.id = ++WebInspector.PageLoad._lastIdentifier;
-    this.url = mainResource.url;
-    this.startTime = mainResource.startTime;
+    this.url = mainRequest.url;
+    this.startTime = mainRequest.startTime;
 }
 
 WebInspector.PageLoad._lastIdentifier = 0;
index 0f68fce..48f0f1a 100644 (file)
@@ -51,10 +51,10 @@ WebInspector.NetworkManager = function()
 WebInspector.NetworkManager.EventTypes = {
     ResourceTrackingEnabled: "ResourceTrackingEnabled",
     ResourceTrackingDisabled: "ResourceTrackingDisabled",
-    ResourceStarted: "ResourceStarted",
-    ResourceUpdated: "ResourceUpdated",
-    ResourceFinished: "ResourceFinished",
-    ResourceUpdateDropped: "ResourceUpdateDropped"
+    RequestStarted: "RequestStarted",
+    RequestUpdated: "RequestUpdated",
+    RequestFinished: "RequestFinished",
+    RequestUpdateDropped: "RequestUpdateDropped"
 }
 
 WebInspector.NetworkManager._MIMETypes = {
@@ -135,11 +135,11 @@ WebInspector.NetworkManager.prototype = {
 
     /**
      * @param {string} url
-     * @return {WebInspector.Resource}
+     * @return {WebInspector.NetworkRequest}
      */
-    inflightResourceForURL: function(url)
+    inflightRequestForURL: function(url)
     {
-        return this._dispatcher._inflightResourcesByURL[url];
+        return this._dispatcher._inflightRequestsByURL[url];
     },
 
     /**
@@ -166,72 +166,72 @@ WebInspector.NetworkManager.prototype.__proto__ = WebInspector.Object.prototype;
 WebInspector.NetworkDispatcher = function(manager)
 {
     this._manager = manager;
-    this._inflightResourcesById = {};
-    this._inflightResourcesByURL = {};
+    this._inflightRequestsById = {};
+    this._inflightRequestsByURL = {};
     InspectorBackend.registerNetworkDispatcher(this);
 }
 
 WebInspector.NetworkDispatcher.prototype = {
     /**
-     * @param {WebInspector.Resource} resource
+     * @param {WebInspector.NetworkRequest} networkRequest
      * @param {NetworkAgent.Request} request
      */
-    _updateResourceWithRequest: function(resource, request)
+    _updateNetworkRequestWithRequest: function(networkRequest, request)
     {
-        resource.requestMethod = request.method;
-        resource.requestHeaders = request.headers;
-        resource.requestFormData = request.postData;
+        networkRequest.requestMethod = request.method;
+        networkRequest.requestHeaders = request.headers;
+        networkRequest.requestFormData = request.postData;
     },
 
     /**
-     * @param {WebInspector.Resource} resource
+     * @param {WebInspector.NetworkRequest} networkRequest
      * @param {NetworkAgent.Response=} response
      */
-    _updateResourceWithResponse: function(resource, response)
+    _updateNetworkRequestWithResponse: function(networkRequest, response)
     {
         if (!response)
             return;
 
-        if (response.url && resource.url !== response.url)
-            resource.url = response.url;
-        resource.mimeType = response.mimeType;
-        resource.statusCode = response.status;
-        resource.statusText = response.statusText;
-        resource.responseHeaders = response.headers;
+        if (response.url && networkRequest.url !== response.url)
+            networkRequest.url = response.url;
+        networkRequest.mimeType = response.mimeType;
+        networkRequest.statusCode = response.status;
+        networkRequest.statusText = response.statusText;
+        networkRequest.responseHeaders = response.headers;
         if (response.headersText)
-            resource.responseHeadersText = response.headersText;
+            networkRequest.responseHeadersText = response.headersText;
         if (response.requestHeaders)
-            resource.requestHeaders = response.requestHeaders;
+            networkRequest.requestHeaders = response.requestHeaders;
         if (response.requestHeadersText)
-            resource.requestHeadersText = response.requestHeadersText;
+            networkRequest.requestHeadersText = response.requestHeadersText;
 
-        resource.connectionReused = response.connectionReused;
-        resource.connectionId = response.connectionId;
+        networkRequest.connectionReused = response.connectionReused;
+        networkRequest.connectionId = response.connectionId;
 
         if (response.fromDiskCache)
-            resource.cached = true;
+            networkRequest.cached = true;
         else
-            resource.timing = response.timing;
+            networkRequest.timing = response.timing;
 
-        if (!this._mimeTypeIsConsistentWithType(resource)) {
+        if (!this._mimeTypeIsConsistentWithType(networkRequest)) {
             WebInspector.console.addMessage(WebInspector.ConsoleMessage.create(WebInspector.ConsoleMessage.MessageSource.Network,
                 WebInspector.ConsoleMessage.MessageLevel.Warning,
-                WebInspector.UIString("Resource interpreted as %s but transferred with MIME type %s: \"%s\".", resource.type.title(), resource.mimeType, resource.url),
+                WebInspector.UIString("Resource interpreted as %s but transferred with MIME type %s: \"%s\".", networkRequest.type.title(), networkRequest.mimeType, networkRequest.url),
                 WebInspector.ConsoleMessage.MessageType.Log,
                 "",
                 0,
                 1,
                 [],
                 null,
-                resource));
+                networkRequest));
         }
     },
 
     /**
-     * @param {WebInspector.Resource} resource
+     * @param {WebInspector.NetworkRequest} networkRequest
      * @return {boolean}
      */
-    _mimeTypeIsConsistentWithType: function(resource)
+    _mimeTypeIsConsistentWithType: function(networkRequest)
     {
         // If status is an error, content is likely to be of an inconsistent type,
         // as it's going to be an error message. We do not want to emit a warning
@@ -239,33 +239,33 @@ WebInspector.NetworkDispatcher.prototype = {
         // Also, if a URL like http://localhost/wiki/load.php?debug=true&lang=en produces text/css and gets reloaded,
         // it is 304 Not Modified and its guessed mime-type is text/php, which is wrong.
         // Don't check for mime-types in 304-resources.
-        if (resource.hasErrorStatusCode() || resource.statusCode === 304)
+        if (networkRequest.hasErrorStatusCode() || networkRequest.statusCode === 304)
             return true;
 
-        if (typeof resource.type === "undefined"
-            || resource.type === WebInspector.resourceTypes.Other
-            || resource.type === WebInspector.resourceTypes.XHR
-            || resource.type === WebInspector.resourceTypes.WebSocket)
+        if (typeof networkRequest.type === "undefined"
+            || networkRequest.type === WebInspector.resourceTypes.Other
+            || networkRequest.type === WebInspector.resourceTypes.XHR
+            || networkRequest.type === WebInspector.resourceTypes.WebSocket)
             return true;
 
-        if (!resource.mimeType)
+        if (!networkRequest.mimeType)
             return true; // Might be not known for cached resources with null responses.
 
-        if (resource.mimeType in WebInspector.NetworkManager._MIMETypes)
-            return resource.type.name() in WebInspector.NetworkManager._MIMETypes[resource.mimeType];
+        if (networkRequest.mimeType in WebInspector.NetworkManager._MIMETypes)
+            return networkRequest.type.name() in WebInspector.NetworkManager._MIMETypes[networkRequest.mimeType];
 
         return false;
     },
 
     /**
-     * @param {WebInspector.Resource} resource
+     * @param {WebInspector.NetworkRequest} networkRequest
      * @param {?NetworkAgent.CachedResource} cachedResource
      */
-    _updateResourceWithCachedResource: function(resource, cachedResource)
+    _updateNetworkRequestWithCachedResource: function(networkRequest, cachedResource)
     {
-        resource.type = WebInspector.resourceTypes[cachedResource.type];
-        resource.resourceSize = cachedResource.bodySize;
-        this._updateResourceWithResponse(resource, cachedResource.response);
+        networkRequest.type = WebInspector.resourceTypes[cachedResource.type];
+        networkRequest.resourceSize = cachedResource.bodySize;
+        this._updateNetworkRequestWithResponse(networkRequest, cachedResource.response);
     },
 
     /**
@@ -292,20 +292,20 @@ WebInspector.NetworkDispatcher.prototype = {
      */
     requestWillBeSent: function(requestId, frameId, loaderId, documentURL, request, time, initiator, stackTrace, redirectResponse)
     {
-        var resource = this._inflightResourcesById[requestId];
-        if (resource) {
+        var networkRequest = this._inflightRequestsById[requestId];
+        if (networkRequest) {
             // FIXME: move this check to the backend.
             if (!redirectResponse)
                 return;
             this.responseReceived(requestId, frameId, loaderId, time, "Other", redirectResponse);
-            resource = this._appendRedirect(requestId, time, request.url);
+            networkRequest = this._appendRedirect(requestId, time, request.url);
         } else
-            resource = this._createResource(requestId, frameId, loaderId, request.url, documentURL, initiator, stackTrace);
-        resource.hasNetworkData = true;
-        this._updateResourceWithRequest(resource, request);
-        resource.startTime = time;
+            networkRequest = this._createNetworkRequest(requestId, frameId, loaderId, request.url, documentURL, initiator, stackTrace);
+        networkRequest.hasNetworkData = true;
+        this._updateNetworkRequestWithRequest(networkRequest, request);
+        networkRequest.startTime = time;
 
-        this._startResource(resource);
+        this._startNetworkRequest(networkRequest);
     },
 
     /**
@@ -313,11 +313,11 @@ WebInspector.NetworkDispatcher.prototype = {
      */
     requestServedFromCache: function(requestId)
     {
-        var resource = this._inflightResourcesById[requestId];
-        if (!resource)
+        var networkRequest = this._inflightRequestsById[requestId];
+        if (!networkRequest)
             return;
 
-        resource.cached = true;
+        networkRequest.cached = true;
     },
 
     /**
@@ -334,8 +334,8 @@ WebInspector.NetworkDispatcher.prototype = {
         if (this._isNull(response))
             return;
 
-        var resource = this._inflightResourcesById[requestId];
-        if (!resource) {
+        var networkRequest = this._inflightRequestsById[requestId];
+        if (!networkRequest) {
             // We missed the requestWillBeSent.
             var eventData = {};
             eventData.url = response.url;
@@ -343,16 +343,16 @@ WebInspector.NetworkDispatcher.prototype = {
             eventData.loaderId = loaderId;
             eventData.resourceType = resourceType;
             eventData.mimeType = response.mimeType;
-            this._manager.dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceUpdateDropped, eventData);
+            this._manager.dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.RequestUpdateDropped, eventData);
             return;
         }
 
-        resource.responseReceivedTime = time;
-        resource.type = WebInspector.resourceTypes[resourceType];
+        networkRequest.responseReceivedTime = time;
+        networkRequest.type = WebInspector.resourceTypes[resourceType];
 
-        this._updateResourceWithResponse(resource, response);
+        this._updateNetworkRequestWithResponse(networkRequest, response);
 
-        this._updateResource(resource);
+        this._updateNetworkRequest(networkRequest);
     },
 
     /**
@@ -363,16 +363,16 @@ WebInspector.NetworkDispatcher.prototype = {
      */
     dataReceived: function(requestId, time, dataLength, encodedDataLength)
     {
-        var resource = this._inflightResourcesById[requestId];
-        if (!resource)
+        var networkRequest = this._inflightRequestsById[requestId];
+        if (!networkRequest)
             return;
 
-        resource.resourceSize += dataLength;
+        networkRequest.resourceSize += dataLength;
         if (encodedDataLength != -1)
-            resource.increaseTransferSize(encodedDataLength);
-        resource.endTime = time;
+            networkRequest.increaseTransferSize(encodedDataLength);
+        networkRequest.endTime = time;
 
-        this._updateResource(resource);
+        this._updateNetworkRequest(networkRequest);
     },
 
     /**
@@ -381,10 +381,10 @@ WebInspector.NetworkDispatcher.prototype = {
      */
     loadingFinished: function(requestId, finishTime)
     {
-        var resource = this._inflightResourcesById[requestId];
-        if (!resource)
+        var networkRequest = this._inflightRequestsById[requestId];
+        if (!networkRequest)
             return;
-        this._finishResource(resource, finishTime);
+        this._finishNetworkRequest(networkRequest, finishTime);
     },
 
     /**
@@ -395,14 +395,14 @@ WebInspector.NetworkDispatcher.prototype = {
      */
     loadingFailed: function(requestId, time, localizedDescription, canceled)
     {
-        var resource = this._inflightResourcesById[requestId];
-        if (!resource)
+        var networkRequest = this._inflightRequestsById[requestId];
+        if (!networkRequest)
             return;
 
-        resource.failed = true;
-        resource.canceled = canceled;
-        resource.localizedFailDescription = localizedDescription;
-        this._finishResource(resource, time);
+        networkRequest.failed = true;
+        networkRequest.canceled = canceled;
+        networkRequest.localizedFailDescription = localizedDescription;
+        this._finishNetworkRequest(networkRequest, time);
     },
 
     /**
@@ -416,13 +416,13 @@ WebInspector.NetworkDispatcher.prototype = {
      */
     requestServedFromMemoryCache: function(requestId, frameId, loaderId, documentURL, time, initiator, cachedResource)
     {
-        var resource = this._createResource(requestId, frameId, loaderId, cachedResource.url, documentURL, initiator, null);
-        this._updateResourceWithCachedResource(resource, cachedResource);
-        resource.cached = true;
-        resource.requestMethod = "GET";
-        this._startResource(resource);
-        resource.startTime = resource.responseReceivedTime = time;
-        this._finishResource(resource, time);
+        var networkRequest = this._createNetworkRequest(requestId, frameId, loaderId, cachedResource.url, documentURL, initiator, null);
+        this._updateNetworkRequestWithCachedResource(networkRequest, cachedResource);
+        networkRequest.cached = true;
+        networkRequest.requestMethod = "GET";
+        this._startNetworkRequest(networkRequest);
+        networkRequest.startTime = networkRequest.responseReceivedTime = time;
+        this._finishNetworkRequest(networkRequest, time);
     },
 
     /**
@@ -431,9 +431,9 @@ WebInspector.NetworkDispatcher.prototype = {
      */
     webSocketCreated: function(requestId, requestURL)
     {
-        var resource = new WebInspector.Resource(requestId, requestURL, "", null);
-        resource.type = WebInspector.resourceTypes.WebSocket;
-        this._startResource(resource);
+        var networkRequest = new WebInspector.NetworkRequest(requestId, requestURL, "", "");
+        networkRequest.type = WebInspector.resourceTypes.WebSocket;
+        this._startNetworkRequest(networkRequest);
     },
 
     /**
@@ -443,16 +443,16 @@ WebInspector.NetworkDispatcher.prototype = {
      */
     webSocketWillSendHandshakeRequest: function(requestId, time, request)
     {
-        var resource = this._inflightResourcesById[requestId];
-        if (!resource)
+        var networkRequest = this._inflightRequestsById[requestId];
+        if (!networkRequest)
             return;
 
-        resource.requestMethod = "GET";
-        resource.requestHeaders = request.headers;
-        resource.webSocketRequestKey3 = request.requestKey3;
-        resource.startTime = time;
+        networkRequest.requestMethod = "GET";
+        networkRequest.requestHeaders = request.headers;
+        networkRequest.webSocketRequestKey3 = request.requestKey3;
+        networkRequest.startTime = time;
 
-        this._updateResource(resource);
+        this._updateNetworkRequest(networkRequest);
     },
 
     /**
@@ -462,17 +462,17 @@ WebInspector.NetworkDispatcher.prototype = {
      */
     webSocketHandshakeResponseReceived: function(requestId, time, response)
     {
-        var resource = this._inflightResourcesById[requestId];
-        if (!resource)
+        var networkRequest = this._inflightRequestsById[requestId];
+        if (!networkRequest)
             return;
 
-        resource.statusCode = response.status;
-        resource.statusText = response.statusText;
-        resource.responseHeaders = response.headers;
-        resource.webSocketChallengeResponse = response.challengeResponse;
-        resource.responseReceivedTime = time;
+        networkRequest.statusCode = response.status;
+        networkRequest.statusText = response.statusText;
+        networkRequest.responseHeaders = response.headers;
+        networkRequest.webSocketChallengeResponse = response.challengeResponse;
+        networkRequest.responseReceivedTime = time;
 
-        this._updateResource(resource);
+        this._updateNetworkRequest(networkRequest);
     },
 
     /**
@@ -481,70 +481,71 @@ WebInspector.NetworkDispatcher.prototype = {
      */
     webSocketClosed: function(requestId, time)
     {
-        var resource = this._inflightResourcesById[requestId];
-        if (!resource)
+        var networkRequest = this._inflightRequestsById[requestId];
+        if (!networkRequest)
             return;
-        this._finishResource(resource, time);
+        this._finishNetworkRequest(networkRequest, time);
     },
 
     /**
      * @param {NetworkAgent.RequestId} requestId
      * @param {NetworkAgent.Timestamp} time
      * @param {string} redirectURL
+     * @return {WebInspector.NetworkRequest}
      */
     _appendRedirect: function(requestId, time, redirectURL)
     {
-        var originalResource = this._inflightResourcesById[requestId];
-        var previousRedirects = originalResource.redirects || [];
-        originalResource.requestId = "redirected:" + requestId + "." + previousRedirects.length;
-        delete originalResource.redirects;
+        var originalNetworkRequest = this._inflightRequestsById[requestId];
+        var previousRedirects = originalNetworkRequest.redirects || [];
+        originalNetworkRequest.requestId = "redirected:" + requestId + "." + previousRedirects.length;
+        delete originalNetworkRequest.redirects;
         if (previousRedirects.length > 0)
-            originalResource.redirectSource = previousRedirects[previousRedirects.length - 1];
-        this._finishResource(originalResource, time);
-        var newResource = this._createResource(requestId, originalResource.frameId, originalResource.loaderId,
-             redirectURL, originalResource.documentURL, originalResource.initiator, originalResource.stackTrace);
-        newResource.redirects = previousRedirects.concat(originalResource);
-        return newResource;
+            originalNetworkRequest.redirectSource = previousRedirects[previousRedirects.length - 1];
+        this._finishNetworkRequest(originalNetworkRequest, time);
+        var newNetworkRequest = this._createNetworkRequest(requestId, originalNetworkRequest.frameId, originalNetworkRequest.loaderId,
+             redirectURL, originalNetworkRequest.documentURL, originalNetworkRequest.initiator, originalNetworkRequest.stackTrace);
+        newNetworkRequest.redirects = previousRedirects.concat(originalNetworkRequest);
+        return newNetworkRequest;
     },
 
     /**
-     * @param {WebInspector.Resource} resource
+     * @param {WebInspector.NetworkRequest} networkRequest
      */
-    _startResource: function(resource)
+    _startNetworkRequest: function(networkRequest)
     {
-        this._inflightResourcesById[resource.requestId] = resource;
-        this._inflightResourcesByURL[resource.url] = resource;
-        this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceStarted, resource);
+        this._inflightRequestsById[networkRequest.requestId] = networkRequest;
+        this._inflightRequestsByURL[networkRequest.url] = networkRequest;
+        this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.RequestStarted, networkRequest);
     },
 
     /**
-     * @param {WebInspector.Resource} resource
+     * @param {WebInspector.NetworkRequest} networkRequest
      */
-    _updateResource: function(resource)
+    _updateNetworkRequest: function(networkRequest)
     {
-        this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceUpdated, resource);
+        this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.RequestUpdated, networkRequest);
     },
 
     /**
-     * @param {WebInspector.Resource} resource
+     * @param {WebInspector.NetworkRequest} networkRequest
      * @param {NetworkAgent.Timestamp} finishTime
      */
-    _finishResource: function(resource, finishTime)
+    _finishNetworkRequest: function(networkRequest, finishTime)
     {
-        resource.endTime = finishTime;
-        resource.finished = true;
-        this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceFinished, resource);
-        delete this._inflightResourcesById[resource.requestId];
-        delete this._inflightResourcesByURL[resource.url];
+        networkRequest.endTime = finishTime;
+        networkRequest.finished = true;
+        this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.RequestFinished, networkRequest);
+        delete this._inflightRequestsById[networkRequest.requestId];
+        delete this._inflightRequestsByURL[networkRequest.url];
     },
 
     /**
      * @param {string} eventType
-     * @param {WebInspector.Resource} resource
+     * @param {WebInspector.NetworkRequest} networkRequest
      */
-    _dispatchEventToListeners: function(eventType, resource)
+    _dispatchEventToListeners: function(eventType, networkRequest)
     {
-        this._manager.dispatchEventToListeners(eventType, resource);
+        this._manager.dispatchEventToListeners(eventType, networkRequest);
     },
 
     /**
@@ -556,13 +557,13 @@ WebInspector.NetworkDispatcher.prototype = {
      * @param {NetworkAgent.Initiator} initiator
      * @param {ConsoleAgent.StackTrace=} stackTrace
      */
-    _createResource: function(requestId, frameId, loaderId, url, documentURL, initiator, stackTrace)
+    _createNetworkRequest: function(requestId, frameId, loaderId, url, documentURL, initiator, stackTrace)
     {
-        var resource = new WebInspector.Resource(requestId, url, frameId, loaderId);
-        resource.documentURL = documentURL;
-        resource.initiator = initiator;
-        resource.stackTrace = stackTrace;
-        return resource;
+        var networkRequest = new WebInspector.NetworkRequest(requestId, url, frameId, loaderId);
+        networkRequest.documentURL = documentURL;
+        networkRequest.initiator = initiator;
+        networkRequest.stackTrace = stackTrace;
+        return networkRequest;
     }
 }
 
index 5cd4576..c2dd0aa 100644 (file)
@@ -37,27 +37,27 @@ WebInspector.NetworkLogView = function()
     WebInspector.View.call(this);
     this.registerRequiredCSS("networkLogView.css");
 
-    this._allowResourceSelection = false;
-    this._resources = [];
-    this._resourcesById = {};
-    this._resourcesByURL = {};
-    this._staleResources = {};
-    this._resourceGridNodes = {};
-    this._lastResourceGridNodeId = 0;
-    this._mainResourceLoadTime = -1;
-    this._mainResourceDOMContentTime = -1;
+    this._allowRequestSelection = false;
+    this._requests = [];
+    this._requestsById = {};
+    this._requestsByURL = {};
+    this._staleRequests = {};
+    this._requestGridNodes = {};
+    this._lastRequestGridNodeId = 0;
+    this._mainRequestLoadTime = -1;
+    this._mainRequestDOMContentTime = -1;
     this._hiddenCategories = {};
-    this._matchedResources = [];
-    this._matchedResourcesMap = {};
-    this._currentMatchedResourceIndex = -1;
+    this._matchedRequests = [];
+    this._matchedRequestsMap = {};
+    this._currentMatchedRequestIndex = -1;
 
     this._createStatusbarButtons();
     this._createFilterStatusBarItems();
     this._linkifier = WebInspector.debuggerPresentationModel.createLinkifier();
 
-    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceStarted, this._onResourceStarted, this);
-    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceUpdated, this._onResourceUpdated, this);
-    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, this._onResourceUpdated, this);
+    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this);
+    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestUpdated, this._onRequestUpdated, this);
+    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, this._onRequestUpdated, this);
 
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this);
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.OnLoad, this._onLoadEventFired, this);
@@ -88,7 +88,7 @@ WebInspector.NetworkLogView.prototype = {
         this._createSummaryBar();
 
         if (!this.useLargeRows)
-            this._setLargerResources(this.useLargeRows);
+            this._setLargerRequests(this.useLargeRows);
 
         this._allowPopover = true;
         this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._getPopoverAnchor.bind(this), this._showPopover.bind(this));
@@ -103,7 +103,7 @@ WebInspector.NetworkLogView.prototype = {
 
     get statusBarItems()
     {
-        return [this._largerResourcesButton.element, this._preserveLogToggle.element, this._clearButton.element, this._filterBarElement];
+        return [this._largerRequestsButton.element, this._preserveLogToggle.element, this._clearButton.element, this._filterBarElement];
     },
 
     get useLargeRows()
@@ -116,16 +116,6 @@ WebInspector.NetworkLogView.prototype = {
         this._allowPopover = flag;
     },
 
-    get allowResourceSelection()
-    {
-        return this._allowResourceSelection;
-    },
-
-    set allowResourceSelection(flag)
-    {
-        this._allowResourceSelection = !!flag;
-    },
-
     elementsToRestoreScrollPositionsFor: function()
     {
         if (!this._dataGrid) // Not initialized yet.
@@ -264,18 +254,18 @@ WebInspector.NetworkLogView.prototype = {
     {
         this._sortingFunctions = {};
         this._sortingFunctions.name = WebInspector.NetworkDataGridNode.NameComparator;
-        this._sortingFunctions.method = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "method", false);
-        this._sortingFunctions.status = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "statusCode", false);
-        this._sortingFunctions.type = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "mimeType", false);
+        this._sortingFunctions.method = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "method", false);
+        this._sortingFunctions.status = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "statusCode", false);
+        this._sortingFunctions.type = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "mimeType", false);
         this._sortingFunctions.initiator = WebInspector.NetworkDataGridNode.InitiatorComparator;
         this._sortingFunctions.size = WebInspector.NetworkDataGridNode.SizeComparator;
-        this._sortingFunctions.time = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "duration", false);
-        this._sortingFunctions.timeline = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "startTime", false);
-        this._sortingFunctions.startTime = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "startTime", false);
-        this._sortingFunctions.endTime = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "endTime", false);
-        this._sortingFunctions.responseTime = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "responseReceivedTime", false);
-        this._sortingFunctions.duration = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "duration", true);
-        this._sortingFunctions.latency = WebInspector.NetworkDataGridNode.ResourcePropertyComparator.bind(null, "latency", true);
+        this._sortingFunctions.time = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "duration", false);
+        this._sortingFunctions.timeline = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "startTime", false);
+        this._sortingFunctions.startTime = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "startTime", false);
+        this._sortingFunctions.endTime = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "endTime", false);
+        this._sortingFunctions.responseTime = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "responseReceivedTime", false);
+        this._sortingFunctions.duration = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "duration", true);
+        this._sortingFunctions.latency = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "latency", true);
 
         var timeCalculator = new WebInspector.NetworkTransferTimeCalculator();
         var durationCalculator = new WebInspector.NetworkTransferDurationCalculator();
@@ -377,7 +367,7 @@ WebInspector.NetworkLogView.prototype = {
 
     _updateSummaryBar: function()
     {
-        var requestsNumber = this._resources.length;
+        var requestsNumber = this._requests.length;
 
         if (!requestsNumber) {
             if (this._summaryBarElement._isDisplayingWarning)
@@ -399,18 +389,18 @@ WebInspector.NetworkLogView.prototype = {
         var selectedTransferSize = 0;
         var baseTime = -1;
         var maxTime = -1;
-        for (var i = 0; i < this._resources.length; ++i) {
-            var resource = this._resources[i];
-            var resourceTransferSize = (resource.cached || !resource.transferSize) ? 0 : resource.transferSize;
-            transferSize += resourceTransferSize;
-            if (!this._hiddenCategories.all || !this._hiddenCategories[resource.type.name()]) {
+        for (var i = 0; i < this._requests.length; ++i) {
+            var request = this._requests[i];
+            var requestTransferSize = (request.cached || !request.transferSize) ? 0 : request.transferSize;
+            transferSize += requestTransferSize;
+            if (!this._hiddenCategories.all || !this._hiddenCategories[request.type.name()]) {
                 selectedRequestsNumber++;
-                selectedTransferSize += resourceTransferSize;
+                selectedTransferSize += requestTransferSize;
             }
-            if (resource.url === WebInspector.inspectedPageURL)
-                baseTime = resource.startTime;
-            if (resource.endTime > maxTime)
-                maxTime = resource.endTime;
+            if (request.url === WebInspector.inspectedPageURL)
+                baseTime = request.startTime;
+            if (request.endTime > maxTime)
+                maxTime = request.endTime;
         }
         var text = "";
         if (this._hiddenCategories.all) {
@@ -420,11 +410,11 @@ WebInspector.NetworkLogView.prototype = {
             text += String.sprintf(WebInspector.UIString("%d requests"), requestsNumber);
             text += "  \u2758  " + String.sprintf(WebInspector.UIString("%s transferred"), Number.bytesToString(transferSize));
         }
-        if (baseTime !== -1 && this._mainResourceLoadTime !== -1 && this._mainResourceDOMContentTime !== -1 && this._mainResourceDOMContentTime > baseTime) {
+        if (baseTime !== -1 && this._mainRequestLoadTime !== -1 && this._mainRequestDOMContentTime !== -1 && this._mainRequestDOMContentTime > baseTime) {
             text += "  \u2758  " + String.sprintf(WebInspector.UIString("%s (onload: %s, DOMContentLoaded: %s)"),
                         Number.secondsToString(maxTime - baseTime),
-                        Number.secondsToString(this._mainResourceLoadTime - baseTime),
-                        Number.secondsToString(this._mainResourceDOMContentTime - baseTime));
+                        Number.secondsToString(this._mainRequestLoadTime - baseTime),
+                        Number.secondsToString(this._mainRequestDOMContentTime - baseTime));
         }
         this._summaryBarElement.textContent = text;
     },
@@ -550,7 +540,7 @@ WebInspector.NetworkLogView.prototype = {
 
         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
+            // requests 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
@@ -559,8 +549,8 @@ WebInspector.NetworkLogView.prototype = {
         }
 
         this._timelineGrid.removeEventDividers();
-        if (this._mainResourceLoadTime !== -1) {
-            var percent = this.calculator.computePercentageFromEventTime(this._mainResourceLoadTime);
+        if (this._mainRequestLoadTime !== -1) {
+            var percent = this.calculator.computePercentageFromEventTime(this._mainRequestLoadTime);
 
             var loadDivider = document.createElement("div");
             loadDivider.className = "network-event-divider network-red-divider";
@@ -573,8 +563,8 @@ WebInspector.NetworkLogView.prototype = {
             this._timelineGrid.addEventDivider(loadDividerPadding);
         }
 
-        if (this._mainResourceDOMContentTime !== -1) {
-            var percent = this.calculator.computePercentageFromEventTime(this._mainResourceDOMContentTime);
+        if (this._mainRequestDOMContentTime !== -1) {
+            var percent = this.calculator.computePercentageFromEventTime(this._mainRequestDOMContentTime);
 
             var domContentDivider = document.createElement("div");
             domContentDivider.className = "network-event-divider network-blue-divider";
@@ -596,9 +586,9 @@ WebInspector.NetworkLogView.prototype = {
 
     _invalidateAllItems: function()
     {
-        for (var i = 0; i < this._resources.length; ++i) {
-            var resource = this._resources[i];
-            this._staleResources[resource.requestId] = resource;
+        for (var i = 0; i < this._requests.length; ++i) {
+            var request = this._requests[i];
+            this._staleRequests[request.requestId] = request;
         }
     },
 
@@ -619,16 +609,16 @@ WebInspector.NetworkLogView.prototype = {
         this.refresh();
     },
 
-    _resourceGridNode: function(resource)
+    _requestGridNode: function(request)
     {
-        return this._resourceGridNodes[resource.__gridNodeId];
+        return this._requestGridNodes[request.__gridNodeId];
     },
 
-    _createResourceGridNode: function(resource)
+    _createRequestGridNode: function(request)
     {
-        var node = new WebInspector.NetworkDataGridNode(this, resource);
-        resource.__gridNodeId = this._lastResourceGridNodeId++;
-        this._resourceGridNodes[resource.__gridNodeId] = node;
+        var node = new WebInspector.NetworkDataGridNode(this, request);
+        request.__gridNodeId = this._lastRequestGridNodeId++;
+        this._requestGridNodes[request.__gridNodeId] = node;
         return node;
     },
 
@@ -640,21 +630,21 @@ WebInspector.NetworkLogView.prototype = {
         this._clearButton = new WebInspector.StatusBarButton(WebInspector.UIString("Clear"), "clear-status-bar-item");
         this._clearButton.addEventListener("click", this._reset, this);
 
-        this._largerResourcesButton = new WebInspector.StatusBarButton(WebInspector.UIString("Use small resource rows."), "network-larger-resources-status-bar-item");
-        this._largerResourcesButton.toggled = WebInspector.settings.resourcesLargeRows.get();
-        this._largerResourcesButton.addEventListener("click", this._toggleLargerResources, this);
+        this._largerRequestsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Use small resource rows."), "network-larger-resources-status-bar-item");
+        this._largerRequestsButton.toggled = WebInspector.settings.resourcesLargeRows.get();
+        this._largerRequestsButton.addEventListener("click", this._toggleLargerRequests, this);
     },
 
     _onLoadEventFired: function(event)
     {
-        this._mainResourceLoadTime = event.data || -1;
+        this._mainRequestLoadTime = event.data || -1;
         // Schedule refresh to update boundaries and draw the new line.
         this._scheduleRefresh();
     },
 
     _domContentLoadedEventFired: function(event)
     {
-        this._mainResourceDOMContentTime = event.data || -1;
+        this._mainRequestDOMContentTime = event.data || -1;
         // Schedule refresh to update boundaries and draw the new line.
         this._scheduleRefresh();
     },
@@ -681,25 +671,25 @@ WebInspector.NetworkLogView.prototype = {
         var wasScrolledToLastRow = this._dataGrid.isScrolledToLastRow();
         var boundariesChanged = false;
         if (this.calculator.updateBoundariesForEventTime) {
-            boundariesChanged = this.calculator.updateBoundariesForEventTime(this._mainResourceLoadTime) || boundariesChanged;
-            boundariesChanged = this.calculator.updateBoundariesForEventTime(this._mainResourceDOMContentTime) || boundariesChanged;
+            boundariesChanged = this.calculator.updateBoundariesForEventTime(this._mainRequestLoadTime) || boundariesChanged;
+            boundariesChanged = this.calculator.updateBoundariesForEventTime(this._mainRequestDOMContentTime) || boundariesChanged;
         }
 
-        for (var resourceId in this._staleResources) {
-            var resource = this._staleResources[resourceId];
-            var node = this._resourceGridNode(resource);
+        for (var requestId in this._staleRequests) {
+            var request = this._staleRequests[requestId];
+            var node = this._requestGridNode(request);
             if (!node) {
                 // Create the timeline tree element and graph.
-                node = this._createResourceGridNode(resource);
+                node = this._createRequestGridNode(request);
                 this._dataGrid.appendChild(node);
             }
-            node.refreshResource();
+            node.refreshRequest();
 
-            if (this.calculator.updateBoundaries(resource))
+            if (this.calculator.updateBoundaries(request))
                 boundariesChanged = true;
 
             if (!node.isFilteredOut())
-                this._updateHighlightIfMatched(resource);
+                this._updateHighlightIfMatched(request);
         }
 
         if (boundariesChanged) {
@@ -707,10 +697,10 @@ WebInspector.NetworkLogView.prototype = {
             this._invalidateAllItems();
         }
 
-        for (var resourceId in this._staleResources)
-            this._resourceGridNode(this._staleResources[resourceId]).refreshGraph(this.calculator);
+        for (var requestId in this._staleRequests)
+            this._requestGridNode(this._staleRequests[requestId]).refreshGraph(this.calculator);
 
-        this._staleResources = {};
+        this._staleRequests = {};
         this._sortItems();
         this._updateSummaryBar();
         this._dataGrid.updateWidths();
@@ -735,11 +725,11 @@ WebInspector.NetworkLogView.prototype = {
         if (this._calculator)
             this._calculator.reset();
 
-        this._resources = [];
-        this._resourcesById = {};
-        this._resourcesByURL = {};
-        this._staleResources = {};
-        this._resourceGridNodes = {};
+        this._requests = [];
+        this._requestsById = {};
+        this._requestsByURL = {};
+        this._staleRequests = {};
+        this._requestGridNodes = {};
 
         if (this._dataGrid) {
             this._dataGrid.removeChildren();
@@ -747,59 +737,66 @@ WebInspector.NetworkLogView.prototype = {
             this._updateSummaryBar();
         }
 
-        this._mainResourceLoadTime = -1;
-        this._mainResourceDOMContentTime = -1;
+        this._mainRequestLoadTime = -1;
+        this._mainRequestDOMContentTime = -1;
         this._linkifier.reset();
     },
 
-    get resources()
+    get requests()
     {
-        return this._resources;
+        return this._requests;
     },
 
-    resourceById: function(id)
+    requestById: function(id)
     {
-        return this._resourcesById[id];
+        return this._requestsById[id];
     },
 
-    _onResourceStarted: function(event)
+    _onRequestStarted: function(event)
     {
-        this._appendResource(event.data);
+        this._appendRequest(event.data);
     },
 
-    _appendResource: function(resource)
+    _appendRequest: function(request)
     {
-        this._resources.push(resource);
+        this._requests.push(request);
 
         // In case of redirect request id is reassigned to a redirected
-        // resource and we need to update _resourcesById ans search results.
-        if (this._resourcesById[resource.requestId]) {
-            var oldResource = resource.redirects[resource.redirects.length - 1];
-            this._resourcesById[oldResource.requestId] = oldResource;
+        // request and we need to update _requestsById ans search results.
+        if (this._requestsById[request.requestId]) {
+            var oldRequest = request.redirects[request.redirects.length - 1];
+            this._requestsById[oldRequest.requestId] = oldRequest;
 
-            this._updateSearchMatchedListAfterRequestIdChanged(resource.requestId, oldResource.requestId);
+            this._updateSearchMatchedListAfterRequestIdChanged(request.requestId, oldRequest.requestId);
         }
-        this._resourcesById[resource.requestId] = resource;
+        this._requestsById[request.requestId] = request;
 
-        this._resourcesByURL[resource.url] = resource;
+        this._requestsByURL[request.url] = request;
 
-        // Pull all the redirects of the main resource upon commit load.
-        if (resource.redirects) {
-            for (var i = 0; i < resource.redirects.length; ++i)
-                this._refreshResource(resource.redirects[i]);
+        // Pull all the redirects of the main request upon commit load.
+        if (request.redirects) {
+            for (var i = 0; i < request.redirects.length; ++i)
+                this._refreshRequest(request.redirects[i]);
         }
 
-        this._refreshResource(resource);
+        this._refreshRequest(request);
     },
 
-    _onResourceUpdated: function(event)
+    /**
+     * @param {WebInspector.Event} event
+     */
+    _onRequestUpdated: function(event)
     {
-        this._refreshResource(event.data);
+        var request = /** @type {WebInspector.NetworkRequest} */ event.data;
+        this._refreshRequest(request);
     },
 
-    _refreshResource: function(resource)
+    /**
+     * @param {WebInspector.NetworkRequest} request
+     */
+    _refreshRequest: function(request)
     {
-        this._staleResources[resource.requestId] = resource;
+        this._staleRequests[request.requestId] = request;
         this._scheduleRefresh();
     },
 
@@ -818,19 +815,19 @@ WebInspector.NetworkLogView.prototype = {
         var frame = /** @type {WebInspector.ResourceTreeFrame} */ event.data;
         var loaderId = frame.loaderId;
 
-        // Preserve provisional load resources.
-        var resourcesToPreserve = [];
-        for (var i = 0; i < this._resources.length; ++i) {
-            var resource = this._resources[i];
-            if (resource.loaderId === loaderId)
-                resourcesToPreserve.push(resource);
+        // Preserve provisional load requests.
+        var requestsToPreserve = [];
+        for (var i = 0; i < this._requests.length; ++i) {
+            var request = this._requests[i];
+            if (request.loaderId === loaderId)
+                requestsToPreserve.push(request);
         }
 
         this._reset();
 
         // Restore preserved items.
-        for (var i = 0; i < resourcesToPreserve.length; ++i)
-            this._appendResource(resourcesToPreserve[i]);
+        for (var i = 0; i < requestsToPreserve.length; ++i)
+            this._appendRequest(requestsToPreserve[i]);
     },
 
     switchToDetailedView: function()
@@ -889,21 +886,21 @@ WebInspector.NetworkLogView.prototype = {
         this._popoverHelper.hidePopover();
     },
 
-    _toggleLargerResources: function()
+    _toggleLargerRequests: function()
     {
         WebInspector.settings.resourcesLargeRows.set(!WebInspector.settings.resourcesLargeRows.get());
-        this._setLargerResources(WebInspector.settings.resourcesLargeRows.get());
+        this._setLargerRequests(WebInspector.settings.resourcesLargeRows.get());
     },
 
-    _setLargerResources: function(enabled)
+    _setLargerRequests: function(enabled)
     {
-        this._largerResourcesButton.toggled = enabled;
+        this._largerRequestsButton.toggled = enabled;
         if (!enabled) {
-            this._largerResourcesButton.title = WebInspector.UIString("Use large resource rows.");
+            this._largerRequestsButton.title = WebInspector.UIString("Use large resource rows.");
             this._dataGrid.element.addStyleClass("small");
             this._timelineGrid.element.addStyleClass("small");
         } else {
-            this._largerResourcesButton.title = WebInspector.UIString("Use small resource rows.");
+            this._largerRequestsButton.title = WebInspector.UIString("Use small resource rows.");
             this._dataGrid.element.removeStyleClass("small");
             this._timelineGrid.element.removeStyleClass("small");
         }
@@ -918,8 +915,8 @@ WebInspector.NetworkLogView.prototype = {
         var anchor = element.enclosingNodeOrSelfWithClass("network-graph-bar") || element.enclosingNodeOrSelfWithClass("network-graph-label");
         if (!anchor)
             return null;
-        var resource = anchor.parentElement.resource;
-        return resource && resource.timing ? anchor : null;
+        var request = anchor.parentElement.request;
+        return request && request.timing ? anchor : null;
     },
 
     /**
@@ -928,8 +925,8 @@ WebInspector.NetworkLogView.prototype = {
      */
     _showPopover: function(anchor, popover)
     {
-        var resource = anchor.parentElement.resource;
-        var tableElement = WebInspector.ResourceTimingView.createTimingTable(resource);
+        var request = anchor.parentElement.request;
+        var tableElement = WebInspector.ResourceTimingView.createTimingTable(request);
         popover.show(tableElement, anchor);
     },
 
@@ -937,24 +934,24 @@ WebInspector.NetworkLogView.prototype = {
     {
         var contextMenu = new WebInspector.ContextMenu();
         var gridNode = this._dataGrid.dataGridNodeFromNode(event.target);
-        var resource = gridNode && gridNode._resource;
+        var request = gridNode && gridNode._request;
 
-        if (resource) {
-            contextMenu.appendItem(WebInspector.openLinkExternallyLabel(), WebInspector.openResource.bind(WebInspector, resource.url, false));
+        if (request) {
+            contextMenu.appendItem(WebInspector.openLinkExternallyLabel(), WebInspector.openResource.bind(WebInspector, request.url, false));
             contextMenu.appendSeparator();
-            contextMenu.appendItem(WebInspector.copyLinkAddressLabel(), this._copyLocation.bind(this, resource));
-            if (resource.requestHeadersText)
-                contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy request headers" : "Copy Request Headers"), this._copyRequestHeaders.bind(this, resource));
-            if (resource.responseHeadersText)
-                contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy response headers" : "Copy Response Headers"), this._copyResponseHeaders.bind(this, resource));
-            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy entry as HAR" : "Copy Entry as HAR"), this._copyResource.bind(this, resource));
+            contextMenu.appendItem(WebInspector.copyLinkAddressLabel(), this._copyLocation.bind(this, request));
+            if (request.requestHeadersText)
+                contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy request headers" : "Copy Request Headers"), this._copyRequestHeaders.bind(this, request));
+            if (request.responseHeadersText)
+                contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy response headers" : "Copy Response Headers"), this._copyResponseHeaders.bind(this, request));
+            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy entry as HAR" : "Copy Entry as HAR"), this._copyRequest.bind(this, request));
         }
         contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy all as HAR" : "Copy All as HAR"), this._copyAll.bind(this));
 
         if (InspectorFrontendHost.canSave()) {
             contextMenu.appendSeparator();
-            if (resource)
-                contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save entry as HAR" : "Save Entry as HAR"), this._exportResource.bind(this, resource));
+            if (request)
+                contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save entry as HAR" : "Save Entry as HAR"), this._exportRequest.bind(this, request));
             contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save all as HAR" : "Save All as HAR"), this._exportAll.bind(this));
         }
 
@@ -971,45 +968,45 @@ WebInspector.NetworkLogView.prototype = {
     _copyAll: function()
     {
         var harArchive = {
-            log: (new WebInspector.HARLog(this._resources)).build()
+            log: (new WebInspector.HARLog(this._requests)).build()
         };
         InspectorFrontendHost.copyText(JSON.stringify(harArchive, null, 2));
     },
 
-    _copyResource: function(resource)
+    _copyRequest: function(request)
     {
-        var har = (new WebInspector.HAREntry(resource)).build();
+        var har = (new WebInspector.HAREntry(request)).build();
         InspectorFrontendHost.copyText(JSON.stringify(har, null, 2));
     },
 
-    _copyLocation: function(resource)
+    _copyLocation: function(request)
     {
-        InspectorFrontendHost.copyText(resource.url);
+        InspectorFrontendHost.copyText(request.url);
     },
 
-    _copyRequestHeaders: function(resource)
+    _copyRequestHeaders: function(request)
     {
-        InspectorFrontendHost.copyText(resource.requestHeadersText);
+        InspectorFrontendHost.copyText(request.requestHeadersText);
     },
 
-    _copyResponseHeaders: function(resource)
+    _copyResponseHeaders: function(request)
     {
-        InspectorFrontendHost.copyText(resource.responseHeadersText);
+        InspectorFrontendHost.copyText(request.responseHeadersText);
     },
 
     _exportAll: function()
     {
         var harArchive = {
-            log: (new WebInspector.HARLog(this._resources)).build()
+            log: (new WebInspector.HARLog(this._requests)).build()
         };
         
         WebInspector.save(WebInspector.inspectedPageDomain + ".har", JSON.stringify(harArchive, null, 2), true);
     },
 
-    _exportResource: function(resource)
+    _exportRequest: function(request)
     {
-        var har = (new WebInspector.HAREntry(resource)).build();
-        WebInspector.save(resource.displayName + ".har", JSON.stringify(har, null, 2), true);
+        var har = (new WebInspector.HAREntry(request)).build();
+        WebInspector.save(request.displayName + ".har", JSON.stringify(har, null, 2), true);
     },
 
     _clearBrowserCache: function(event)
@@ -1063,92 +1060,92 @@ WebInspector.NetworkLogView.prototype = {
         }
     },
 
-    _matchResource: function(resource)
+    _matchRequest: function(request)
     {
         if (!this._searchRegExp)
             return -1;
 
-        if ((!resource.displayName || !resource.displayName.match(this._searchRegExp)) && !resource.folder.match(this._searchRegExp))
+        if ((!request.displayName || !request.displayName.match(this._searchRegExp)) && !request.folder.match(this._searchRegExp))
             return -1;
 
-        if (resource.requestId in this._matchedResourcesMap)
-            return this._matchedResourcesMap[resource.requestId];
+        if (request.requestId in this._matchedRequestsMap)
+            return this._matchedRequestsMap[request.requestId];
 
-        var matchedResourceIndex = this._matchedResources.length;
-        this._matchedResourcesMap[resource.requestId] = matchedResourceIndex;
-        this._matchedResources.push(resource.requestId);
+        var matchedRequestIndex = this._matchedRequests.length;
+        this._matchedRequestsMap[request.requestId] = matchedRequestIndex;
+        this._matchedRequests.push(request.requestId);
 
-        return matchedResourceIndex;
+        return matchedRequestIndex;
     },
 
     _clearSearchMatchedList: function()
     {
-        this._matchedResources = [];
-        this._matchedResourcesMap = {};
-        this._highlightNthMatchedResource(-1, false);
+        this._matchedRequests = [];
+        this._matchedRequestsMap = {};
+        this._highlightNthMatchedRequest(-1, false);
     },
 
     _updateSearchMatchedListAfterRequestIdChanged: function(oldRequestId, newRequestId)
     {
-        var resourceIndex = this._matchedResourcesMap[oldRequestId];
-        if (resourceIndex) {
-            delete this._matchedResourcesMap[oldRequestId];
-            this._matchedResourcesMap[newRequestId] = resourceIndex;
-            this._matchedResources[resourceIndex] = newRequestId;
+        var requestIndex = this._matchedRequestsMap[oldRequestId];
+        if (requestIndex) {
+            delete this._matchedRequestsMap[oldRequestId];
+            this._matchedRequestsMap[newRequestId] = requestIndex;
+            this._matchedRequests[requestIndex] = newRequestId;
         }
     },
 
-    _updateHighlightIfMatched: function(resource)
+    _updateHighlightIfMatched: function(request)
     {
-        var matchedResourceIndex = this._matchResource(resource);
-        if (matchedResourceIndex === -1)
+        var matchedRequestIndex = this._matchRequest(request);
+        if (matchedRequestIndex === -1)
             return;
 
-        this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.SearchCountUpdated, this._matchedResources.length);
+        this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.SearchCountUpdated, this._matchedRequests.length);
 
-        if (this._currentMatchedResourceIndex !== -1 && this._currentMatchedResourceIndex !== matchedResourceIndex)
+        if (this._currentMatchedRequestIndex !== -1 && this._currentMatchedRequestIndex !== matchedRequestIndex)
             return;
 
-        this._highlightNthMatchedResource(matchedResourceIndex, false);
+        this._highlightNthMatchedRequest(matchedRequestIndex, false);
     },
 
-    _highlightNthMatchedResource: function(matchedResourceIndex, reveal)
+    _highlightNthMatchedRequest: function(matchedRequestIndex, reveal)
     {
         if (this._highlightedSubstringChanges) {
             revertDomChanges(this._highlightedSubstringChanges);
             this._highlightedSubstringChanges = null;
         }
 
-        if (matchedResourceIndex === -1) {
-            this._currentMatchedResourceIndex = matchedResourceIndex;
+        if (matchedRequestIndex === -1) {
+            this._currentMatchedRequestIndex = matchedRequestIndex;
             return;
         }
 
-        var resource = this._resourcesById[this._matchedResources[matchedResourceIndex]];
-        if (!resource)
+        var request = this._requestsById[this._matchedRequests[matchedRequestIndex]];
+        if (!request)
             return;
 
-        var nameMatched = resource.displayName && resource.displayName.match(this._searchRegExp);
-        var pathMatched = resource.path && resource.folder.match(this._searchRegExp);
-        if (!nameMatched && pathMatched && !this._largerResourcesButton.toggled)
-            this._toggleLargerResources();
+        var nameMatched = request.displayName && request.displayName.match(this._searchRegExp);
+        var pathMatched = request.path && request.folder.match(this._searchRegExp);
+        if (!nameMatched && pathMatched && !this._largerRequestsButton.toggled)
+            this._toggleLargerRequests();
 
-        var node = this._resourceGridNode(resource);
+        var node = this._requestGridNode(request);
         if (node) {
             this._highlightedSubstringChanges = node._highlightMatchedSubstring(this._searchRegExp);
             if (reveal)
                 node.reveal();
-            this._currentMatchedResourceIndex = matchedResourceIndex;
+            this._currentMatcRequestrceIndex = matchedRequestIndex;
         }
-        this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.SearchIndexUpdated, this._currentMatchedResourceIndex);
+        this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.SearchIndexUpdated, this._currentMatchedRequestIndex);
     },
 
     performSearch: function(searchQuery, sortOrFilterApplied)
     {
-        var newMatchedResourceIndex = 0;
+        var newMatchedRequestIndex = 0;
         var currentMatchedRequestId;
-        if (this._currentMatchedResourceIndex !== -1)
-            currentMatchedRequestId = this._matchedResources[this._currentMatchedResourceIndex];
+        if (this._currentMatchedRequestIndex !== -1)
+            currentMatchedRequestId = this._matchedRequests[this._currentMatchedRequestIndex];
 
         if (!sortOrFilterApplied)
             this._searchRegExp = createPlainTextSearchRegex(searchQuery, "i");
@@ -1156,33 +1153,33 @@ WebInspector.NetworkLogView.prototype = {
         this._clearSearchMatchedList();
 
         var childNodes = this._dataGrid.dataTableBody.childNodes;
-        var resourceNodes = Array.prototype.slice.call(childNodes, 0, childNodes.length - 1); // drop the filler row.
+        var requestNodes = Array.prototype.slice.call(childNodes, 0, childNodes.length - 1); // drop the filler row.
 
-        for (var i = 0; i < resourceNodes.length; ++i) {
-            var dataGridNode = this._dataGrid.dataGridNodeFromNode(resourceNodes[i]);
+        for (var i = 0; i < requestNodes.length; ++i) {
+            var dataGridNode = this._dataGrid.dataGridNodeFromNode(requestNodes[i]);
             if (dataGridNode.isFilteredOut())
                 continue;
 
-            if (this._matchResource(dataGridNode._resource) !== -1 && dataGridNode._resource.requestId === currentMatchedRequestId)
-                newMatchedResourceIndex = this._matchedResources.length - 1;
+            if (this._matchRequest(dataGridNode._request) !== -1 && dataGridNode._request.requestId === currentMatchedRequestId)
+                newMatchedRequestIndex = this._matchedRequests.length - 1;
         }
 
-        this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.SearchCountUpdated, this._matchedResources.length);
-        this._highlightNthMatchedResource(newMatchedResourceIndex, !sortOrFilterApplied);
+        this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.SearchCountUpdated, this._matchedRequests.length);
+        this._highlightNthMatchedRequest(newMatchedRequestIndex, !sortOrFilterApplied);
     },
 
     jumpToPreviousSearchResult: function()
     {
-        if (!this._matchedResources.length)
+        if (!this._matchedRequests.length)
             return;
-        this._highlightNthMatchedResource((this._currentMatchedResourceIndex + this._matchedResources.length - 1) % this._matchedResources.length, true);
+        this._highlightNthMatchedRequest((this._currentMatchedRequestIndex + this._matchedRequests.length - 1) % this._matchedRequests.length, true);
     },
 
     jumpToNextSearchResult: function()
     {
-        if (!this._matchedResources.length)
+        if (!this._matchedRequests.length)
             return;
-        this._highlightNthMatchedResource((this._currentMatchedResourceIndex + 1) % this._matchedResources.length, true);
+        this._highlightNthMatchedRequest((this._currentMatchedRequestIndex + 1) % this._matchedRequests.length, true);
     },
 
     searchCanceled: function()
@@ -1191,11 +1188,11 @@ WebInspector.NetworkLogView.prototype = {
         this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.SearchCountUpdated, 0);
     },
 
-    revealAndHighlightResource: function(resource)
+    revealAndHighlightRequest: function(request)
     {
         this._removeAllNodeHighlights();
 
-        var node = this._resourceGridNode(resource);
+        var node = this._requestGridNode(request);
         if (node) {
             this._dataGrid.element.focus();
             node.reveal();
@@ -1223,7 +1220,7 @@ WebInspector.NetworkLogView.prototype.__proto__ = WebInspector.View.prototype;
 WebInspector.NetworkLogView.EventTypes = {
     ViewCleared: "ViewCleared",
     RowSizeChanged: "RowSizeChanged",
-    ResourceSelected: "ResourceSelected",
+    RequestSelected: "RequestSelected",
     SearchCountUpdated: "SearchCountUpdated",
     SearchIndexUpdated: "SearchIndexUpdated"
 };
@@ -1251,7 +1248,7 @@ WebInspector.NetworkPanel = function()
 
     this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes.ViewCleared, this._onViewCleared, this);
     this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes.RowSizeChanged, this._onRowSizeChanged, this);
-    this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes.ResourceSelected, this._onResourceSelected, this);
+    this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes.RequestSelected, this._onRequestSelected, this);
     this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes.SearchCountUpdated, this._onSearchCountUpdated, this);
     this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes.SearchIndexUpdated, this._onSearchIndexUpdated, this);
 
@@ -1291,7 +1288,7 @@ WebInspector.NetworkPanel.prototype = {
 
     handleShortcut: function(event)
     {
-        if (this._viewingResourceMode && event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code) {
+        if (this._viewingRequestMode && event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code) {
             this._toggleGridMode();
             event.handled = true;
             return;
@@ -1305,42 +1302,42 @@ WebInspector.NetworkPanel.prototype = {
         WebInspector.Panel.prototype.wasShown.call(this);
     },
 
-    get resources()
+    get requests()
     {
-        return this._networkLogView.resources;
+        return this._networkLogView.requests;
     },
 
-    resourceById: function(id)
+    requestById: function(id)
     {
-        return this._networkLogView.resourceById(id);
+        return this._networkLogView.requestById(id);
     },
 
-    _resourceByAnchor: function(anchor)
+    _requestByAnchor: function(anchor)
     {
-        return anchor.requestId ? this.resourceById(anchor.requestId) : this._networkLogView._resourcesByURL[anchor.href];
+        return anchor.requestId ? this.requestById(anchor.requestId) : this._networkLogView._requestsByURL[anchor.href];
     },
 
     canShowAnchorLocation: function(anchor)
     {
-        return !!this._resourceByAnchor(anchor);
+        return !!this._requestByAnchor(anchor);
     },
 
     showAnchorLocation: function(anchor)
     {
-        var resource = this._resourceByAnchor(anchor);
-        this.revealAndHighlightResource(resource)
+        var request = this._requestByAnchor(anchor);
+        this.revealAndHighlightRequest(request)
     },
 
-    revealAndHighlightResource: function(resource)
+    revealAndHighlightRequest: function(request)
     {
         this._toggleGridMode();
-        if (resource)
-            this._networkLogView.revealAndHighlightResource(resource);
+        if (request)
+            this._networkLogView.revealAndHighlightRequest(request);
     },
 
     _onViewCleared: function(event)
     {
-        this._closeVisibleResource();
+        this._closeVisibleRequest();
         this._toggleGridMode();
         this._viewsContainerElement.removeChildren();
         this._viewsContainerElement.appendChild(this._closeButtonElement);
@@ -1364,29 +1361,29 @@ WebInspector.NetworkPanel.prototype = {
         WebInspector.searchController.updateCurrentMatchIndex(event.data, this);
     },
 
-    _onResourceSelected: function(event)
+    _onRequestSelected: function(event)
     {
-        this._showResource(event.data);
+        this._showRequest(event.data);
     },
 
-    _showResource: function(resource)
+    _showRequest: function(request)
     {
-        if (!resource)
+        if (!request)
             return;
 
-        this._toggleViewingResourceMode();
+        this._toggleViewingRequestMode();
 
         if (this.visibleView) {
             this.visibleView.detach();
             delete this.visibleView;
         }
 
-        var view = new WebInspector.NetworkItemView(resource);
+        var view = new WebInspector.NetworkItemView(request);
         view.show(this._viewsContainerElement);
         this.visibleView = view;
     },
 
-    _closeVisibleResource: function()
+    _closeVisibleRequest: function()
     {
         this.element.removeStyleClass("viewing-resource");
 
@@ -1398,27 +1395,27 @@ WebInspector.NetworkPanel.prototype = {
 
     _toggleGridMode: function()
     {
-        if (this._viewingResourceMode) {
-            this._viewingResourceMode = false;
+        if (this._viewingRequestMode) {
+            this._viewingRequestMode = false;
             this.element.removeStyleClass("viewing-resource");
             this.splitView.hideMainElement();
         }
 
         this._networkLogView.switchToDetailedView();
         this._networkLogView.allowPopover = true;
-        this._networkLogView.allowResourceSelection = false;
+        this._networkLogView._allowRequestSelection = false;
     },
 
-    _toggleViewingResourceMode: function()
+    _toggleViewingRequestMode: function()
     {
-        if (this._viewingResourceMode)
+        if (this._viewingRequestMode)
             return;
-        this._viewingResourceMode = true;
+        this._viewingRequestMode = true;
 
         this.element.addStyleClass("viewing-resource");
         this.splitView.showMainElement();
         this._networkLogView.allowPopover = false;
-        this._networkLogView.allowResourceSelection = true;
+        this._networkLogView._allowRequestSelection = true;
         this._networkLogView.switchToBriefView();
     },
 
@@ -1520,20 +1517,20 @@ WebInspector.NetworkTimeCalculator = function(startAtZero)
 }
 
 WebInspector.NetworkTimeCalculator.prototype = {
-    computeBarGraphPercentages: function(resource)
+    computeBarGraphPercentages: function(request)
     {
-        if (resource.startTime !== -1)
-            var start = ((resource.startTime - this.minimumBoundary) / this.boundarySpan) * 100;
+        if (request.startTime !== -1)
+            var start = ((request.startTime - this.minimumBoundary) / this.boundarySpan) * 100;
         else
             var start = 0;
 
-        if (resource.responseReceivedTime !== -1)
-            var middle = ((resource.responseReceivedTime - this.minimumBoundary) / this.boundarySpan) * 100;
+        if (request.responseReceivedTime !== -1)
+            var middle = ((request.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;
+        if (request.endTime !== -1)
+            var end = ((request.endTime - this.minimumBoundary) / this.boundarySpan) * 100;
         else
             var end = (this.startAtZero ? middle : 100);
 
@@ -1569,35 +1566,35 @@ WebInspector.NetworkTimeCalculator.prototype = {
         return false;
     },
 
-    computeBarGraphLabels: function(resource)
+    computeBarGraphLabels: function(request)
     {
         var rightLabel = "";
-        if (resource.responseReceivedTime !== -1 && resource.endTime !== -1)
-            rightLabel = this.formatTime(resource.endTime - resource.responseReceivedTime);
+        if (request.responseReceivedTime !== -1 && request.endTime !== -1)
+            rightLabel = this.formatTime(request.endTime - request.responseReceivedTime);
 
-        var hasLatency = resource.latency > 0;
+        var hasLatency = request.latency > 0;
         if (hasLatency)
-            var leftLabel = this.formatTime(resource.latency);
+            var leftLabel = this.formatTime(request.latency);
         else
             var leftLabel = rightLabel;
 
-        if (resource.timing)
+        if (request.timing)
             return {left: leftLabel, right: rightLabel};
 
         if (hasLatency && rightLabel) {
-            var total = this.formatTime(resource.duration);
+            var total = this.formatTime(request.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)
+        if (request.cached)
             tooltip = WebInspector.UIString("%s (from cache)", tooltip);
         return {left: leftLabel, right: rightLabel, tooltip: tooltip};
     },
 
-    updateBoundaries: function(resource)
+    updateBoundaries: function(request)
     {
         var didChange = false;
 
@@ -1605,14 +1602,14 @@ WebInspector.NetworkTimeCalculator.prototype = {
         if (this.startAtZero)
             lowerBound = 0;
         else
-            lowerBound = this._lowerBound(resource);
+            lowerBound = this._lowerBound(request);
 
         if (lowerBound !== -1 && (typeof this.minimumBoundary === "undefined" || lowerBound < this.minimumBoundary)) {
             this.minimumBoundary = lowerBound;
             didChange = true;
         }
 
-        var upperBound = this._upperBound(resource);
+        var upperBound = this._upperBound(request);
         if (upperBound !== -1 && (typeof this.maximumBoundary === "undefined" || upperBound > this.maximumBoundary)) {
             this.maximumBoundary = upperBound;
             didChange = true;
@@ -1626,12 +1623,12 @@ WebInspector.NetworkTimeCalculator.prototype = {
         return Number.secondsToString(value);
     },
 
-    _lowerBound: function(resource)
+    _lowerBound: function(request)
     {
         return 0;
     },
 
-    _upperBound: function(resource)
+    _upperBound: function(request)
     {
         return 0;
     }
@@ -1654,14 +1651,14 @@ WebInspector.NetworkTransferTimeCalculator.prototype = {
         return Number.secondsToString(value);
     },
 
-    _lowerBound: function(resource)
+    _lowerBound: function(request)
     {
-        return resource.startTime;
+        return request.startTime;
     },
 
-    _upperBound: function(resource)
+    _upperBound: function(request)
     {
-        return resource.endTime;
+        return request.endTime;
     }
 }
 
@@ -1682,9 +1679,9 @@ WebInspector.NetworkTransferDurationCalculator.prototype = {
         return Number.secondsToString(value);
     },
 
-    _upperBound: function(resource)
+    _upperBound: function(request)
     {
-        return resource.duration;
+        return request.duration;
     }
 }
 
@@ -1694,11 +1691,11 @@ WebInspector.NetworkTransferDurationCalculator.prototype.__proto__ = WebInspecto
  * @constructor
  * @extends {WebInspector.DataGridNode}
  */
-WebInspector.NetworkDataGridNode = function(parentView, resource)
+WebInspector.NetworkDataGridNode = function(parentView, request)
 {
     WebInspector.DataGridNode.call(this, {});
     this._parentView = parentView;
-    this._resource = resource;
+    this._request = request;
 }
 
 WebInspector.NetworkDataGridNode.prototype = {
@@ -1723,12 +1720,12 @@ WebInspector.NetworkDataGridNode.prototype = {
     {
         if (!this._parentView._hiddenCategories.all)
             return false;
-        return this._resource.type.name() in this._parentView._hiddenCategories;
+        return this._request.type.name() in this._parentView._hiddenCategories;
     },
 
     select: function()
     {
-        this._parentView.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.ResourceSelected, this._resource);
+        this._parentView.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.RequestSelected, this._request);
         WebInspector.DataGridNode.prototype.select.apply(this, arguments);
     },
 
@@ -1742,12 +1739,12 @@ WebInspector.NetworkDataGridNode.prototype = {
 
     _openInNewTab: function()
     {
-        InspectorFrontendHost.openInNewTab(this._resource.url);
+        InspectorFrontendHost.openInNewTab(this._request.url);
     },
 
     get selectable()
     {
-        return this._parentView.allowResourceSelection && !this.isFilteredOut();
+        return this._parentView._allowRequestSelection && !this.isFilteredOut();
     },
 
     _createDivInTD: function(columnIdentifier)
@@ -1768,7 +1765,7 @@ WebInspector.NetworkDataGridNode.prototype = {
         this._barAreaElement = document.createElement("div");
         //    this._barAreaElement.className = "network-graph-bar-area hidden";
         this._barAreaElement.className = "network-graph-bar-area";
-        this._barAreaElement.resource = this._resource;
+        this._barAreaElement.request = this._request;
         this._graphElement.appendChild(this._barAreaElement);
 
         this._barLeftElement = document.createElement("div");
@@ -1796,11 +1793,11 @@ WebInspector.NetworkDataGridNode.prototype = {
         this._timelineCell.appendChild(this._graphElement);
     },
 
-    refreshResource: function()
+    refreshRequest: function()
     {
         this._refreshNameCell();
 
-        this._methodCell.setTextAndTitle(this._resource.requestMethod);
+        this._methodCell.setTextAndTitle(this._request.requestMethod);
 
         this._refreshStatusCell();
         this._refreshTypeCell();
@@ -1809,13 +1806,13 @@ WebInspector.NetworkDataGridNode.prototype = {
         this._refreshSizeCell();
         this._refreshTimeCell();
 
-        if (this._resource.cached)
+        if (this._request.cached)
             this._graphElement.addStyleClass("resource-cached");
 
         this._element.addStyleClass("network-item");
-        if (!this._element.hasStyleClass("network-type-" + this._resource.type.name())) {
+        if (!this._element.hasStyleClass("network-type-" + this._request.type.name())) {
             this._element.removeMatchingStyleClasses("network-type-\\w+");
-            this._element.addStyleClass("network-type-" + this._resource.type.name());
+            this._element.addStyleClass("network-type-" + this._request.type.name());
         }
     },
 
@@ -1823,10 +1820,10 @@ WebInspector.NetworkDataGridNode.prototype = {
     {
         this._nameCell.removeChildren();
 
-        if (this._resource.type === WebInspector.resourceTypes.Image) {
+        if (this._request.type === WebInspector.resourceTypes.Image) {
             var previewImage = document.createElement("img");
             previewImage.className = "image-network-icon-preview";
-            this._resource.populateImageSource(previewImage);
+            this._request.populateImageSource(previewImage);
 
             var iconElement = document.createElement("div");
             iconElement.className = "icon";
@@ -1839,20 +1836,20 @@ WebInspector.NetworkDataGridNode.prototype = {
         this._nameCell.appendChild(document.createTextNode(this._fileName()));
 
 
-        var subtitle = this._resource.displayDomain;
+        var subtitle = this._request.displayDomain;
 
-        if (this._resource.path)
-            subtitle += this._resource.folder;
+        if (this._request.path)
+            subtitle += this._request.folder;
 
         this._appendSubtitle(this._nameCell, subtitle);
-        this._nameCell.title = this._resource.url;
+        this._nameCell.title = this._request.url;
     },
 
     _fileName: function()
     {
-        var fileName = this._resource.displayName;
-        if (this._resource.queryString)
-            fileName += "?" + this._resource.queryString;
+        var fileName = this._request.displayName;
+        if (this._request.queryString)
+            fileName += "?" + this._request.queryString;
         return fileName;
     },
 
@@ -1860,8 +1857,8 @@ WebInspector.NetworkDataGridNode.prototype = {
     {
         this._statusCell.removeChildren();
 
-        if (this._resource.failed) {
-            if (this._resource.canceled)
+        if (this._request.failed) {
+            if (this._request.canceled)
                 this._statusCell.setTextAndTitle(WebInspector.UIString("(canceled)"));
             else
                 this._statusCell.setTextAndTitle(WebInspector.UIString("(failed)"));
@@ -1873,18 +1870,18 @@ WebInspector.NetworkDataGridNode.prototype = {
         this._statusCell.removeStyleClass("network-dim-cell");
         this.element.removeStyleClass("network-error-row");
 
-        if (this._resource.statusCode) {
-            this._statusCell.appendChild(document.createTextNode(this._resource.statusCode));
-            this._appendSubtitle(this._statusCell, this._resource.statusText);
-            this._statusCell.title = this._resource.statusCode + " " + this._resource.statusText;
-            if (this._resource.statusCode >= 400)
+        if (this._request.statusCode) {
+            this._statusCell.appendChild(document.createTextNode(this._request.statusCode));
+            this._appendSubtitle(this._statusCell, this._request.statusText);
+            this._statusCell.title = this._request.statusCode + " " + this._request.statusText;
+            if (this._request.statusCode >= 400)
                 this.element.addStyleClass("network-error-row");
-            if (this._resource.cached)
+            if (this._request.cached)
                 this._statusCell.addStyleClass("network-dim-cell");
         } else {
-            if (!this._resource.isHttpFamily() && this._resource.finished)
+            if (!this._request.isHttpFamily() && this._request.finished)
                 this._statusCell.setTextAndTitle(WebInspector.UIString("Success"));
-            else if (this._resource.isPingRequest())
+            else if (this._request.isPingRequest())
                 this._statusCell.setTextAndTitle(WebInspector.UIString("(ping)"));
             else
                 this._statusCell.setTextAndTitle(WebInspector.UIString("(pending)"));
@@ -1894,12 +1891,12 @@ WebInspector.NetworkDataGridNode.prototype = {
 
     _refreshTypeCell: function()
     {
-        if (this._resource.mimeType) {
+        if (this._request.mimeType) {
             this._typeCell.removeStyleClass("network-dim-cell");
-            this._typeCell.setTextAndTitle(this._resource.mimeType);
-        } else if (this._resource.isPingRequest()) {
+            this._typeCell.setTextAndTitle(this._request.mimeType);
+        } else if (this._request.isPingRequest()) {
             this._typeCell.removeStyleClass("network-dim-cell");
-            this._typeCell.setTextAndTitle(this._resource.requestContentType());
+            this._typeCell.setTextAndTitle(this._request.requestContentType());
         } else {
             this._typeCell.addStyleClass("network-dim-cell");
             this._typeCell.setTextAndTitle(WebInspector.UIString("Pending"));
@@ -1908,18 +1905,18 @@ WebInspector.NetworkDataGridNode.prototype = {
 
     _refreshInitiatorCell: function()
     {
-        var initiator = this._resource.initiator;
-        if ((initiator && initiator.type !== "other") || this._resource.redirectSource) {
+        var initiator = this._request.initiator;
+        if ((initiator && initiator.type !== "other") || this._request.redirectSource) {
             this._initiatorCell.removeStyleClass("network-dim-cell");
             this._initiatorCell.removeChildren();
-            if (this._resource.redirectSource) {
-                var redirectSource = this._resource.redirectSource;
+            if (this._request.redirectSource) {
+                var redirectSource = this._request.redirectSource;
                 this._initiatorCell.title = redirectSource.url;
                 this._initiatorCell.appendChild(WebInspector.linkifyRequestAsNode(redirectSource));
                 this._appendSubtitle(this._initiatorCell, WebInspector.UIString("Redirect"));
             } else if (initiator.type === "script") {
                 var topFrame = initiator.stackTrace[0];
-                // This could happen when resource loading was triggered by console.
+                // This could happen when request loading was triggered by console.
                 if (!topFrame.url) {
                     this._initiatorCell.addStyleClass("network-dim-cell");
                     this._initiatorCell.setTextAndTitle(WebInspector.UIString("Other"));
@@ -1942,12 +1939,12 @@ WebInspector.NetworkDataGridNode.prototype = {
 
     _refreshSizeCell: function()
     {
-        if (this._resource.cached) {
+        if (this._request.cached) {
             this._sizeCell.setTextAndTitle(WebInspector.UIString("(from cache)"));
             this._sizeCell.addStyleClass("network-dim-cell");
         } else {
-            var resourceSize = typeof this._resource.resourceSize === "number" ? Number.bytesToString(this._resource.resourceSize) : "?";
-            var transferSize = typeof this._resource.transferSize === "number" ? Number.bytesToString(this._resource.transferSize) : "?";
+            var resourceSize = typeof this._request.resourceSize === "number" ? Number.bytesToString(this._request.resourceSize) : "?";
+            var transferSize = typeof this._request.transferSize === "number" ? Number.bytesToString(this._request.transferSize) : "?";
             this._sizeCell.setTextAndTitle(transferSize);
             this._sizeCell.removeStyleClass("network-dim-cell");
             this._appendSubtitle(this._sizeCell, resourceSize);
@@ -1956,10 +1953,10 @@ WebInspector.NetworkDataGridNode.prototype = {
 
     _refreshTimeCell: function()
     {
-        if (this._resource.duration > 0) {
+        if (this._request.duration > 0) {
             this._timeCell.removeStyleClass("network-dim-cell");
-            this._timeCell.setTextAndTitle(Number.secondsToString(this._resource.duration));
-            this._appendSubtitle(this._timeCell, Number.secondsToString(this._resource.latency));
+            this._timeCell.setTextAndTitle(Number.secondsToString(this._request.duration));
+            this._appendSubtitle(this._timeCell, Number.secondsToString(this._request.latency));
         } else {
             this._timeCell.addStyleClass("network-dim-cell");
             this._timeCell.setTextAndTitle(WebInspector.UIString("Pending"));
@@ -1976,14 +1973,14 @@ WebInspector.NetworkDataGridNode.prototype = {
 
     refreshGraph: function(calculator)
     {
-        var percentages = calculator.computeBarGraphPercentages(this._resource);
+        var percentages = calculator.computeBarGraphPercentages(this._request);
         this._percentages = percentages;
 
         this._barAreaElement.removeStyleClass("hidden");
 
-        if (!this._graphElement.hasStyleClass("network-type-" + this._resource.type.name())) {
+        if (!this._graphElement.hasStyleClass("network-type-" + this._request.type.name())) {
             this._graphElement.removeMatchingStyleClasses("network-type-\\w+");
-            this._graphElement.addStyleClass("network-type-" + this._resource.type.name());
+            this._graphElement.addStyleClass("network-type-" + this._request.type.name());
         }
 
         this._barLeftElement.style.setProperty("left", percentages.start + "%");
@@ -1992,7 +1989,7 @@ WebInspector.NetworkDataGridNode.prototype = {
         this._barLeftElement.style.setProperty("right", (100 - percentages.end) + "%");
         this._barRightElement.style.setProperty("left", percentages.middle + "%");
 
-        var labels = calculator.computeBarGraphLabels(this._resource);
+        var labels = calculator.computeBarGraphLabels(this._request);
         this._labelLeftElement.textContent = labels.left;
         this._labelRightElement.textContent = labels.right;
 
@@ -2074,8 +2071,8 @@ WebInspector.NetworkDataGridNode.prototype = {
 
 WebInspector.NetworkDataGridNode.NameComparator = function(a, b)
 {
-    var aFileName = a._resource.displayName + (a._resource.queryString ? a._resource.queryString : "");
-    var bFileName = b._resource.displayName + (b._resource.queryString ? b._resource.queryString : "");
+    var aFileName = a._request.displayName + (a._request.queryString ? a._request.queryString : "");
+    var bFileName = b._request.displayName + (b._request.queryString ? b._request.queryString : "");
     if (aFileName > bFileName)
         return 1;
     if (bFileName > aFileName)
@@ -2085,36 +2082,36 @@ WebInspector.NetworkDataGridNode.NameComparator = function(a, b)
 
 WebInspector.NetworkDataGridNode.SizeComparator = function(a, b)
 {
-    if (b._resource.cached && !a._resource.cached)
+    if (b._request.cached && !a._request.cached)
         return 1;
-    if (a._resource.cached && !b._resource.cached)
+    if (a._request.cached && !b._request.cached)
         return -1;
 
-    if (a._resource.resourceSize === b._resource.resourceSize)
+    if (a._request.resourceSize === b._request.resourceSize)
         return 0;
 
-    return a._resource.resourceSize - b._resource.resourceSize;
+    return a._request.resourceSize - b._request.resourceSize;
 }
 
 WebInspector.NetworkDataGridNode.InitiatorComparator = function(a, b)
 {
-    if (!a._resource.initiator || a._resource.initiator.type === "Other")
+    if (!a._request.initiator || a._request.initiator.type === "Other")
         return -1;
-    if (!b._resource.initiator || b._resource.initiator.type === "Other")
+    if (!b._request.initiator || b._request.initiator.type === "Other")
         return 1;
 
-    if (a._resource.initiator.url < b._resource.initiator.url)
+    if (a._request.initiator.url < b._request.initiator.url)
         return -1;
-    if (a._resource.initiator.url > b._resource.initiator.url)
+    if (a._request.initiator.url > b._request.initiator.url)
         return 1;
 
-    return a._resource.initiator.lineNumber - b._resource.initiator.lineNumber;
+    return a._request.initiator.lineNumber - b._request.initiator.lineNumber;
 }
 
-WebInspector.NetworkDataGridNode.ResourcePropertyComparator = function(propertyName, revert, a, b)
+WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyName, revert, a, b)
 {
-    var aValue = a._resource[propertyName];
-    var bValue = b._resource[propertyName];
+    var aValue = a._request[propertyName];
+    var bValue = b._request[propertyName];
     if (aValue > bValue)
         return revert ? -1 : 1;
     if (bValue > aValue)
diff --git a/Source/WebCore/inspector/front-end/NetworkRequest.js b/Source/WebCore/inspector/front-end/NetworkRequest.js
new file mode 100644 (file)
index 0000000..60afbc3
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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.
+ */
+
+/**
+ * @constructor
+ * @extends {WebInspector.Resource}
+ *
+ * @param {NetworkAgent.RequestId} requestId
+ * @param {string} url
+ * @param {NetworkAgent.FrameId} frameId
+ * @param {NetworkAgent.LoaderId} loaderId
+ */
+WebInspector.NetworkRequest = function(requestId, url, frameId, loaderId)
+{
+    // FIXME: extract request-related part from the resource and aggregate
+    // network request in the resource.
+    WebInspector.Resource.call(this, null, url, frameId, loaderId);
+    this.requestId = requestId;
+}
+
+WebInspector.NetworkRequest.Events = {
+    FinishedLoading: "FinishedLoading",
+    TimingChanged: "TimingChanged",
+    RequestHeadersChanged: "RequestHeadersChanged",
+    ResponseHeadersChanged: "ResponseHeadersChanged",
+}
+
+WebInspector.NetworkRequest.prototype.__proto__ = WebInspector.Resource.prototype;
index 538f608..7f4b719 100644 (file)
  * @extends {WebInspector.Object}
  * @param {string} id
  * @param {WebInspector.Script} script
- * @param {WebInspector.Resource} resource
+ * @param {WebInspector.NetworkRequest} request
  * @param {WebInspector.ScriptFormatter} formatter
  * @param {boolean} formatted
  */
-WebInspector.RawSourceCode = function(id, script, resource, formatter, formatted)
+WebInspector.RawSourceCode = function(id, script, request, formatter, formatted)
 {
     this.id = id;
     this.url = script.sourceURL;
@@ -48,14 +48,14 @@ WebInspector.RawSourceCode = function(id, script, resource, formatter, formatted
     this._scripts = [script];
     this._formatter = formatter;
     this._formatted = formatted;
-    this._resource = resource;
+    this._request = request;
 
-    this._useTemporaryContent = this._resource && !this._resource.finished;
+    this._useTemporaryContent = this._request && !this._request.finished;
     this._hasNewScripts = true;
     if (!this._useTemporaryContent)
         this._updateSourceMapping();
-    else if (this._resource)
-        this._resource.addEventListener("finished", this._resourceFinished.bind(this));
+    else if (this._request)
+        this._request.addEventListener(WebInspector.NetworkRequest.Events.FinishedLoading, this._requestFinished.bind(this));
 }
 
 WebInspector.RawSourceCode.Events = {
@@ -117,7 +117,7 @@ WebInspector.RawSourceCode.prototype = {
         this._updateSourceMapping();
     },
 
-    _resourceFinished: function()
+    _requestFinished: function()
     {
         this._useTemporaryContent = false;
         this._updateSourceMapping();
@@ -161,8 +161,9 @@ WebInspector.RawSourceCode.prototype = {
 
     _createContentProvider: function()
     {
-        if (this._resource && this._resource.finished)
-            return new WebInspector.ResourceContentProvider(this._resource);
+        if (this._request && this._request.finished) {
+            return new WebInspector.ResourceContentProvider(this._request);
+        }
         if (this._scripts.length === 1 && !this._scripts[0].lineOffset && !this._scripts[0].columnOffset)
             return new WebInspector.ScriptContentProvider(this._scripts[0]);
         return new WebInspector.ConcatenatedScriptsContentProvider(this._scripts);
index b006f77..8e5f458 100644 (file)
  * @constructor
  * @extends {WebInspector.Object}
  *
- * @param {NetworkAgent.RequestId} requestId
+ * @param {?WebInspector.NetworkRequest} request
  * @param {string} url
- * @param {string} frameId
- * @param {?NetworkAgent.LoaderId} loaderId
+ * @param {NetworkAgent.FrameId} frameId
+ * @param {NetworkAgent.LoaderId} loaderId
  */
-WebInspector.Resource = function(requestId, url, frameId, loaderId)
+WebInspector.Resource = function(request, url, frameId, loaderId)
 {
-    this.requestId = requestId;
+    if (request)
+        return request;
+
     this.url = url;
     this.frameId = frameId;
     this.loaderId = loaderId;
@@ -60,7 +62,7 @@ WebInspector.Resource = function(requestId, url, frameId, loaderId)
  */
 WebInspector.Resource.displayName = function(url)
 {
-    return new WebInspector.Resource("fake-transient-resource", url, "", null).displayName;
+    return new WebInspector.Resource(null, url, "", "").displayName;
 }
 
 WebInspector.Resource._domainModelBindings = [];
@@ -161,6 +163,14 @@ WebInspector.Resource.Events = {
 
 WebInspector.Resource.prototype = {
     /**
+     * @type {WebInspector.NetworkRequest}
+     */
+    get request()
+    {
+        return /** @type {WebInspector.NetworkRequest} */ this;
+    },
+
+    /**
      * @type {string}
      */
     get url()
@@ -377,7 +387,7 @@ WebInspector.Resource.prototype = {
         this._finished = x;
 
         if (x) {
-            this.dispatchEventToListeners("finished");
+            this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.FinishedLoading);
             if (this._pendingContentCallbacks.length)
                 this._innerRequestContent();
         }
@@ -441,7 +451,7 @@ WebInspector.Resource.prototype = {
             this._responseReceivedTime = x.requestTime + x.receiveHeadersEnd / 1000.0;
 
             this._timing = x;
-            this.dispatchEventToListeners("timing changed");
+            this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.TimingChanged);
         }
     },
 
@@ -500,7 +510,7 @@ WebInspector.Resource.prototype = {
         delete this._sortedRequestHeaders;
         delete this._requestCookies;
 
-        this.dispatchEventToListeners("requestHeaders changed");
+        this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.RequestHeadersChanged);
     },
 
     /**
@@ -520,7 +530,7 @@ WebInspector.Resource.prototype = {
     {
         this._requestHeadersText = x;
 
-        this.dispatchEventToListeners("requestHeaders changed");
+        this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.RequestHeadersChanged);
     },
 
     /**
@@ -604,7 +614,7 @@ WebInspector.Resource.prototype = {
         delete this._sortedResponseHeaders;
         delete this._responseCookies;
 
-        this.dispatchEventToListeners("responseHeaders changed");
+        this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.ResponseHeadersChanged);
     },
 
     /**
@@ -624,7 +634,7 @@ WebInspector.Resource.prototype = {
     {
         this._responseHeadersText = x;
 
-        this.dispatchEventToListeners("responseHeaders changed");
+        this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.ResponseHeadersChanged);
     },
 
     /**
@@ -877,7 +887,7 @@ WebInspector.Resource.prototype = {
     },
 
     /**
-     * @param {function(?string, ?string)} callback
+     * @param {function(?string, boolean)} callback
      */
     requestContent: function(callback)
     {
@@ -885,7 +895,7 @@ WebInspector.Resource.prototype = {
         // Since WebSockets are potentially long-living, fail requests immediately
         // to prevent caller blocking until resource is marked as finished.
         if (this.type === WebInspector.resourceTypes.WebSocket) {
-            callback(null, null);
+            callback(null, false);
             return;
         }
         if (typeof this._content !== "undefined") {
index cbff47d..4e51818 100644 (file)
  */
 
 /**
- * @extends {WebInspector.View}
  * @constructor
+ * @extends {WebInspector.View}
+ * @param {WebInspector.NetworkRequest} request
  */
-WebInspector.ResourceCookiesView = function(resource)
+WebInspector.ResourceCookiesView = function(request)
 {
     WebInspector.View.call(this);
     this.element.addStyleClass("resource-cookies-view");
 
-    this._resource = resource;
+    this._request = request;
 
-    resource.addEventListener("requestHeaders changed", this._refreshCookies, this);
-    resource.addEventListener("responseHeaders changed", this._refreshCookies, this);
+    request.addEventListener(WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshCookies, this);
+    request.addEventListener(WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshCookies, this);
 }
 
 WebInspector.ResourceCookiesView.prototype = {
@@ -60,7 +61,7 @@ WebInspector.ResourceCookiesView.prototype = {
 
     get _gotCookies()
     {
-        return !!(this._resource.requestCookies || this._resource.responseCookies);
+        return !!(this._request.requestCookies || this._request.responseCookies);
     },
 
     _buildCookiesTable: function()
@@ -68,8 +69,8 @@ WebInspector.ResourceCookiesView.prototype = {
         this.detachChildViews();
 
         this._cookiesTable = new WebInspector.CookiesTable(null, true);
-        this._cookiesTable.addCookiesFolder(WebInspector.UIString("Request Cookies"), this._resource.requestCookies);
-        this._cookiesTable.addCookiesFolder(WebInspector.UIString("Response Cookies"), this._resource.responseCookies);
+        this._cookiesTable.addCookiesFolder(WebInspector.UIString("Request Cookies"), this._request.requestCookies);
+        this._cookiesTable.addCookiesFolder(WebInspector.UIString("Response Cookies"), this._request.responseCookies);
         this._cookiesTable.show(this.element);
     },
 
index dbe32c1..1650e68 100644 (file)
  */
 
 /**
- * @extends {WebInspector.View}
  * @constructor
+ * @extends {WebInspector.View}
+ * @param {WebInspector.NetworkRequest} request
  */
-WebInspector.ResourceHeadersView = function(resource)
+WebInspector.ResourceHeadersView = function(request)
 {
     WebInspector.View.call(this);
     this.registerRequiredCSS("resourceView.css");
     this.element.addStyleClass("resource-headers-view");
 
-    this._resource = resource;
+    this._request = request;
 
     this._headersListElement = document.createElement("ol");
     this._headersListElement.className = "outline-disclosure";
@@ -98,9 +99,9 @@ WebInspector.ResourceHeadersView = function(resource)
     this._responseHeadersTreeElement.selectable = false;
     this._headersTreeOutline.appendChild(this._responseHeadersTreeElement);
 
-    resource.addEventListener("requestHeaders changed", this._refreshRequestHeaders, this);
-    resource.addEventListener("responseHeaders changed", this._refreshResponseHeaders, this);
-    resource.addEventListener("finished", this._refreshHTTPInformation, this);
+    request.addEventListener(WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshRequestHeaders, this);
+    request.addEventListener(WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshResponseHeaders, this);
+    request.addEventListener(WebInspector.NetworkRequest.Events.FinishedLoading, this._refreshHTTPInformation, this);
 
     this._refreshURL();
     this._refreshQueryString();
@@ -154,12 +155,12 @@ WebInspector.ResourceHeadersView.prototype = {
 
     _refreshURL: function()
     {
-        this._urlTreeElement.title = this._formatHeader(WebInspector.UIString("Request URL"), this._resource.url);
+        this._urlTreeElement.title = this._formatHeader(WebInspector.UIString("Request URL"), this._request.url);
     },
 
     _refreshQueryString: function()
     {
-        var queryParameters = this._resource.queryParameters;
+        var queryParameters = this._request.queryParameters;
         this._queryStringTreeElement.hidden = !queryParameters;
         if (queryParameters)
             this._refreshParms(WebInspector.UIString("Query String Parameters"), queryParameters, this._queryStringTreeElement);
@@ -167,7 +168,7 @@ WebInspector.ResourceHeadersView.prototype = {
 
     _refreshUrlFragment: function()
     {
-        var urlFragment = this._resource.urlFragment;
+        var urlFragment = this._request.urlFragment;
         this._urlFragmentTreeElement.hidden = !urlFragment;
 
         if (!urlFragment)
@@ -190,11 +191,11 @@ WebInspector.ResourceHeadersView.prototype = {
         this._formDataTreeElement.hidden = true;
         this._requestPayloadTreeElement.hidden = true;
 
-        var formData = this._resource.requestFormData;
+        var formData = this._request.requestFormData;
         if (!formData)
             return;
 
-        var formParameters = this._resource.formParameters;
+        var formParameters = this._request.formParameters;
         if (formParameters) {
             this._formDataTreeElement.hidden = false;
             this._refreshParms(WebInspector.UIString("Form Data"), formParameters, this._formDataTreeElement);
@@ -267,14 +268,14 @@ WebInspector.ResourceHeadersView.prototype = {
     _refreshRequestHeaders: function()
     {
         var additionalRow = null;
-        if (typeof this._resource.webSocketRequestKey3 !== "undefined")
-            additionalRow = {header: "(Key3)", value: this._resource.webSocketRequestKey3};
+        if (typeof this._request.webSocketRequestKey3 !== "undefined")
+            additionalRow = {header: "(Key3)", value: this._request.webSocketRequestKey3};
         if (this._showRequestHeadersText)
-            this._refreshHeadersText(WebInspector.UIString("Request Headers"), this._resource.sortedRequestHeaders, this._resource.requestHeadersText, this._requestHeadersTreeElement);
+            this._refreshHeadersText(WebInspector.UIString("Request Headers"), this._request.sortedRequestHeaders, this._request.requestHeadersText, this._requestHeadersTreeElement);
         else
-            this._refreshHeaders(WebInspector.UIString("Request Headers"), this._resource.sortedRequestHeaders, additionalRow, this._requestHeadersTreeElement);
+            this._refreshHeaders(WebInspector.UIString("Request Headers"), this._request.sortedRequestHeaders, additionalRow, this._requestHeadersTreeElement);
 
-        if (this._resource.requestHeadersText) {
+        if (this._request.requestHeadersText) {
             var toggleButton = this._createHeadersToggleButton(this._showRequestHeadersText);
             toggleButton.addEventListener("click", this._toggleRequestHeadersText.bind(this));
             this._requestHeadersTreeElement.listItemElement.appendChild(toggleButton);
@@ -286,14 +287,14 @@ WebInspector.ResourceHeadersView.prototype = {
     _refreshResponseHeaders: function()
     {
         var additionalRow = null;
-        if (typeof this._resource.webSocketChallengeResponse !== "undefined")
-            additionalRow = {header: "(Challenge Response)", value: this._resource.webSocketChallengeResponse};
+        if (typeof this._request.webSocketChallengeResponse !== "undefined")
+            additionalRow = {header: "(Challenge Response)", value: this._request.webSocketChallengeResponse};
         if (this._showResponseHeadersText)
-            this._refreshHeadersText(WebInspector.UIString("Response Headers"), this._resource.sortedResponseHeaders, this._resource.responseHeadersText, this._responseHeadersTreeElement);
+            this._refreshHeadersText(WebInspector.UIString("Response Headers"), this._request.sortedResponseHeaders, this._request.responseHeadersText, this._responseHeadersTreeElement);
         else
-            this._refreshHeaders(WebInspector.UIString("Response Headers"), this._resource.sortedResponseHeaders, additionalRow, this._responseHeadersTreeElement);
+            this._refreshHeaders(WebInspector.UIString("Response Headers"), this._request.sortedResponseHeaders, additionalRow, this._responseHeadersTreeElement);
 
-        if (this._resource.responseHeadersText) {
+        if (this._request.responseHeadersText) {
             var toggleButton = this._createHeadersToggleButton(this._showResponseHeadersText);
             toggleButton.addEventListener("click", this._toggleResponseHeadersText.bind(this));
             this._responseHeadersTreeElement.listItemElement.appendChild(toggleButton);
@@ -303,30 +304,30 @@ WebInspector.ResourceHeadersView.prototype = {
     _refreshHTTPInformation: function()
     {
         var requestMethodElement = this._requestMethodTreeElement;
-        requestMethodElement.hidden = !this._resource.statusCode;
+        requestMethodElement.hidden = !this._request.statusCode;
         var statusCodeElement = this._statusCodeTreeElement;
-        statusCodeElement.hidden = !this._resource.statusCode;
+        statusCodeElement.hidden = !this._request.statusCode;
 
-        if (this._resource.statusCode) {
+        if (this._request.statusCode) {
             var statusImageSource = "";
-            if (this._resource.statusCode < 300 || this._resource.statusCode === 304)
+            if (this._request.statusCode < 300 || this._request.statusCode === 304)
                 statusImageSource = "Images/successGreenDot.png";
-            else if (this._resource.statusCode < 400)
+            else if (this._request.statusCode < 400)
                 statusImageSource = "Images/warningOrangeDot.png";
             else
                 statusImageSource = "Images/errorRedDot.png";
 
-            requestMethodElement.title = this._formatHeader(WebInspector.UIString("Request Method"), this._resource.requestMethod);
+            requestMethodElement.title = this._formatHeader(WebInspector.UIString("Request Method"), this._request.requestMethod);
 
             var statusCodeFragment = document.createDocumentFragment();
             statusCodeFragment.createChild("div", "header-name").textContent = WebInspector.UIString("Status Code") + ":";
 
             var statusCodeImage = statusCodeFragment.createChild("img", "resource-status-image");
             statusCodeImage.src = statusImageSource;
-            statusCodeImage.title = this._resource.statusCode + " " + this._resource.statusText;
+            statusCodeImage.title = this._request.statusCode + " " + this._request.statusText;
             var value = statusCodeFragment.createChild("div", "header-value source-code");
-            value.textContent = this._resource.statusCode + " " + this._resource.statusText;
-            if (this._resource.cached)
+            value.textContent = this._request.statusCode + " " + this._request.statusText;
+            if (this._request.cached)
                 value.createChild("span", "status-from-cache").textContent = " " + WebInspector.UIString("(from cache)");
 
             statusCodeElement.title = statusCodeFragment;
index 7379366..c567212 100644 (file)
@@ -85,11 +85,15 @@ WebInspector.ResourceScriptMapping.prototype = {
      */
     addScript: function(script)
     {
-        var resource = null;
+        var request = null;
         var isInlineScript = false;
         if (script.isInlineScript()) {
-            resource = WebInspector.networkManager.inflightResourceForURL(script.sourceURL) || WebInspector.resourceForURL(script.sourceURL);
-            if (resource && resource.type === WebInspector.resourceTypes.Document) {
+            request = WebInspector.networkManager.inflightRequestForURL(script.sourceURL);
+            if (!request) {
+                var resource = WebInspector.resourceForURL(script.sourceURL);
+                request = resource ? resource.request : null;
+            }
+            if (request && request.type === WebInspector.resourceTypes.Document) {
                 isInlineScript = true;
                 var rawSourceCode = this._rawSourceCodeForDocumentURL[script.sourceURL];
                 if (rawSourceCode) {
@@ -100,7 +104,7 @@ WebInspector.ResourceScriptMapping.prototype = {
             }
         }
 
-        var rawSourceCode = new WebInspector.RawSourceCode(script.scriptId, script, resource, this._formatter, this._formatSource);
+        var rawSourceCode = new WebInspector.RawSourceCode(script.scriptId, script, request, this._formatter, this._formatSource);
         this._rawSourceCodes.push(rawSourceCode);
         this._bindScriptToRawSourceCode(script, rawSourceCode);
 
index f1c86d1..00caa96 100644 (file)
  */
 
 /**
- * @extends {WebInspector.View}
  * @constructor
+ * @extends {WebInspector.View}
+ * @param {WebInspector.NetworkRequest} request
  */
-WebInspector.ResourceTimingView = function(resource)
+WebInspector.ResourceTimingView = function(request)
 {
     WebInspector.View.call(this);
     this.element.addStyleClass("resource-timing-view");
 
-    this._resource = resource;
+    this._request = request;
 
-    resource.addEventListener("timing changed", this._refresh, this);
+    request.addEventListener(WebInspector.NetworkRequest.Events.TimingChanged, this._refresh, this);
 }
 
 WebInspector.ResourceTimingView.prototype = {
     wasShown: function()
     {
-        if (!this._resource.timing) {
+        if (!this._request.timing) {
             if (!this._emptyView) {
                 this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This request has no detailed timing info."));
                 this._emptyView.show(this.element);
@@ -67,12 +68,12 @@ WebInspector.ResourceTimingView.prototype = {
         if (this._tableElement)
             this._tableElement.parentElement.removeChild(this._tableElement);
 
-        this._tableElement = WebInspector.ResourceTimingView.createTimingTable(this._resource);
+        this._tableElement = WebInspector.ResourceTimingView.createTimingTable(this._request);
         this.element.appendChild(this._tableElement);
     }
 }
 
-WebInspector.ResourceTimingView.createTimingTable = function(resource)
+WebInspector.ResourceTimingView.createTimingTable = function(request)
 {
     var tableElement = document.createElement("table");
     var rows = [];
@@ -87,37 +88,37 @@ WebInspector.ResourceTimingView.createTimingTable = function(resource)
         rows.push(row);
     }
 
-    if (resource.timing.proxyStart !== -1)
-        addRow(WebInspector.UIString("Proxy"), "proxy", resource.timing.proxyStart, resource.timing.proxyEnd);
+    if (request.timing.proxyStart !== -1)
+        addRow(WebInspector.UIString("Proxy"), "proxy", request.timing.proxyStart, request.timing.proxyEnd);
 
-    if (resource.timing.dnsStart !== -1)
-        addRow(WebInspector.UIString("DNS Lookup"), "dns", resource.timing.dnsStart, resource.timing.dnsEnd);
+    if (request.timing.dnsStart !== -1)
+        addRow(WebInspector.UIString("DNS Lookup"), "dns", request.timing.dnsStart, request.timing.dnsEnd);
 
-    if (resource.timing.connectStart !== -1) {
-        if (resource.connectionReused)
-            addRow(WebInspector.UIString("Blocking"), "connecting", resource.timing.connectStart, resource.timing.connectEnd);
+    if (request.timing.connectStart !== -1) {
+        if (request.connectionReused)
+            addRow(WebInspector.UIString("Blocking"), "connecting", request.timing.connectStart, request.timing.connectEnd);
         else {
-            var connectStart = resource.timing.connectStart;
+            var connectStart = request.timing.connectStart;
             // Connection includes DNS, subtract it here.
-            if (resource.timing.dnsStart !== -1)
-                connectStart += resource.timing.dnsEnd - resource.timing.dnsStart;
-            addRow(WebInspector.UIString("Connecting"), "connecting", connectStart, resource.timing.connectEnd);
+            if (request.timing.dnsStart !== -1)
+                connectStart += request.timing.dnsEnd - request.timing.dnsStart;
+            addRow(WebInspector.UIString("Connecting"), "connecting", connectStart, request.timing.connectEnd);
         }
     }
 
-    if (resource.timing.sslStart !== -1)
-        addRow(WebInspector.UIString("SSL"), "ssl", resource.timing.sslStart, resource.timing.sslEnd);
+    if (request.timing.sslStart !== -1)
+        addRow(WebInspector.UIString("SSL"), "ssl", request.timing.sslStart, request.timing.sslEnd);
 
-    var sendStart = resource.timing.sendStart;
-    if (resource.timing.sslStart !== -1)
-        sendStart += resource.timing.sslEnd - resource.timing.sslStart;
+    var sendStart = request.timing.sendStart;
+    if (request.timing.sslStart !== -1)
+        sendStart += request.timing.sslEnd - request.timing.sslStart;
 
-    addRow(WebInspector.UIString("Sending"), "sending", resource.timing.sendStart, resource.timing.sendEnd);
-    addRow(WebInspector.UIString("Waiting"), "waiting", resource.timing.sendEnd, resource.timing.receiveHeadersEnd);
-    addRow(WebInspector.UIString("Receiving"), "receiving", (resource.responseReceivedTime - resource.timing.requestTime) * 1000, (resource.endTime - resource.timing.requestTime) * 1000);
+    addRow(WebInspector.UIString("Sending"), "sending", request.timing.sendStart, request.timing.sendEnd);
+    addRow(WebInspector.UIString("Waiting"), "waiting", request.timing.sendEnd, request.timing.receiveHeadersEnd);
+    addRow(WebInspector.UIString("Receiving"), "receiving", (request.responseReceivedTime - request.timing.requestTime) * 1000, (request.endTime - request.timing.requestTime) * 1000);
 
     const chartWidth = 200;
-    var total = (resource.endTime - resource.timing.requestTime) * 1000;
+    var total = (request.endTime - request.timing.requestTime) * 1000;
     var scale = chartWidth / total;
 
     for (var i = 0; i < rows.length; ++i) {
index 6de6e23..7d48421 100644 (file)
@@ -36,9 +36,9 @@
 WebInspector.ResourceTreeModel = function(networkManager)
 {
     networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceTrackingEnabled, this._onResourceTrackingEnabled, this);
-    networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceUpdated, this._onResourceUpdated, this);
-    networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, this._onResourceUpdated, this);
-    networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceUpdateDropped, this._onResourceUpdateDropped, this);
+    networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestUpdated, this._onRequestUpdated, this);
+    networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, this._onRequestUpdated, this);
+    networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestUpdateDropped, this._onRequestUpdateDropped, this);
 
     WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._consoleMessageAdded, this);
     WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.RepeatCountUpdated, this._consoleMessageAdded, this);
@@ -163,7 +163,7 @@ WebInspector.ResourceTreeModel.prototype = {
      */
     _frontendReused: function(framePayload)
     {
-        if (!framePayload.parentId && !WebInspector.networkLog.resources.length) {
+        if (!framePayload.parentId && !WebInspector.networkLog.requests.length) {
             // We are navigating main frame to the existing loaded backend (no provisioual loaded resources are there). 
             this._fetchResourceTree();
             return true;
@@ -193,26 +193,26 @@ WebInspector.ResourceTreeModel.prototype = {
     /**
      * @param {WebInspector.Event} event
      */
-    _onResourceUpdated: function(event)
+    _onRequestUpdated: function(event)
     {
         if (!this._cachedResourcesProcessed)
             return;
 
-        var resource = /** @type {WebInspector.Resource} */ event.data;
-        this._addPendingConsoleMessagesToResource(resource);
-
-        if (resource.failed || resource.type === WebInspector.resourceTypes.XHR)
+        var request = /** @type {WebInspector.NetworkRequest} */ event.data;
+        if (request.failed || request.type === WebInspector.resourceTypes.XHR)
             return;
 
-        var frame = this._frames[resource.frameId];
-        if (frame)
-            frame._addResource(resource);
+        var frame = this._frames[request.frameId];
+        if (frame) {
+            var resource = frame._addRequest(request);
+            this._addPendingConsoleMessagesToResource(resource);
+        }
     },
 
     /**
      * @param {WebInspector.Event} event
      */
-    _onResourceUpdateDropped: function(event)
+    _onRequestUpdateDropped: function(event)
     {
         if (!this._cachedResourcesProcessed)
             return;
@@ -385,7 +385,7 @@ WebInspector.ResourceTreeModel.prototype = {
      */
     _createResource: function(url, documentURL, frameId, loaderId)
     {
-        var resource = new WebInspector.Resource("", url, frameId, loaderId);
+        var resource = new WebInspector.Resource(null, url, frameId, loaderId);
         resource.documentURL = documentURL;
         return resource;
     }
@@ -402,7 +402,7 @@ WebInspector.ResourceTreeModel.prototype.__proto__ = WebInspector.Object.prototy
 WebInspector.ResourceTreeFrame = function(model, parentFrame, payload)
 {
     this._model = model;
-    this._parentFrame = parentFrame; 
+    this._parentFrame = parentFrame;
 
     this._id = payload.id;
     this._loaderId = payload.loaderId;
@@ -553,6 +553,23 @@ WebInspector.ResourceTreeFrame.prototype = {
     },
 
     /**
+     * @param {WebInspector.NetworkRequest} request
+     * @return {WebInspector.Resource}
+     */
+    _addRequest: function(request)
+    {
+        var resource = this._resourcesMap[request.url];
+        if (resource && resource.request === request) {
+            // Already in the tree, we just got an extra update.
+            return resource;
+        }
+        resource = new WebInspector.Resource(request, request.url, request.frameId, request.loaderId);
+        this._resourcesMap[resource.url] = resource;
+        this._model.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.ResourceAdded, resource);
+        return resource;
+    },
+
+    /**
      * @return {Array.<WebInspector.Resource>}
      */
     resources: function()
index 3364244..f820b0c 100644 (file)
@@ -211,7 +211,7 @@ WebInspector.linkifyResourceAsNode = function(url, lineNumber, classes, tooltipT
 }
 
 /**
- * @param {WebInspector.Resource} request
+ * @param {WebInspector.NetworkRequest} request
  * @param {string=} classes
  * @return {Element}
  */
index fff7785..b13f43d 100644 (file)
@@ -1260,10 +1260,10 @@ WebInspector.FrameResourceTreeElement.prototype = {
 
     _appendOpenInNetworkPanelAction: function(contextMenu, event)
     {
-        if (!this._resource.requestId)
+        if (!this._resource.request)
             return;
 
-        contextMenu.appendItem(WebInspector.openInNetworkPanelLabel(), WebInspector.openRequestInNetworkPanel.bind(WebInspector, this._resource));
+        contextMenu.appendItem(WebInspector.openInNetworkPanelLabel(), WebInspector.openRequestInNetworkPanel.bind(WebInspector, this._resource.request));
     },
 
     _appendSaveAsAction: function(contextMenu, event)
index aa2ab13..364b0b2 100644 (file)
@@ -85,6 +85,7 @@
     <file>NetworkLog.js</file>
     <file>NetworkManager.js</file>
     <file>NetworkPanel.js</file>
+    <file>NetworkRequest.js</file>
     <file>Object.js</file>
     <file>ObjectPopoverHelper.js</file>
     <file>ObjectPropertiesSection.js</file>
index 9270c1e..45f325d 100644 (file)
@@ -86,12 +86,12 @@ var WebInspector = {}
 
 /**
  * @param {NetworkAgent.RequestId} requestId
- * @return {?WebInspector.Resource}
+ * @return {?WebInspector.NetworkRequest}
  */
-WebInspector.networkResourceById = function(requestId)
+WebInspector.networkRequestById = function(requestId)
 {
 }
-
+  
 WebInspector.panels = {};
 
 /**
@@ -116,6 +116,7 @@ WebInspector.addMainEventListeners = function(doc) {}
 
 WebInspector.openResource = function(url, external) {}
 
+/** @param {WebInspector.NetworkRequest} request */
 WebInspector.openRequestInNetworkPanel = function(request) {}
 
 WebInspector.populateResourceContextMenu = function(contextMenu, url, preferredLineNumber) {}
index 1f96671..2bf29eb 100644 (file)
@@ -65,6 +65,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="AdvancedSearchController.js"></script>
     <script type="text/javascript" src="TimelineGrid.js"></script>    
     <script type="text/javascript" src="Resource.js"></script>
+    <script type="text/javascript" src="NetworkRequest.js"></script>
     <script type="text/javascript" src="CSSStyleModel.js"></script>
     <script type="text/javascript" src="NetworkManager.js"></script>
     <script type="text/javascript" src="NetworkLog.js"></script>
index 429b859..4231e4c 100644 (file)
@@ -283,9 +283,13 @@ var WebInspector = {
             errorWarningElement.title = null;
     },
 
-    networkResourceById: function(id)
+    /**
+     * @param {NetworkAgent.RequestId} requestId
+     * @return {?WebInspector.NetworkRequest}
+     */
+    networkRequestById: function(requestId)
     {
-        return this.panels.network.resourceById(id);
+        return this.panels.network.requestById(requestId);
     },
 
     get inspectedPageDomain()
@@ -648,10 +652,10 @@ WebInspector.openResource = function(resourceURL, inResourcesPanel)
         InspectorFrontendHost.openInNewTab(resourceURL);
 }
 
-WebInspector.openRequestInNetworkPanel = function(resource)
+WebInspector.openRequestInNetworkPanel = function(request)
 {
     WebInspector.showPanel("network");
-    WebInspector.panels.network.revealAndHighlightResource(resource);
+    WebInspector.panels.network.revealAndHighlightRequest(request);
 }
 
 WebInspector._registerShortcuts = function()
index 9fa8060..0e8ffcc 100644 (file)
@@ -1,3 +1,21 @@
+2012-04-11  Vivek Galatage  <vivekgalatage@gmail.com>
+
+        Web Inspector: Disabling Inspector causes build failure on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=83557
+
+        Reviewed by Pavel Feldman.
+
+        The calls to inspector APIs are not put under ENABLE(INSPECTOR) guard.
+        This change brings all such API calls under the guard.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        (WTR):
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+        (LayoutTestController):
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::invoke):
+
 2012-04-11  No'am Rosenthal  <noam.rosenthal@nokia.com>
 
         [Qt][WK2] Manage graphics buffers in the web process