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 * @unrestricted | 5 * @unrestricted |
6 * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>} | 6 * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>} |
7 */ | 7 */ |
8 Bindings.DebuggerWorkspaceBinding = class extends Common.Object { | 8 Bindings.DebuggerWorkspaceBinding = class extends Common.Object { |
9 /** | 9 /** |
10 * @param {!SDK.TargetManager} targetManager | 10 * @param {!SDK.TargetManager} targetManager |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 rawLocationToUILocation(rawLocation) { | 163 rawLocationToUILocation(rawLocation) { |
164 var info = this._infoForScript(rawLocation.script()); | 164 var info = this._infoForScript(rawLocation.script()); |
165 console.assert(info); | 165 console.assert(info); |
166 return info._rawLocationToUILocation(rawLocation); | 166 return info._rawLocationToUILocation(rawLocation); |
167 } | 167 } |
168 | 168 |
169 /** | 169 /** |
170 * @param {!Workspace.UISourceCode} uiSourceCode | 170 * @param {!Workspace.UISourceCode} uiSourceCode |
171 * @param {number} lineNumber | 171 * @param {number} lineNumber |
172 * @param {number} columnNumber | 172 * @param {number} columnNumber |
173 * @return {?SDK.DebuggerModel.Location} | 173 * @return {!Array<!SDK.DebuggerModel.Location>} |
174 */ | 174 */ |
175 uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { | 175 uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber) { |
176 var sourceMapping = uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMa
ppingSymbol]; | 176 var sourceMapping = uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMa
ppingSymbol]; |
177 return sourceMapping && sourceMapping.uiLocationToRawLocation(uiSourceCode,
lineNumber, columnNumber); | 177 return sourceMapping ? sourceMapping.uiLocationToRawLocations(uiSourceCode,
lineNumber, columnNumber) : []; |
178 } | 178 } |
179 | 179 |
180 /** | 180 /** |
181 * @param {!Workspace.UILocation} uiLocation | 181 * @param {!Workspace.UILocation} uiLocation |
182 * @return {!Workspace.UILocation} | 182 * @return {!Workspace.UILocation} |
183 */ | 183 */ |
184 normalizeUILocation(uiLocation) { | 184 normalizeUILocation(uiLocation) { |
185 var rawLocation = | 185 var rawLocations = |
186 this.uiLocationToRawLocation(uiLocation.uiSourceCode, uiLocation.lineNum
ber, uiLocation.columnNumber); | 186 this.uiLocationToRawLocations(uiLocation.uiSourceCode, uiLocation.lineNu
mber, uiLocation.columnNumber); |
187 if (rawLocation) | 187 if (rawLocations.length) |
188 return this.rawLocationToUILocation(rawLocation); | 188 return this.rawLocationToUILocation(rawLocations[0]); |
189 return uiLocation; | 189 return uiLocation; |
190 } | 190 } |
191 | 191 |
192 /** | 192 /** |
193 * @param {!Workspace.UISourceCode} uiSourceCode | 193 * @param {!Workspace.UISourceCode} uiSourceCode |
194 * @param {number} lineNumber | 194 * @param {number} lineNumber |
195 * @return {boolean} | 195 * @return {boolean} |
196 */ | 196 */ |
197 uiLineHasMapping(uiSourceCode, lineNumber) { | 197 uiLineHasMapping(uiSourceCode, lineNumber) { |
198 var sourceMapping = uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMa
ppingSymbol]; | 198 var sourceMapping = uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMa
ppingSymbol]; |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 /** | 579 /** |
580 * @param {!SDK.DebuggerModel.Location} rawLocation | 580 * @param {!SDK.DebuggerModel.Location} rawLocation |
581 * @return {?Workspace.UILocation} | 581 * @return {?Workspace.UILocation} |
582 */ | 582 */ |
583 rawLocationToUILocation(rawLocation) {}, | 583 rawLocationToUILocation(rawLocation) {}, |
584 | 584 |
585 /** | 585 /** |
586 * @param {!Workspace.UISourceCode} uiSourceCode | 586 * @param {!Workspace.UISourceCode} uiSourceCode |
587 * @param {number} lineNumber | 587 * @param {number} lineNumber |
588 * @param {number} columnNumber | 588 * @param {number} columnNumber |
589 * @return {?SDK.DebuggerModel.Location} | 589 * @return {!Array<!SDK.DebuggerModel.Location>} |
590 */ | 590 */ |
591 uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) {}, | 591 uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber) {}, |
592 | 592 |
593 /** | 593 /** |
594 * @return {boolean} | 594 * @return {boolean} |
595 */ | 595 */ |
596 isIdentity() {}, | 596 isIdentity() {}, |
597 | 597 |
598 /** | 598 /** |
599 * @param {!Workspace.UISourceCode} uiSourceCode | 599 * @param {!Workspace.UISourceCode} uiSourceCode |
600 * @param {number} lineNumber | 600 * @param {number} lineNumber |
601 * @return {boolean} | 601 * @return {boolean} |
602 */ | 602 */ |
603 uiLineHasMapping(uiSourceCode, lineNumber) {} | 603 uiLineHasMapping(uiSourceCode, lineNumber) {} |
604 }; | 604 }; |
605 | 605 |
606 /** | 606 /** |
607 * @type {!Bindings.DebuggerWorkspaceBinding} | 607 * @type {!Bindings.DebuggerWorkspaceBinding} |
608 */ | 608 */ |
609 Bindings.debuggerWorkspaceBinding; | 609 Bindings.debuggerWorkspaceBinding; |
OLD | NEW |