| 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 {WebInspector.Object} | 9 * @extends {WebInspector.Object} |
| 10 */ | 10 */ |
| 11 WebInspector.TargetManager = function() | 11 WebInspector.TargetManager = function() |
| 12 { | 12 { |
| 13 WebInspector.Object.call(this); | 13 WebInspector.Object.call(this); |
| 14 /** @type {!Array.<!WebInspector.Target>} */ | 14 /** @type {!Array.<!WebInspector.Target>} */ |
| 15 this._targets = []; | 15 this._targets = []; |
| 16 /** @type {!Array.<!WebInspector.TargetManager.Observer>} */ | 16 /** @type {!Array.<!WebInspector.TargetManager.Observer>} */ |
| 17 this._observers = []; | 17 this._observers = []; |
| 18 this._observerCapabiliesMaskSymbol = Symbol("observerCapabilitiesMask"); | 18 this._observerCapabiliesMaskSymbol = Symbol("observerCapabilitiesMask"); |
| 19 /** @type {!Object.<string, !Array.<{modelClass: !Function, thisObject: (!Ob
ject|undefined), listener: function(!WebInspector.Event)}>>} */ | 19 /** @type {!Object.<string, !Array.<{modelClass: !Function, thisObject: (!Ob
ject|undefined), listener: function(!WebInspector.Event)}>>} */ |
| 20 this._modelListeners = {}; | 20 this._modelListeners = {}; |
| 21 this._isSuspended = false; | 21 this._isSuspended = false; |
| 22 } | 22 } |
| 23 | 23 |
| 24 /** @enum {symbol} */ |
| 24 WebInspector.TargetManager.Events = { | 25 WebInspector.TargetManager.Events = { |
| 25 InspectedURLChanged: "InspectedURLChanged", | 26 InspectedURLChanged: Symbol("InspectedURLChanged"), |
| 26 MainFrameNavigated: "MainFrameNavigated", | 27 MainFrameNavigated: Symbol("MainFrameNavigated"), |
| 27 Load: "Load", | 28 Load: Symbol("Load"), |
| 28 PageReloadRequested: "PageReloadRequested", | 29 PageReloadRequested: Symbol("PageReloadRequested"), |
| 29 WillReloadPage: "WillReloadPage", | 30 WillReloadPage: Symbol("WillReloadPage"), |
| 30 TargetDisposed: "TargetDisposed", | 31 TargetDisposed: Symbol("TargetDisposed"), |
| 31 SuspendStateChanged: "SuspendStateChanged" | 32 SuspendStateChanged: Symbol("SuspendStateChanged") |
| 32 } | 33 } |
| 33 | 34 |
| 34 WebInspector.TargetManager.prototype = { | 35 WebInspector.TargetManager.prototype = { |
| 35 suspendAllTargets: function() | 36 suspendAllTargets: function() |
| 36 { | 37 { |
| 37 if (this._isSuspended) | 38 if (this._isSuspended) |
| 38 return; | 39 return; |
| 39 this._isSuspended = true; | 40 this._isSuspended = true; |
| 40 this.dispatchEventToListeners(WebInspector.TargetManager.Events.SuspendS
tateChanged); | 41 this.dispatchEventToListeners(WebInspector.TargetManager.Events.SuspendS
tateChanged); |
| 41 | 42 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 /** | 354 /** |
| 354 * @param {!WebInspector.Target} target | 355 * @param {!WebInspector.Target} target |
| 355 */ | 356 */ |
| 356 targetRemoved: function(target) { }, | 357 targetRemoved: function(target) { }, |
| 357 } | 358 } |
| 358 | 359 |
| 359 /** | 360 /** |
| 360 * @type {!WebInspector.TargetManager} | 361 * @type {!WebInspector.TargetManager} |
| 361 */ | 362 */ |
| 362 WebInspector.targetManager = new WebInspector.TargetManager(); | 363 WebInspector.targetManager = new WebInspector.TargetManager(); |
| OLD | NEW |