| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 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 * @param {!WebInspector.TargetManager} targetManager | 33 * @param {!WebInspector.TargetManager} targetManager |
| 34 * @param {!WebInspector.Workspace} workspace | 34 * @param {!WebInspector.Workspace} workspace |
| 35 * @param {!WebInspector.NetworkMapping} networkMapping | |
| 36 * @implements {WebInspector.TargetManager.Observer} | 35 * @implements {WebInspector.TargetManager.Observer} |
| 37 */ | 36 */ |
| 38 WebInspector.NetworkProjectManager = function(targetManager, workspace, networkM
apping) | 37 WebInspector.NetworkProjectManager = function(targetManager, workspace) |
| 39 { | 38 { |
| 40 this._workspace = workspace; | 39 this._workspace = workspace; |
| 41 this._networkMapping = networkMapping; | |
| 42 targetManager.observeTargets(this); | 40 targetManager.observeTargets(this); |
| 43 } | 41 } |
| 44 | 42 |
| 45 WebInspector.NetworkProjectManager.prototype = { | 43 WebInspector.NetworkProjectManager.prototype = { |
| 46 /** | 44 /** |
| 47 * @override | 45 * @override |
| 48 * @param {!WebInspector.Target} target | 46 * @param {!WebInspector.Target} target |
| 49 */ | 47 */ |
| 50 targetAdded: function(target) | 48 targetAdded: function(target) |
| 51 { | 49 { |
| 52 new WebInspector.NetworkProject(target, this._workspace, this._networkMa
pping, WebInspector.ResourceTreeModel.fromTarget(target)); | 50 new WebInspector.NetworkProject(target, this._workspace, WebInspector.Re
sourceTreeModel.fromTarget(target)); |
| 53 }, | 51 }, |
| 54 | 52 |
| 55 /** | 53 /** |
| 56 * @override | 54 * @override |
| 57 * @param {!WebInspector.Target} target | 55 * @param {!WebInspector.Target} target |
| 58 */ | 56 */ |
| 59 targetRemoved: function(target) | 57 targetRemoved: function(target) |
| 60 { | 58 { |
| 61 WebInspector.NetworkProject.forTarget(target)._dispose(); | 59 WebInspector.NetworkProject.forTarget(target)._dispose(); |
| 62 } | 60 } |
| 63 } | 61 } |
| 64 | 62 |
| 65 /** | 63 /** |
| 66 * @constructor | 64 * @constructor |
| 67 * @extends {WebInspector.SDKObject} | 65 * @extends {WebInspector.SDKObject} |
| 68 * @param {!WebInspector.Target} target | 66 * @param {!WebInspector.Target} target |
| 69 * @param {!WebInspector.Workspace} workspace | 67 * @param {!WebInspector.Workspace} workspace |
| 70 * @param {!WebInspector.NetworkMapping} networkMapping | |
| 71 * @param {?WebInspector.ResourceTreeModel} resourceTreeModel | 68 * @param {?WebInspector.ResourceTreeModel} resourceTreeModel |
| 72 */ | 69 */ |
| 73 WebInspector.NetworkProject = function(target, workspace, networkMapping, resour
ceTreeModel) | 70 WebInspector.NetworkProject = function(target, workspace, resourceTreeModel) |
| 74 { | 71 { |
| 75 WebInspector.SDKObject.call(this, target); | 72 WebInspector.SDKObject.call(this, target); |
| 76 this._workspace = workspace; | 73 this._workspace = workspace; |
| 77 this._networkMapping = networkMapping; | |
| 78 /** @type {!Map<string, !WebInspector.ContentProviderBasedProject>} */ | 74 /** @type {!Map<string, !WebInspector.ContentProviderBasedProject>} */ |
| 79 this._workspaceProjects = new Map(); | 75 this._workspaceProjects = new Map(); |
| 80 this._resourceTreeModel = resourceTreeModel; | 76 this._resourceTreeModel = resourceTreeModel; |
| 81 target[WebInspector.NetworkProject._networkProjectSymbol] = this; | 77 target[WebInspector.NetworkProject._networkProjectSymbol] = this; |
| 82 | 78 |
| 83 this._eventListeners = []; | 79 this._eventListeners = []; |
| 84 | 80 |
| 85 if (resourceTreeModel) { | 81 if (resourceTreeModel) { |
| 86 this._eventListeners.push( | 82 this._eventListeners.push( |
| 87 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Ev
ents.ResourceAdded, this._resourceAdded, this), | 83 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Ev
ents.ResourceAdded, this._resourceAdded, this), |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 391 |
| 396 _reset: function() | 392 _reset: function() |
| 397 { | 393 { |
| 398 for (var project of this._workspaceProjects.values()) | 394 for (var project of this._workspaceProjects.values()) |
| 399 project.removeProject(); | 395 project.removeProject(); |
| 400 this._workspaceProjects.clear(); | 396 this._workspaceProjects.clear(); |
| 401 }, | 397 }, |
| 402 | 398 |
| 403 __proto__: WebInspector.SDKObject.prototype | 399 __proto__: WebInspector.SDKObject.prototype |
| 404 } | 400 } |
| OLD | NEW |