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 15 matching lines...) Expand all Loading... | |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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 * @constructor | 32 * @constructor |
| 33 * @extends {WebInspector.SDKModel} | 33 * @extends {WebInspector.SDKModel} |
| 34 * @param {!WebInspector.Target} target | 34 * @param {!WebInspector.Target} target |
| 35 * @param {!WebInspector.NetworkManager} networkManager | 35 * @param {!WebInspector.NetworkManager} networkManager |
| 36 * @param {?WebInspector.ResourceTreeModel} resourceTreeModel | |
| 36 */ | 37 */ |
| 37 WebInspector.NetworkLog = function(target, networkManager) | 38 WebInspector.NetworkLog = function(target, networkManager, resourceTreeModel) |
| 38 { | 39 { |
| 39 WebInspector.SDKModel.call(this, WebInspector.NetworkLog, target); | 40 WebInspector.SDKModel.call(this, WebInspector.NetworkLog, target); |
| 40 | 41 |
| 41 this._requests = []; | 42 this._requests = []; |
| 42 this._requestForId = {}; | 43 this._requestForId = {}; |
| 43 networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.Reque stStarted, this._onRequestStarted, this); | 44 networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.Reque stStarted, this._onRequestStarted, this); |
| 44 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.MainFrameNavigated, this._onMainFrameNavigated, this); | 45 if (resourceTreeModel) { |
|
dgozman
2016/07/14 16:29:29
This dependency looks strange. Can we eliminate it
eostroukhov-old
2016/07/20 23:46:15
NetworkLog is currently considered a browser-only
| |
| 45 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.Load, this._onLoad, this); | 46 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventT ypes.MainFrameNavigated, this._onMainFrameNavigated, this); |
| 46 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.DOMContentLoaded, this._onDOMContentLoaded, this); | 47 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventT ypes.Load, this._onLoad, this); |
| 48 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventT ypes.DOMContentLoaded, this._onDOMContentLoaded, this); | |
| 49 } | |
| 47 } | 50 } |
| 48 | 51 |
| 49 /** | 52 /** |
| 50 * @param {!WebInspector.Target} target | 53 * @param {!WebInspector.Target} target |
| 51 * @return {?WebInspector.NetworkLog} | 54 * @return {?WebInspector.NetworkLog} |
| 52 */ | 55 */ |
| 53 WebInspector.NetworkLog.fromTarget = function(target) | 56 WebInspector.NetworkLog.fromTarget = function(target) |
| 54 { | 57 { |
| 55 return /** @type {?WebInspector.NetworkLog} */ (target.model(WebInspector.Ne tworkLog)); | 58 return /** @type {?WebInspector.NetworkLog} */ (target.model(WebInspector.Ne tworkLog)); |
| 56 } | 59 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 * @param {!WebInspector.NetworkRequest} mainRequest | 186 * @param {!WebInspector.NetworkRequest} mainRequest |
| 184 */ | 187 */ |
| 185 WebInspector.PageLoad = function(mainRequest) | 188 WebInspector.PageLoad = function(mainRequest) |
| 186 { | 189 { |
| 187 this.id = ++WebInspector.PageLoad._lastIdentifier; | 190 this.id = ++WebInspector.PageLoad._lastIdentifier; |
| 188 this.url = mainRequest.url; | 191 this.url = mainRequest.url; |
| 189 this.startTime = mainRequest.startTime; | 192 this.startTime = mainRequest.startTime; |
| 190 } | 193 } |
| 191 | 194 |
| 192 WebInspector.PageLoad._lastIdentifier = 0; | 195 WebInspector.PageLoad._lastIdentifier = 0; |
| OLD | NEW |