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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js

Issue 2562453003: [DevTools] Remove Common.Event.target field. (Closed)
Patch Set: works 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @implements {SDK.TargetManager.Observer} 5 * @implements {SDK.TargetManager.Observer}
6 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 Bindings.DebuggerWorkspaceBinding = class { 8 Bindings.DebuggerWorkspaceBinding = class {
9 /** 9 /**
10 * @param {!SDK.TargetManager} targetManager 10 * @param {!SDK.TargetManager} targetManager
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 var targetData = this._targetToData.get(script.target()); 254 var targetData = this._targetToData.get(script.target());
255 if (!targetData) 255 if (!targetData)
256 return; 256 return;
257 targetData._compilerMapping.maybeLoadSourceMap(script); 257 targetData._compilerMapping.maybeLoadSourceMap(script);
258 } 258 }
259 259
260 /** 260 /**
261 * @param {!Common.Event} event 261 * @param {!Common.Event} event
262 */ 262 */
263 _globalObjectCleared(event) { 263 _globalObjectCleared(event) {
264 var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.target); 264 var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.data);
265 this._reset(debuggerModel.target()); 265 this._reset(debuggerModel.target());
266 } 266 }
267 267
268 /** 268 /**
269 * @param {!SDK.Target} target 269 * @param {!SDK.Target} target
270 */ 270 */
271 _reset(target) { 271 _reset(target) {
272 var targetData = this._targetToData.get(target); 272 var targetData = this._targetToData.get(target);
273 targetData.callFrameLocations.valuesArray().forEach((location) => this._remo veLiveLocation(location)); 273 targetData.callFrameLocations.valuesArray().forEach((location) => this._remo veLiveLocation(location));
274 targetData.callFrameLocations.clear(); 274 targetData.callFrameLocations.clear();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 _removeLiveLocation(location) { 315 _removeLiveLocation(location) {
316 var info = this._infoForScript(location._script.target(), location._script.s criptId); 316 var info = this._infoForScript(location._script.target(), location._script.s criptId);
317 if (info) 317 if (info)
318 info._removeLocation(location); 318 info._removeLocation(location);
319 } 319 }
320 320
321 /** 321 /**
322 * @param {!Common.Event} event 322 * @param {!Common.Event} event
323 */ 323 */
324 _debuggerResumed(event) { 324 _debuggerResumed(event) {
325 var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.target); 325 var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.data);
326 this._reset(debuggerModel.target()); 326 this._reset(debuggerModel.target());
327 } 327 }
328 }; 328 };
329 329
330 /** 330 /**
331 * @unrestricted 331 * @unrestricted
332 */ 332 */
333 Bindings.DebuggerWorkspaceBinding.TargetData = class { 333 Bindings.DebuggerWorkspaceBinding.TargetData = class {
334 /** 334 /**
335 * @param {!SDK.DebuggerModel} debuggerModel 335 * @param {!SDK.DebuggerModel} debuggerModel
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 */ 388 */
389 _setSourceMapping(uiSourceCode, sourceMapping) { 389 _setSourceMapping(uiSourceCode, sourceMapping) {
390 if (this._uiSourceCodeToSourceMapping.get(uiSourceCode) === sourceMapping) 390 if (this._uiSourceCodeToSourceMapping.get(uiSourceCode) === sourceMapping)
391 return; 391 return;
392 392
393 if (sourceMapping) 393 if (sourceMapping)
394 this._uiSourceCodeToSourceMapping.set(uiSourceCode, sourceMapping); 394 this._uiSourceCodeToSourceMapping.set(uiSourceCode, sourceMapping);
395 else 395 else
396 this._uiSourceCodeToSourceMapping.remove(uiSourceCode); 396 this._uiSourceCodeToSourceMapping.remove(uiSourceCode);
397 397
398 uiSourceCode.dispatchEventToListeners( 398 uiSourceCode.dispatchEventToListeners(Workspace.UISourceCode.Events.SourceMa ppingChanged, {
399 Workspace.UISourceCode.Events.SourceMappingChanged, 399 uiSourceCode: uiSourceCode,
400 {target: this._debuggerModel.target(), isIdentity: sourceMapping ? sourc eMapping.isIdentity() : false}); 400 target: this._debuggerModel.target(),
401 isIdentity: sourceMapping ? sourceMapping.isIdentity() : false
402 });
401 } 403 }
402 404
403 /** 405 /**
404 * @param {!Workspace.UISourceCode} uiSourceCode 406 * @param {!Workspace.UISourceCode} uiSourceCode
405 * @param {number} lineNumber 407 * @param {number} lineNumber
406 * @param {number} columnNumber 408 * @param {number} columnNumber
407 * @return {?SDK.DebuggerModel.Location} 409 * @return {?SDK.DebuggerModel.Location}
408 */ 410 */
409 _uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { 411 _uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) {
410 var sourceMapping = this._uiSourceCodeToSourceMapping.get(uiSourceCode); 412 var sourceMapping = this._uiSourceCodeToSourceMapping.get(uiSourceCode);
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 * @param {number} lineNumber 647 * @param {number} lineNumber
646 * @return {boolean} 648 * @return {boolean}
647 */ 649 */
648 uiLineHasMapping(uiSourceCode, lineNumber) {} 650 uiLineHasMapping(uiSourceCode, lineNumber) {}
649 }; 651 };
650 652
651 /** 653 /**
652 * @type {!Bindings.DebuggerWorkspaceBinding} 654 * @type {!Bindings.DebuggerWorkspaceBinding}
653 */ 655 */
654 Bindings.debuggerWorkspaceBinding; 656 Bindings.debuggerWorkspaceBinding;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698