Web Inspector: Add resource timing model with timing information
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2016 00:27:27 +0000 (00:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2016 00:27:27 +0000 (00:27 +0000)
commit7e33ee88d8ab2838046244646519346b6b6ac434
treeccf7977be50997f108f8d234406b92d2e4a88c70
parent4ad6555e17c21c8ccde298c8e4ca864b8f8f1c20
Web Inspector: Add resource timing model with timing information
https://bugs.webkit.org/show_bug.cgi?id=161314

Patch by Johan K. Jensen <johan_jensen@apple.com> on 2016-08-30
Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

Add a resource timing data model and populate it with info from the
response from the backend.

* UserInterface/Controllers/FrameResourceManager.js:
(WebInspector.FrameResourceManager.prototype.resourceRequestWasServedFromMemoryCache):
(WebInspector.FrameResourceManager.prototype.resourceRequestDidReceiveResponse):
Forward timing data from response to Resource.js.

* UserInterface/Main.html: Add new ResourceTimingData.js.
* UserInterface/Test.html: Add new ResourceTimingData.js.

* UserInterface/Models/Resource.js:
(WebInspector.Resource): Instantiate ResourceTimingData object.

(WebInspector.Resource.prototype.get timing):
(WebInspector.Resource.prototype.get firstTimestamp):
(WebInspector.Resource.prototype.get lastTimestamp):
(WebInspector.Resource.prototype.get duration):
(WebInspector.Resource.prototype.get latency):
(WebInspector.Resource.prototype.get receiveDuration):
Update getters to use new timing model.

(WebInspector.Resource.prototype.updateForResponse):
Update timing object with info from response.

(WebInspector.Resource.prototype.markAsFinished):
Log response end time.

* UserInterface/Models/ResourceTimelineRecord.js:
(WebInspector.ResourceTimelineRecord.prototype.get startTime):
(WebInspector.ResourceTimelineRecord.prototype.get activeStartTime):
(WebInspector.ResourceTimelineRecord.prototype.get endTime):
Update getters to use new timing model.

* UserInterface/Models/ResourceTimingData.js: Added.
(WebInspector.ResourceTimingData):
(WebInspector.ResourceTimingData.fromPayload):
(WebInspector.ResourceTimingData.prototype.get startTime):
(WebInspector.ResourceTimingData.prototype.get domainLookupStart):
(WebInspector.ResourceTimingData.prototype.get domainLookupEnd):
(WebInspector.ResourceTimingData.prototype.get connectStart):
(WebInspector.ResourceTimingData.prototype.get connectEnd):
(WebInspector.ResourceTimingData.prototype.get secureConnectionStart):
(WebInspector.ResourceTimingData.prototype.get requestStart):
(WebInspector.ResourceTimingData.prototype.get responseStart):
(WebInspector.ResourceTimingData.prototype.get responseEnd):
(WebInspector.ResourceTimingData.prototype.markResponseEndTime):
Add new ResourceTimingData model and fall back on old timestamps
for when data is unavailable.

LayoutTests:

Add tests for the Resource Timing Data model.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/network/resource-timing-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/resource-timing.html [new file with mode: 0644]
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Models/Resource.js
Source/WebInspectorUI/UserInterface/Models/ResourceTimelineRecord.js
Source/WebInspectorUI/UserInterface/Models/ResourceTimingData.js [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Test.html