Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 time: this._request.timing ? WebInspector.HAREntry._toMilliseconds(t his._request.duration) : 0, | 59 time: this._request.timing ? WebInspector.HAREntry._toMilliseconds(t his._request.duration) : 0, |
| 60 request: this._buildRequest(), | 60 request: this._buildRequest(), |
| 61 response: this._buildResponse(), | 61 response: this._buildResponse(), |
| 62 cache: { }, // Not supported yet. | 62 cache: { }, // Not supported yet. |
| 63 timings: this._buildTimings(), | 63 timings: this._buildTimings(), |
| 64 serverIPAddress: ipAddress | 64 serverIPAddress: ipAddress |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 if (this._request.connectionId !== "0") | 67 if (this._request.connectionId !== "0") |
| 68 entry.connection = this._request.connectionId; | 68 entry.connection = this._request.connectionId; |
| 69 var page = this._request.target().networkLog.pageLoadForRequest(this._re quest); | 69 var networkLog = WebInspector.NetworkLog.fromTarget(this._request.target ()); |
| 70 var page = networkLog && networkLog.pageLoadForRequest(this._request); | |
|
dgozman
2016/06/29 18:37:57
I think we should have |this.networkLog()| in Netw
eostroukhov-old
2016/06/29 22:54:20
target() is inherited by NetworkRequest from the W
| |
| 70 if (page) | 71 if (page) |
| 71 entry.pageref = "page_" + page.id; | 72 entry.pageref = "page_" + page.id; |
| 72 return entry; | 73 return entry; |
| 73 }, | 74 }, |
| 74 | 75 |
| 75 /** | 76 /** |
| 76 * @return {!Object} | 77 * @return {!Object} |
| 77 */ | 78 */ |
| 78 _buildRequest: function() | 79 _buildRequest: function() |
| 79 { | 80 { |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 | 322 |
| 322 /** | 323 /** |
| 323 * @return {!Array.<!Object>} | 324 * @return {!Array.<!Object>} |
| 324 */ | 325 */ |
| 325 _buildPages: function() | 326 _buildPages: function() |
| 326 { | 327 { |
| 327 var seenIdentifiers = {}; | 328 var seenIdentifiers = {}; |
| 328 var pages = []; | 329 var pages = []; |
| 329 for (var i = 0; i < this._requests.length; ++i) { | 330 for (var i = 0; i < this._requests.length; ++i) { |
| 330 var request = this._requests[i]; | 331 var request = this._requests[i]; |
| 331 var page = request.target().networkLog.pageLoadForRequest(request); | 332 var networkLog = WebInspector.NetworkLog.fromTarget(request.target() ); |
| 333 var page = networkLog && networkLog.pageLoadForRequest(request); | |
| 332 if (!page || seenIdentifiers[page.id]) | 334 if (!page || seenIdentifiers[page.id]) |
| 333 continue; | 335 continue; |
| 334 seenIdentifiers[page.id] = true; | 336 seenIdentifiers[page.id] = true; |
| 335 pages.push(this._convertPage(page, request)); | 337 pages.push(this._convertPage(page, request)); |
| 336 } | 338 } |
| 337 return pages; | 339 return pages; |
| 338 }, | 340 }, |
| 339 | 341 |
| 340 /** | 342 /** |
| 341 * @param {!WebInspector.PageLoad} page | 343 * @param {!WebInspector.PageLoad} page |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 370 * @return {number} | 372 * @return {number} |
| 371 */ | 373 */ |
| 372 _pageEventTime: function(page, time) | 374 _pageEventTime: function(page, time) |
| 373 { | 375 { |
| 374 var startTime = page.startTime; | 376 var startTime = page.startTime; |
| 375 if (time === -1 || startTime === -1) | 377 if (time === -1 || startTime === -1) |
| 376 return -1; | 378 return -1; |
| 377 return WebInspector.HAREntry._toMilliseconds(time - startTime); | 379 return WebInspector.HAREntry._toMilliseconds(time - startTime); |
| 378 } | 380 } |
| 379 } | 381 } |
| OLD | NEW |