Web Inspector: show redirect requests in Network and Timelines tabs
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Oct 2018 02:49:52 +0000 (02:49 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Oct 2018 02:49:52 +0000 (02:49 +0000)
commit682692e1ef6ea7d9e22293199d7ced7377eb030a
treefeef577f8ab2435570309de24a7d4a24c1a21daf
parent742affa1946c03ef25ddcdb566bcfaf9f5fa6afa
Web Inspector: show redirect requests in Network and Timelines tabs
https://bugs.webkit.org/show_bug.cgi?id=150005
<rdar://problem/5378164>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Network.json:
Add missing fields to `ResourceTiming`.

Source/WebCore:

Updated existing test http/tests/inspector/network/resource-timing.html.

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::didFinishLoading):
Add missing fields for `Network.types.ResourceTiming`.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/Variables.css:
* UserInterface/Main.html:
* UserInterface/Test.html:

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.resourceRequestWillBeSent):

* UserInterface/Models/Resource.js:
(WI.Resource):
(WI.Resource.prototype.get redirects): Added.
(WI.Resource.prototype.get lastRedirectReceivedTimestamp):
(WI.Resource.prototype.updateForRedirectResponse):
Save each redirect in an array instead of just remembering the last timestamp.

* UserInterface/Models/ResourceTimingData.js:
(WI.ResourceTimingData):
(WI.ResourceTimingData.fromPayload.offsetToTimestamp):
(WI.ResourceTimingData.fromPayload):
(WI.ResourceTimingData.prototype.get redirectStart): Added.
(WI.ResourceTimingData.prototype.get redirectEnd): Added.
(WI.ResourceTimingData.prototype.get fetchStart): Added.
Add missing fields for `Network.types.ResourceTiming`.

* UserInterface/Models/Redirect.js: Added.
(WI.Redirect):
(WI.Redirect.prototype.get url):
(WI.Redirect.prototype.get requestMethod):
(WI.Redirect.prototype.get requestHeaders):
(WI.Redirect.prototype.get responseStatusCode):
(WI.Redirect.prototype.get responseStatusText):
(WI.Redirect.prototype.get responseHeaders):
(WI.Redirect.prototype.get timestamp):
(WI.Redirect.prototype.get urlComponents):

* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView):
(WI.ResourceHeadersContentView.prototype.initialLayout):
(WI.ResourceHeadersContentView.prototype.layout):
(WI.ResourceHeadersContentView.prototype._refreshRedirectHeadersSections): Added.
(WI.ResourceHeadersContentView.prototype._resourceRequestHeadersDidChange):
* UserInterface/Views/ResourceHeadersContentView.css:
(body[dir] .resource-headers > section.summary > .details): Added.
(body[dir] .resource-headers > section:matches(.redirect, .headers) > .details): Added.
(.resource-headers .details .key):
(.resource-headers .summary .key):
(body[dir] .resource-headers > section > .details): Deleted.
(body[dir] .resource-headers > section.headers > .details): Deleted.
(.resource-headers .value): Deleted.
Add a request/response header section for each redirect.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._populateWaterfallGraph.appendBlock):
(WI.NetworkTableContentView.prototype._populateWaterfallGraph):
(WI.NetworkTableContentView.prototype._checkURLFilterAgainstResource):
(WI.NetworkTableContentView.prototype._waterfallPopoverContentForResource):
* UserInterface/Views/NetworkTableContentView.css:
(.waterfall .block.redirect): Added.
(.waterfall .block.queue):
* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar):
* UserInterface/Views/ResourceTimingBreakdownView.js:
(WI.ResourceTimingBreakdownView.prototype.initialLayout):
Add timeline/waterfall entries for total redirect time.

LayoutTests:

* http/tests/inspector/network/resource-timing-expected.txt:
* http/tests/inspector/network/resource-timing.html:

* http/tests/inspector/network/resources/delay.php: Added.
* http/tests/inspector/network/resources/redirect.php: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/network/resource-timing-expected.txt
LayoutTests/http/tests/inspector/network/resource-timing.html
LayoutTests/http/tests/inspector/network/resources/delay.php [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/resources/redirect.php [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/protocol/Network.json
Source/WebCore/ChangeLog
Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Models/Redirect.js [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Models/Resource.js
Source/WebInspectorUI/UserInterface/Models/ResourceTimingData.js
Source/WebInspectorUI/UserInterface/Test.html
Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.css
Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.css
Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.js
Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js
Source/WebInspectorUI/UserInterface/Views/ResourceTimingBreakdownView.js
Source/WebInspectorUI/UserInterface/Views/Variables.css