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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 console.assert(rawLocations.length); | 145 console.assert(rawLocations.length); |
| 146 var location = new WebInspector.DebuggerWorkspaceBinding.StackTraceTopFr ameLocation(rawLocations, this, updateDelegate, locationPool); | 146 var location = new WebInspector.DebuggerWorkspaceBinding.StackTraceTopFr ameLocation(rawLocations, this, updateDelegate, locationPool); |
| 147 location.update(); | 147 location.update(); |
| 148 return location; | 148 return location; |
| 149 }, | 149 }, |
| 150 | 150 |
| 151 /** | 151 /** |
| 152 * @param {!WebInspector.DebuggerModel.Location} location | 152 * @param {!WebInspector.DebuggerModel.Location} location |
| 153 * @param {function(!WebInspector.LiveLocation)} updateDelegate | 153 * @param {function(!WebInspector.LiveLocation)} updateDelegate |
| 154 * @param {!WebInspector.LiveLocationPool} locationPool | 154 * @param {!WebInspector.LiveLocationPool} locationPool |
| 155 * @return {!WebInspector.DebuggerWorkspaceBinding.Location} | 155 * @return {?WebInspector.DebuggerWorkspaceBinding.Location} |
| 156 */ | 156 */ |
| 157 createCallFrameLiveLocation: function(location, updateDelegate, locationPool ) | 157 createCallFrameLiveLocation: function(location, updateDelegate, locationPool ) |
| 158 { | 158 { |
| 159 var script = location.script(); | |
| 160 if (!script) | |
| 161 return null; | |
| 159 var target = location.target(); | 162 var target = location.target(); |
| 160 this._ensureInfoForScript(/** @type {!WebInspector.Script} */(location.s cript())); | 163 this._ensureInfoForScript(script); |
| 161 var liveLocation = this.createLiveLocation(location, updateDelegate, loc ationPool); | 164 var liveLocation = this.createLiveLocation(location, updateDelegate, loc ationPool); |
| 162 this._registerCallFrameLiveLocation(target, liveLocation); | 165 this._registerCallFrameLiveLocation(target, liveLocation); |
| 163 return liveLocation; | 166 return liveLocation; |
| 164 }, | 167 }, |
| 165 | 168 |
| 166 /** | 169 /** |
| 167 * @param {!WebInspector.DebuggerModel.Location} rawLocation | 170 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
| 168 * @return {!WebInspector.UILocation} | 171 * @return {!WebInspector.UILocation} |
| 169 */ | 172 */ |
| 170 rawLocationToUILocation: function(rawLocation) | 173 rawLocationToUILocation: function(rawLocation) |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 594 * @param {!WebInspector.LiveLocationPool} locationPool | 597 * @param {!WebInspector.LiveLocationPool} locationPool |
| 595 */ | 598 */ |
| 596 WebInspector.DebuggerWorkspaceBinding.StackTraceTopFrameLocation = function(rawL ocations, binding, updateDelegate, locationPool) | 599 WebInspector.DebuggerWorkspaceBinding.StackTraceTopFrameLocation = function(rawL ocations, binding, updateDelegate, locationPool) |
| 597 { | 600 { |
| 598 WebInspector.LiveLocationWithPool.call(this, updateDelegate, locationPool); | 601 WebInspector.LiveLocationWithPool.call(this, updateDelegate, locationPool); |
| 599 | 602 |
| 600 this._updateScheduled = true; | 603 this._updateScheduled = true; |
| 601 /** @type {!Set<!WebInspector.LiveLocation>} */ | 604 /** @type {!Set<!WebInspector.LiveLocation>} */ |
| 602 this._locations = new Set(); | 605 this._locations = new Set(); |
| 603 for (var location of rawLocations) | 606 for (var location of rawLocations) |
| 604 this._locations.add(binding.createCallFrameLiveLocation(location, this._ scheduleUpdate.bind(this), locationPool)); | 607 this._locations.add(binding.createLiveLocation(location, this._scheduleU pdate.bind(this), locationPool)); |
|
kozy
2016/09/30 19:26:32
We use it mostly for location of console messages
| |
| 605 this._updateLocation(); | 608 this._updateLocation(); |
| 606 } | 609 } |
| 607 | 610 |
| 608 WebInspector.DebuggerWorkspaceBinding.StackTraceTopFrameLocation.prototype = { | 611 WebInspector.DebuggerWorkspaceBinding.StackTraceTopFrameLocation.prototype = { |
| 609 /** | 612 /** |
| 610 * @override | 613 * @override |
| 611 * @return {!WebInspector.UILocation} | 614 * @return {!WebInspector.UILocation} |
| 612 */ | 615 */ |
| 613 uiLocation: function() | 616 uiLocation: function() |
| 614 { | 617 { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 690 * @param {number} lineNumber | 693 * @param {number} lineNumber |
| 691 * @return {boolean} | 694 * @return {boolean} |
| 692 */ | 695 */ |
| 693 uiLineHasMapping: function(uiSourceCode, lineNumber) { } | 696 uiLineHasMapping: function(uiSourceCode, lineNumber) { } |
| 694 } | 697 } |
| 695 | 698 |
| 696 /** | 699 /** |
| 697 * @type {!WebInspector.DebuggerWorkspaceBinding} | 700 * @type {!WebInspector.DebuggerWorkspaceBinding} |
| 698 */ | 701 */ |
| 699 WebInspector.debuggerWorkspaceBinding; | 702 WebInspector.debuggerWorkspaceBinding; |
| OLD | NEW |