| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @constructor | 8 * @constructor |
| 9 * @extends {Protocol.Agents} | 9 * @extends {Protocol.Agents} |
| 10 * @param {!WebInspector.TargetManager} targetManager | 10 * @param {!WebInspector.TargetManager} targetManager |
| 11 * @param {string} name | 11 * @param {string} name |
| 12 * @param {number} capabilitiesMask | 12 * @param {number} capabilitiesMask |
| 13 * @param {!InspectorBackendClass.Connection} connection | 13 * @param {!InspectorBackendClass.Connection} connection |
| 14 * @param {?WebInspector.Target} parentTarget | 14 * @param {?WebInspector.Target} parentTarget |
| 15 */ | 15 */ |
| 16 WebInspector.Target = function(targetManager, name, capabilitiesMask, connection
, parentTarget) | 16 WebInspector.Target = function(targetManager, name, capabilitiesMask, connection
, parentTarget) |
| 17 { | 17 { |
| 18 Protocol.Agents.call(this, connection.agentsMap()); | 18 Protocol.Agents.call(this, connection.agentsMap()); |
| 19 this._targetManager = targetManager; | 19 this._targetManager = targetManager; |
| 20 this._name = name; | 20 this._name = name; |
| 21 this._inspectedURL = ""; |
| 21 this._capabilitiesMask = capabilitiesMask; | 22 this._capabilitiesMask = capabilitiesMask; |
| 22 this._connection = connection; | 23 this._connection = connection; |
| 23 this._parentTarget = parentTarget; | 24 this._parentTarget = parentTarget; |
| 24 connection.addEventListener(InspectorBackendClass.Connection.Events.Disconne
cted, this._onDisconnect, this); | 25 connection.addEventListener(InspectorBackendClass.Connection.Events.Disconne
cted, this._onDisconnect, this); |
| 25 this._id = WebInspector.Target._nextId++; | 26 this._id = WebInspector.Target._nextId++; |
| 26 | 27 |
| 27 /** @type {!Map.<!Function, !WebInspector.SDKModel>} */ | 28 /** @type {!Map.<!Function, !WebInspector.SDKModel>} */ |
| 28 this._modelByConstructor = new Map(); | 29 this._modelByConstructor = new Map(); |
| 29 } | 30 } |
| 30 | 31 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 }, | 183 }, |
| 183 | 184 |
| 184 /** | 185 /** |
| 185 * @return {!Array<!WebInspector.SDKModel>} | 186 * @return {!Array<!WebInspector.SDKModel>} |
| 186 */ | 187 */ |
| 187 models: function() | 188 models: function() |
| 188 { | 189 { |
| 189 return this._modelByConstructor.valuesArray(); | 190 return this._modelByConstructor.valuesArray(); |
| 190 }, | 191 }, |
| 191 | 192 |
| 193 /** |
| 194 * @return {string} |
| 195 */ |
| 196 inspectedURL: function() |
| 197 { |
| 198 return this._inspectedURL; |
| 199 }, |
| 200 |
| 201 /** |
| 202 * @param {string} inspectedURL |
| 203 */ |
| 204 setInspectedURL: function(inspectedURL) |
| 205 { |
| 206 this._inspectedURL = inspectedURL; |
| 207 InspectorFrontendHost.inspectedURLChanged(inspectedURL || ""); |
| 208 this._targetManager.dispatchEventToListeners(WebInspector.TargetManager.
Events.InspectedURLChanged, this); |
| 209 }, |
| 210 |
| 192 __proto__: Protocol.Agents.prototype | 211 __proto__: Protocol.Agents.prototype |
| 193 } | 212 } |
| 194 | 213 |
| 195 /** | 214 /** |
| 196 * @constructor | 215 * @constructor |
| 197 * @extends {WebInspector.Object} | 216 * @extends {WebInspector.Object} |
| 198 * @param {!WebInspector.Target} target | 217 * @param {!WebInspector.Target} target |
| 199 */ | 218 */ |
| 200 WebInspector.SDKObject = function(target) | 219 WebInspector.SDKObject = function(target) |
| 201 { | 220 { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 { | 273 { |
| 255 var target = /** @type {!WebInspector.Target} */ (event.data); | 274 var target = /** @type {!WebInspector.Target} */ (event.data); |
| 256 if (target !== this._target) | 275 if (target !== this._target) |
| 257 return; | 276 return; |
| 258 this.dispose(); | 277 this.dispose(); |
| 259 WebInspector.targetManager.removeEventListener(WebInspector.TargetManage
r.Events.TargetDisposed, this._targetDisposed, this); | 278 WebInspector.targetManager.removeEventListener(WebInspector.TargetManage
r.Events.TargetDisposed, this._targetDisposed, this); |
| 260 }, | 279 }, |
| 261 | 280 |
| 262 __proto__: WebInspector.SDKObject.prototype | 281 __proto__: WebInspector.SDKObject.prototype |
| 263 } | 282 } |
| OLD | NEW |