Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/Target.js

Issue 2543633009: [Devtools] Template fromTarget() function calls to model (Closed)
Patch Set: fix Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 * @unrestricted 8 * @unrestricted
9 */ 9 */
10 SDK.Target = class extends Protocol.TargetBase { 10 SDK.Target = class extends Protocol.TargetBase {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 /** 129 /**
130 * @override 130 * @override
131 */ 131 */
132 dispose() { 132 dispose() {
133 this._targetManager.removeTarget(this); 133 this._targetManager.removeTarget(this);
134 for (var model of this._modelByConstructor.valuesArray()) 134 for (var model of this._modelByConstructor.valuesArray())
135 model.dispose(); 135 model.dispose();
136 } 136 }
137 137
138 /** 138 /**
139 * @param {!Function} modelClass 139 * @param {function(new: (!T<!SDK.SDKModel>), ...)} modelClass
140 * @return {?SDK.SDKModel} 140 * @return {?T}
141 * @template T
141 */ 142 */
142 model(modelClass) { 143 model(modelClass) {
143 return this._modelByConstructor.get(modelClass) || null; 144 return this._modelByConstructor.get(modelClass) || null;
144 } 145 }
145 146
146 /** 147 /**
147 * @return {!Array<!SDK.SDKModel>} 148 * @return {!Array<!SDK.SDKModel>}
148 */ 149 */
149 models() { 150 models() {
150 return this._modelByConstructor.valuesArray(); 151 return this._modelByConstructor.valuesArray();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 /** 242 /**
242 * @param {!Common.Event} event 243 * @param {!Common.Event} event
243 */ 244 */
244 _targetDisposed(event) { 245 _targetDisposed(event) {
245 var target = /** @type {!SDK.Target} */ (event.data); 246 var target = /** @type {!SDK.Target} */ (event.data);
246 if (target !== this._target) 247 if (target !== this._target)
247 return; 248 return;
248 this.dispose(); 249 this.dispose();
249 } 250 }
250 }; 251 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698