Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @implements {WebInspector.TargetManager.Observer} | 7 * @implements {WebInspector.TargetManager.Observer} |
| 8 * @param {!WebInspector.TargetManager} targetManager | 8 * @param {!WebInspector.TargetManager} targetManager |
| 9 * @param {!WebInspector.Workspace} workspace | 9 * @param {!WebInspector.Workspace} workspace |
| 10 * @param {!WebInspector.NetworkMapping} networkMapping | 10 * @param {!WebInspector.NetworkMapping} networkMapping |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 */ | 114 */ |
| 115 updateLocations: function(script) | 115 updateLocations: function(script) |
| 116 { | 116 { |
| 117 var info = this._infoForScript(script.target(), script.scriptId); | 117 var info = this._infoForScript(script.target(), script.scriptId); |
| 118 if (info) | 118 if (info) |
| 119 info._updateLocations(); | 119 info._updateLocations(); |
| 120 }, | 120 }, |
| 121 | 121 |
| 122 /** | 122 /** |
| 123 * @param {!WebInspector.DebuggerModel.Location} rawLocation | 123 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
| 124 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDel egate | 124 * @param {function(!WebInspector.LiveLocation)} updateDelegate |
| 125 * @return {!WebInspector.DebuggerWorkspaceBinding.Location} | 125 * @return {!WebInspector.DebuggerWorkspaceBinding.Location} |
| 126 */ | 126 */ |
| 127 createLiveLocation: function(rawLocation, updateDelegate) | 127 createLiveLocation: function(rawLocation, updateDelegate) |
| 128 { | 128 { |
| 129 var info = this._infoForScript(rawLocation.target(), rawLocation.scriptI d); | 129 var info = this._infoForScript(rawLocation.target(), rawLocation.scriptI d); |
| 130 console.assert(info); | 130 console.assert(info); |
| 131 var location = new WebInspector.DebuggerWorkspaceBinding.Location(info._ script, rawLocation, this, updateDelegate); | 131 var location = new WebInspector.DebuggerWorkspaceBinding.Location(info._ script, rawLocation, this, updateDelegate); |
| 132 info._addLocation(location); | 132 info._addLocation(location); |
| 133 return location; | 133 return location; |
| 134 }, | 134 }, |
| 135 | 135 |
| 136 /** | 136 /** |
| 137 * @param {!WebInspector.DebuggerModel.CallFrame} callFrame | 137 * @param {!WebInspector.DebuggerModel.CallFrame} callFrame |
| 138 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDel egate | 138 * @param {function(!WebInspector.LiveLocation)} updateDelegate |
| 139 * @return {!WebInspector.DebuggerWorkspaceBinding.Location} | 139 * @return {!WebInspector.DebuggerWorkspaceBinding.Location} |
| 140 */ | 140 */ |
| 141 createCallFrameLiveLocation: function(callFrame, updateDelegate) | 141 createCallFrameLiveLocation: function(callFrame, updateDelegate) |
| 142 { | 142 { |
| 143 var target = callFrame.target(); | 143 var target = callFrame.target(); |
| 144 this._ensureInfoForScript(callFrame.script); | 144 this._ensureInfoForScript(callFrame.script); |
| 145 var location = this.createLiveLocation(callFrame.location(), updateDeleg ate); | 145 var location = this.createLiveLocation(callFrame.location(), updateDeleg ate); |
| 146 this._registerCallFrameLiveLocation(target, location); | 146 this._registerCallFrameLiveLocation(target, location); |
| 147 return location; | 147 return location; |
| 148 }, | 148 }, |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 462 * @return {!WebInspector.DebuggerSourceMapping} | 462 * @return {!WebInspector.DebuggerSourceMapping} |
| 463 */ | 463 */ |
| 464 _popSourceMapping: function() | 464 _popSourceMapping: function() |
| 465 { | 465 { |
| 466 var sourceMapping = this._sourceMappings.pop(); | 466 var sourceMapping = this._sourceMappings.pop(); |
| 467 this._updateLocations(); | 467 this._updateLocations(); |
| 468 return sourceMapping; | 468 return sourceMapping; |
| 469 }, | 469 }, |
| 470 | 470 |
| 471 /** | 471 /** |
| 472 * @param {!WebInspector.LiveLocation} location | 472 * @param {!WebInspector.DebuggerWorkspaceBinding.Location} location |
| 473 */ | 473 */ |
| 474 _addLocation: function(location) | 474 _addLocation: function(location) |
| 475 { | 475 { |
| 476 this._locations.add(location); | 476 this._locations.add(location); |
| 477 location.update(); | 477 location.update(); |
| 478 }, | 478 }, |
| 479 | 479 |
| 480 /** | 480 /** |
| 481 * @param {!WebInspector.LiveLocation} location | 481 * @param {!WebInspector.DebuggerWorkspaceBinding.Location} location |
| 482 */ | 482 */ |
| 483 _removeLocation: function(location) | 483 _removeLocation: function(location) |
| 484 { | 484 { |
| 485 this._locations.delete(location); | 485 this._locations.delete(location); |
| 486 }, | 486 }, |
| 487 | 487 |
| 488 _updateLocations: function() | 488 _updateLocations: function() |
| 489 { | 489 { |
| 490 for (var location of this._locations) | 490 for (var location of this._locations) |
| 491 location.update(); | 491 location.update(); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 | 507 |
| 508 | 508 |
| 509 /** | 509 /** |
| 510 * @constructor | 510 * @constructor |
| 511 * @extends {WebInspector.LiveLocation} | 511 * @extends {WebInspector.LiveLocation} |
| 512 * @param {!WebInspector.Script} script | 512 * @param {!WebInspector.Script} script |
| 513 * @param {!WebInspector.DebuggerModel.Location} rawLocation | 513 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
| 514 * @param {!WebInspector.DebuggerWorkspaceBinding} binding | 514 * @param {!WebInspector.DebuggerWorkspaceBinding} binding |
| 515 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegat e | 515 * @param {function(!WebInspector.LiveLocation)} updateDelegate |
| 516 */ | 516 */ |
| 517 WebInspector.DebuggerWorkspaceBinding.Location = function(script, rawLocation, b inding, updateDelegate) | 517 WebInspector.DebuggerWorkspaceBinding.Location = function(script, rawLocation, b inding, updateDelegate) |
| 518 { | 518 { |
| 519 WebInspector.LiveLocation.call(this, updateDelegate); | 519 WebInspector.LiveLocation.call(this, updateDelegate); |
| 520 this._script = script; | 520 this._script = script; |
| 521 this._rawLocation = rawLocation; | 521 this._rawLocation = rawLocation; |
| 522 this._binding = binding; | 522 this._binding = binding; |
| 523 } | 523 } |
| 524 | 524 |
| 525 WebInspector.DebuggerWorkspaceBinding.Location.prototype = { | 525 WebInspector.DebuggerWorkspaceBinding.Location.prototype = { |
| 526 /** | 526 /** |
| 527 * @override | 527 * @override |
| 528 * @return {!WebInspector.UILocation} | 528 * @return {!WebInspector.UILocation} |
| 529 */ | 529 */ |
| 530 uiLocation: function() | 530 uiLocation: function() |
| 531 { | 531 { |
| 532 var debuggerModelLocation = this._rawLocation; | 532 var debuggerModelLocation = this._rawLocation; |
| 533 return this._binding.rawLocationToUILocation(debuggerModelLocation); | 533 var uiLocation = this._binding.rawLocationToUILocation(debuggerModelLoca tion); |
| 534 return uiLocation; | |
|
dgozman
2016/02/18 02:42:50
nit: please revert
kozy
2016/02/18 02:55:44
Done.
| |
| 534 }, | 535 }, |
| 535 | 536 |
| 536 dispose: function() | 537 dispose: function() |
| 537 { | 538 { |
| 538 WebInspector.LiveLocation.prototype.dispose.call(this); | 539 WebInspector.LiveLocation.prototype.dispose.call(this); |
| 539 this._binding._removeLiveLocation(this); | 540 this._binding._removeLiveLocation(this); |
| 540 }, | 541 }, |
| 541 | 542 |
| 542 __proto__: WebInspector.LiveLocation.prototype | 543 __proto__: WebInspector.LiveLocation.prototype |
| 543 } | 544 } |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 574 * @param {number} lineNumber | 575 * @param {number} lineNumber |
| 575 * @return {boolean} | 576 * @return {boolean} |
| 576 */ | 577 */ |
| 577 uiLineHasMapping: function(uiSourceCode, lineNumber) { } | 578 uiLineHasMapping: function(uiSourceCode, lineNumber) { } |
| 578 } | 579 } |
| 579 | 580 |
| 580 /** | 581 /** |
| 581 * @type {!WebInspector.DebuggerWorkspaceBinding} | 582 * @type {!WebInspector.DebuggerWorkspaceBinding} |
| 582 */ | 583 */ |
| 583 WebInspector.debuggerWorkspaceBinding; | 584 WebInspector.debuggerWorkspaceBinding; |
| OLD | NEW |