| 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 {string} name | 10 * @param {string} name |
| 11 * @param {!InspectorBackendClass.Connection} connection | 11 * @param {!InspectorBackendClass.Connection} connection |
| 12 * @param {function(!WebInspector.Target)=} callback | 12 * @param {function(!WebInspector.Target)=} callback |
| 13 */ | 13 */ |
| 14 WebInspector.Target = function(name, connection, callback) | 14 WebInspector.Target = function(name, connection, callback) |
| 15 { | 15 { |
| 16 Protocol.Agents.call(this, connection.agentsMap()); | 16 Protocol.Agents.call(this, connection.agentsMap()); |
| 17 /** @type {!WeakReference.<!WebInspector.Target>} */ | 17 /** @type {!WeakReference.<!WebInspector.Target>} */ |
| 18 this._weakReference = new WeakReference(this); | 18 this._weakReference = new WeakReference(this); |
| 19 this._name = name; | 19 this._name = name; |
| 20 this._connection = connection; | 20 this._connection = connection; |
| 21 connection.addEventListener(InspectorBackendClass.Connection.Events.Disconne
cted, this._onDisconnect, this); | 21 connection.addEventListener(InspectorBackendClass.Connection.Events.Disconne
cted, this._onDisconnect, this); |
| 22 this._id = WebInspector.Target._nextId++; | 22 this._id = WebInspector.Target._nextId++; |
| 23 | 23 |
| 24 /** @type {!Map.<!Function, !WebInspector.SDKModel>} */ | 24 /** @type {!Map.<!Function, !WebInspector.SDKModel>} */ |
| 25 this._modelByConstructor = new Map(); | 25 this._modelByConstructor = new Map(); |
| 26 | 26 |
| 27 /** @type {!Object.<string, boolean>} */ | 27 /** @type {!Object.<string, boolean>} */ |
| 28 this._capabilities = {}; | 28 this._capabilities = {}; |
| 29 this.pageAgent().canScreencast(this._initializeCapability.bind(this, WebInsp
ector.Target.Capabilities.CanScreencast, null)); | 29 this.pageAgent().canScreencast(this._initializeCapability.bind(this, WebInsp
ector.Target.Capabilities.CanScreencast, null)); |
| 30 this.pageAgent().hasTouchInputs(this._initializeCapability.bind(this, WebIns
pector.Target.Capabilities.HasTouchInputs, null)); | |
| 31 if (WebInspector.experimentsSettings.timelinePowerProfiler.isEnabled()) | 30 if (WebInspector.experimentsSettings.timelinePowerProfiler.isEnabled()) |
| 32 this.powerAgent().canProfilePower(this._initializeCapability.bind(this,
WebInspector.Target.Capabilities.CanProfilePower, null)); | 31 this.powerAgent().canProfilePower(this._initializeCapability.bind(this,
WebInspector.Target.Capabilities.CanProfilePower, null)); |
| 33 this.workerAgent().canInspectWorkers(this._initializeCapability.bind(this, W
ebInspector.Target.Capabilities.CanInspectWorkers, this._loadedWithCapabilities.
bind(this, callback))); | 32 this.workerAgent().canInspectWorkers(this._initializeCapability.bind(this, W
ebInspector.Target.Capabilities.CanInspectWorkers, this._loadedWithCapabilities.
bind(this, callback))); |
| 34 | 33 |
| 35 /** @type {!WebInspector.Lock} */ | 34 /** @type {!WebInspector.Lock} */ |
| 36 this.profilingLock = new WebInspector.Lock(); | 35 this.profilingLock = new WebInspector.Lock(); |
| 37 } | 36 } |
| 38 | 37 |
| 39 /** | 38 /** |
| 40 * @enum {string} | 39 * @enum {string} |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 /** | 416 /** |
| 418 * @param {!WebInspector.Target} target | 417 * @param {!WebInspector.Target} target |
| 419 */ | 418 */ |
| 420 targetRemoved: function(target) { }, | 419 targetRemoved: function(target) { }, |
| 421 } | 420 } |
| 422 | 421 |
| 423 /** | 422 /** |
| 424 * @type {!WebInspector.TargetManager} | 423 * @type {!WebInspector.TargetManager} |
| 425 */ | 424 */ |
| 426 WebInspector.targetManager = new WebInspector.TargetManager(); | 425 WebInspector.targetManager = new WebInspector.TargetManager(); |
| OLD | NEW |