Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js |
| index fd440e77af22864c6622ce2a24d320484c96df2c..06a5060f8eccf34ff79f30a63038b1b296067fe4 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js |
| @@ -296,6 +296,31 @@ Bindings.DebuggerWorkspaceBinding.ModelData = class { |
| ]; |
| } |
| + /** |
| + * @param {!SDK.DebuggerModel.Location} rawLocation |
| + * @return {?Workspace.UILocation} |
| + */ |
| + _htmlUILocation(rawLocation) { |
| + var script = rawLocation.script(); |
| + if (!script) |
| + return null; |
| + var uiSourceCode = |
| + Bindings.resourceBindingManager.uiSourceCodeForURL(script.debuggerModel.target(), script.sourceURL); |
| + return uiSourceCode ? uiSourceCode.uiLocation(rawLocation.lineNumber, rawLocation.columnNumber) : null; |
| + } |
| + |
| + /** |
| + * @param {!Workspace.UISourceCode} uiSourceCode |
| + * @param {number} lineNumber |
| + * @param {number} columnNumber |
| + * @return {?SDK.DebuggerModel.Location} |
| + */ |
| + _htmlRawLocation(uiSourceCode, lineNumber, columnNumber) { |
| + if (!Bindings.resourceBindingManager.ownsUISourceCode(this._debuggerModel.target(), uiSourceCode)) |
|
dgozman
2017/06/12 18:48:50
uiLocationToJSLocation
lushnikov
2017/06/12 22:05:56
Turns out this is not needed - simply calling this
|
| + return null; |
| + return this._debuggerModel.createRawLocationByURL(uiSourceCode.url(), lineNumber, columnNumber); |
| + } |
| + |
| /** |
| * @param {!SDK.DebuggerModel.Location} rawLocation |
| * @return {!Workspace.UILocation} |
| @@ -304,6 +329,7 @@ Bindings.DebuggerWorkspaceBinding.ModelData = class { |
| var uiLocation = null; |
| uiLocation = uiLocation || this._compilerMapping.rawLocationToUILocation(rawLocation); |
| uiLocation = uiLocation || this._resourceMapping.rawLocationToUILocation(rawLocation); |
| + uiLocation = uiLocation || this._htmlUILocation(rawLocation); |
| uiLocation = uiLocation || this._defaultMapping.rawLocationToUILocation(rawLocation); |
| // DefaultMapping ensures uiLocation for every rawLocation. |
| console.assert(uiLocation); |
| @@ -320,6 +346,7 @@ Bindings.DebuggerWorkspaceBinding.ModelData = class { |
| var rawLocation = null; |
| rawLocation = rawLocation || this._compilerMapping.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); |
| rawLocation = rawLocation || this._resourceMapping.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); |
| + rawLocation = rawLocation || this._htmlRawLocation(uiSourceCode, lineNumber, columnNumber); |
| rawLocation = rawLocation || this._defaultMapping.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); |
| return rawLocation; |
| } |