Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 // Preserve requests from the new session. | 119 // Preserve requests from the new session. |
| 120 this._currentPageLoad = null; | 120 this._currentPageLoad = null; |
| 121 var oldRequests = this._requests.splice(0, this._requests.length); | 121 var oldRequests = this._requests.splice(0, this._requests.length); |
| 122 this._requestForId = {}; | 122 this._requestForId = {}; |
| 123 for (var i = 0; i < oldRequests.length; ++i) { | 123 for (var i = 0; i < oldRequests.length; ++i) { |
| 124 var request = oldRequests[i]; | 124 var request = oldRequests[i]; |
| 125 if (request.loaderId === mainFrame.loaderId) { | 125 if (request.loaderId === mainFrame.loaderId) { |
| 126 if (!this._currentPageLoad) | 126 if (!this._currentPageLoad) |
| 127 this._currentPageLoad = new SDK.PageLoad(request); | 127 this._currentPageLoad = new SDK.PageLoad(request); |
| 128 this._requests.push(request); | 128 this._requests.push(request); |
| 129 this._requestForId[request.requestId] = request; | 129 this._requestForId[request.requestId] = request; |
|
luoe
2017/01/09 20:23:00
Should this use the getter "this._requestForId[req
dgozman
2017/01/09 21:43:34
+1
| |
| 130 request.__page = this._currentPageLoad; | 130 request.__page = this._currentPageLoad; |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 /** | 135 /** |
| 136 * @param {!Common.Event} event | 136 * @param {!Common.Event} event |
| 137 */ | 137 */ |
| 138 _onRequestStarted(event) { | 138 _onRequestStarted(event) { |
| 139 var request = /** @type {!SDK.NetworkRequest} */ (event.data); | 139 var request = /** @type {!SDK.NetworkRequest} */ (event.data); |
| 140 this._requests.push(request); | 140 this._requests.push(request); |
| 141 this._requestForId[request.requestId] = request; | 141 this._requestForId[request.requestId()] = request; |
| 142 request.__page = this._currentPageLoad; | 142 request.__page = this._currentPageLoad; |
| 143 } | 143 } |
| 144 | 144 |
| 145 /** | 145 /** |
| 146 * @param {!Common.Event} event | 146 * @param {!Common.Event} event |
| 147 */ | 147 */ |
| 148 _onDOMContentLoaded(event) { | 148 _onDOMContentLoaded(event) { |
| 149 if (this._currentPageLoad) | 149 if (this._currentPageLoad) |
| 150 this._currentPageLoad.contentLoadTime = event.data; | 150 this._currentPageLoad.contentLoadTime = event.data; |
| 151 } | 151 } |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 176 * @param {!SDK.NetworkRequest} mainRequest | 176 * @param {!SDK.NetworkRequest} mainRequest |
| 177 */ | 177 */ |
| 178 constructor(mainRequest) { | 178 constructor(mainRequest) { |
| 179 this.id = ++SDK.PageLoad._lastIdentifier; | 179 this.id = ++SDK.PageLoad._lastIdentifier; |
| 180 this.url = mainRequest.url; | 180 this.url = mainRequest.url; |
| 181 this.startTime = mainRequest.startTime; | 181 this.startTime = mainRequest.startTime; |
| 182 } | 182 } |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 SDK.PageLoad._lastIdentifier = 0; | 185 SDK.PageLoad._lastIdentifier = 0; |
| OLD | NEW |