| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @unrestricted | 32 * @unrestricted |
| 33 */ | 33 */ |
| 34 SDK.NetworkLog = class extends SDK.SDKModel { | 34 SDK.NetworkLog = class extends SDK.SDKModel { |
| 35 /** | 35 /** |
| 36 * @param {!SDK.Target} target | 36 * @param {!SDK.Target} target |
| 37 * @param {!SDK.ResourceTreeModel} resourceTreeModel | 37 * @param {?SDK.ResourceTreeModel} resourceTreeModel |
| 38 * @param {!SDK.NetworkManager} networkManager | 38 * @param {!SDK.NetworkManager} networkManager |
| 39 */ | 39 */ |
| 40 constructor(target, resourceTreeModel, networkManager) { | 40 constructor(target, resourceTreeModel, networkManager) { |
| 41 super(SDK.NetworkLog, target); | 41 super(SDK.NetworkLog, target); |
| 42 | 42 |
| 43 this._requests = []; | 43 this._requests = []; |
| 44 this._requestForId = {}; | 44 this._requestForId = {}; |
| 45 networkManager.addEventListener(SDK.NetworkManager.Events.RequestStarted, th
is._onRequestStarted, this); | 45 networkManager.addEventListener(SDK.NetworkManager.Events.RequestStarted, th
is._onRequestStarted, this); |
| 46 resourceTreeModel.addEventListener( | 46 if (resourceTreeModel) { |
| 47 SDK.ResourceTreeModel.Events.MainFrameNavigated, this._onMainFrameNaviga
ted, this); | 47 resourceTreeModel.addEventListener( |
| 48 resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.Load, this._
onLoad, this); | 48 SDK.ResourceTreeModel.Events.MainFrameNavigated, this._onMainFrameNavi
gated, this); |
| 49 resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.DOMContentLo
aded, this._onDOMContentLoaded, this); | 49 resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.Load, this
._onLoad, this); |
| 50 resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.DOMContent
Loaded, this._onDOMContentLoaded, this); |
| 51 } |
| 50 } | 52 } |
| 51 | 53 |
| 52 /** | 54 /** |
| 53 * @param {!SDK.Target} target | 55 * @param {!SDK.Target} target |
| 54 * @return {?SDK.NetworkLog} | 56 * @return {?SDK.NetworkLog} |
| 55 */ | 57 */ |
| 56 static fromTarget(target) { | 58 static fromTarget(target) { |
| 57 return /** @type {?SDK.NetworkLog} */ (target.model(SDK.NetworkLog)); | 59 return /** @type {?SDK.NetworkLog} */ (target.model(SDK.NetworkLog)); |
| 58 } | 60 } |
| 59 | 61 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 * @param {!SDK.NetworkRequest} mainRequest | 178 * @param {!SDK.NetworkRequest} mainRequest |
| 177 */ | 179 */ |
| 178 constructor(mainRequest) { | 180 constructor(mainRequest) { |
| 179 this.id = ++SDK.PageLoad._lastIdentifier; | 181 this.id = ++SDK.PageLoad._lastIdentifier; |
| 180 this.url = mainRequest.url; | 182 this.url = mainRequest.url; |
| 181 this.startTime = mainRequest.startTime; | 183 this.startTime = mainRequest.startTime; |
| 182 } | 184 } |
| 183 }; | 185 }; |
| 184 | 186 |
| 185 SDK.PageLoad._lastIdentifier = 0; | 187 SDK.PageLoad._lastIdentifier = 0; |
| OLD | NEW |