Changeset 205211 in webkit
- Timestamp:
- Aug 30, 2016 5:27:27 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r205205 r205211 1 2016-08-30 Johan K. Jensen <johan_jensen@apple.com> 2 3 Web Inspector: Add resource timing model with timing information 4 https://bugs.webkit.org/show_bug.cgi?id=161314 5 6 Reviewed by Joseph Pecoraro. 7 8 Add tests for the Resource Timing Data model. 9 10 * http/tests/inspector/network/resource-timing-expected.txt: Added. 11 * http/tests/inspector/network/resource-timing.html: Added. 12 1 13 2016-08-30 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WebInspectorUI/ChangeLog
r205192 r205211 1 2016-08-30 Johan K. Jensen <johan_jensen@apple.com> 2 3 Web Inspector: Add resource timing model with timing information 4 https://bugs.webkit.org/show_bug.cgi?id=161314 5 6 Reviewed by Joseph Pecoraro. 7 8 Add a resource timing data model and populate it with info from the 9 response from the backend. 10 11 * UserInterface/Controllers/FrameResourceManager.js: 12 (WebInspector.FrameResourceManager.prototype.resourceRequestWasServedFromMemoryCache): 13 (WebInspector.FrameResourceManager.prototype.resourceRequestDidReceiveResponse): 14 Forward timing data from response to Resource.js. 15 16 * UserInterface/Main.html: Add new ResourceTimingData.js. 17 * UserInterface/Test.html: Add new ResourceTimingData.js. 18 19 * UserInterface/Models/Resource.js: 20 (WebInspector.Resource): Instantiate ResourceTimingData object. 21 22 (WebInspector.Resource.prototype.get timing): 23 (WebInspector.Resource.prototype.get firstTimestamp): 24 (WebInspector.Resource.prototype.get lastTimestamp): 25 (WebInspector.Resource.prototype.get duration): 26 (WebInspector.Resource.prototype.get latency): 27 (WebInspector.Resource.prototype.get receiveDuration): 28 Update getters to use new timing model. 29 30 (WebInspector.Resource.prototype.updateForResponse): 31 Update timing object with info from response. 32 33 (WebInspector.Resource.prototype.markAsFinished): 34 Log response end time. 35 36 * UserInterface/Models/ResourceTimelineRecord.js: 37 (WebInspector.ResourceTimelineRecord.prototype.get startTime): 38 (WebInspector.ResourceTimelineRecord.prototype.get activeStartTime): 39 (WebInspector.ResourceTimelineRecord.prototype.get endTime): 40 Update getters to use new timing model. 41 42 * UserInterface/Models/ResourceTimingData.js: Added. 43 (WebInspector.ResourceTimingData): 44 (WebInspector.ResourceTimingData.fromPayload): 45 (WebInspector.ResourceTimingData.prototype.get startTime): 46 (WebInspector.ResourceTimingData.prototype.get domainLookupStart): 47 (WebInspector.ResourceTimingData.prototype.get domainLookupEnd): 48 (WebInspector.ResourceTimingData.prototype.get connectStart): 49 (WebInspector.ResourceTimingData.prototype.get connectEnd): 50 (WebInspector.ResourceTimingData.prototype.get secureConnectionStart): 51 (WebInspector.ResourceTimingData.prototype.get requestStart): 52 (WebInspector.ResourceTimingData.prototype.get responseStart): 53 (WebInspector.ResourceTimingData.prototype.get responseEnd): 54 (WebInspector.ResourceTimingData.prototype.markResponseEndTime): 55 Add new ResourceTimingData model and fall back on old timestamps 56 for when data is unavailable. 57 1 58 2016-08-30 Alex Christensen <achristensen@webkit.org> 2 59 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js
r186303 r205211 237 237 var resource = this._addNewResourceToFrame(requestIdentifier, frameIdentifier, loaderIdentifier, cachedResourcePayload.url, cachedResourcePayload.type, "GET", null, null, elapsedTime, null, null, initiatorSourceCodeLocation); 238 238 resource.markAsCached(); 239 resource.updateForResponse(cachedResourcePayload.url, response.mimeType, cachedResourcePayload.type, response.headers, response.status, response.statusText, elapsedTime );239 resource.updateForResponse(cachedResourcePayload.url, response.mimeType, cachedResourcePayload.type, response.headers, response.status, response.statusText, elapsedTime, response.timing); 240 240 resource.increaseSize(cachedResourcePayload.bodySize, elapsedTime); 241 241 resource.increaseTransferSize(cachedResourcePayload.bodySize); … … 289 289 resource.markAsCached(); 290 290 291 resource.updateForResponse(response.url, response.mimeType, type, response.headers, response.status, response.statusText, elapsedTime );291 resource.updateForResponse(response.url, response.mimeType, type, response.headers, response.status, response.statusText, elapsedTime, response.timing); 292 292 } 293 293 -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r205151 r205211 358 358 <script src="Models/ResourceQueryResult.js"></script> 359 359 <script src="Models/ResourceTimelineRecord.js"></script> 360 <script src="Models/ResourceTimingData.js"></script> 360 361 <script src="Models/Revision.js"></script> 361 362 <script src="Models/ScopeChainNode.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js
r203132 r205211 60 60 this._transferSize = NaN; 61 61 this._cached = false; 62 this._timingData = new WebInspector.ResourceTimingData(this); 62 63 63 64 if (this._initiatorSourceCodeLocation && this._initiatorSourceCodeLocation.sourceCode instanceof WebInspector.Resource) … … 127 128 // Public 128 129 130 get timingData() { return this._timingData; } 131 129 132 get url() 130 133 { … … 318 321 get firstTimestamp() 319 322 { 320 return this. requestSentTimestamp|| this.lastRedirectReceivedTimestamp || this.responseReceivedTimestamp || this.lastDataReceivedTimestamp || this.finishedOrFailedTimestamp;323 return this.timingData.startTime || this.lastRedirectReceivedTimestamp || this.responseReceivedTimestamp || this.lastDataReceivedTimestamp || this.finishedOrFailedTimestamp; 321 324 } 322 325 323 326 get lastTimestamp() 324 327 { 325 return this. finishedOrFailedTimestamp|| this.lastDataReceivedTimestamp || this.responseReceivedTimestamp || this.lastRedirectReceivedTimestamp || this.requestSentTimestamp;328 return this.timingData.responseEnd || this.lastDataReceivedTimestamp || this.responseReceivedTimestamp || this.lastRedirectReceivedTimestamp || this.requestSentTimestamp; 326 329 } 327 330 328 331 get duration() 329 332 { 330 return this. _finishedOrFailedTimestamp - this._requestSentTimestamp;333 return this.timingData.responseEnd - this.timingData.requestStart; 331 334 } 332 335 333 336 get latency() 334 337 { 335 return this. _responseReceivedTimestamp - this._requestSentTimestamp;338 return this.timingData.responseStart - this.timingData.requestStart; 336 339 } 337 340 338 341 get receiveDuration() 339 342 { 340 return this. _finishedOrFailedTimestamp - this._responseReceivedTimestamp;343 return this.timingData.responseEnd - this.timingData.responseStart; 341 344 } 342 345 … … 448 451 } 449 452 450 updateForResponse(url, mimeType, type, responseHeaders, statusCode, statusText, elapsedTime )453 updateForResponse(url, mimeType, type, responseHeaders, statusCode, statusText, elapsedTime, timingData) 451 454 { 452 455 console.assert(!this._finished); … … 468 471 this._responseHeaders = responseHeaders || {}; 469 472 this._responseReceivedTimestamp = elapsedTime || NaN; 473 this._timingData = WebInspector.ResourceTimingData.fromPayload(timingData, this); 470 474 471 475 this._responseHeadersSize = String(this._statusCode).length + this._statusText.length + 12; // Extra length is for "HTTP/1.1 ", " ", and "\r\n". … … 573 577 this._finished = true; 574 578 this._finishedOrFailedTimestamp = elapsedTime || NaN; 579 this._timingData.markResponseEndTime(elapsedTime || NaN); 575 580 576 581 if (this._finishThenRequestContentPromise) -
trunk/Source/WebInspectorUI/UserInterface/Models/ResourceTimelineRecord.js
r181769 r205211 53 53 get startTime() 54 54 { 55 return this._resource. requestSentTimestamp;55 return this._resource.timingData.startTime; 56 56 } 57 57 58 58 get activeStartTime() 59 59 { 60 return this._resource. responseReceivedTimestamp;60 return this._resource.timingData.responseStart; 61 61 } 62 62 63 63 get endTime() 64 64 { 65 return this._resource. finishedOrFailedTimestamp;65 return this._resource.timingData.responseEnd; 66 66 } 67 67 -
trunk/Source/WebInspectorUI/UserInterface/Test.html
r203254 r205211 148 148 <script src="Models/ResourceQueryResult.js"></script> 149 149 <script src="Models/ResourceTimelineRecord.js"></script> 150 <script src="Models/ResourceTimingData.js"></script> 150 151 <script src="Models/Revision.js"></script> 151 152 <script src="Models/ScopeChainNode.js"></script>
Note: See TracChangeset
for help on using the changeset viewer.