| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 Sources.SourceMapNamesResolver = {}; | 4 Sources.SourceMapNamesResolver = {}; |
| 5 | 5 |
| 6 Sources.SourceMapNamesResolver._cachedMapSymbol = Symbol('cache'); | 6 Sources.SourceMapNamesResolver._cachedMapSymbol = Symbol('cache'); |
| 7 Sources.SourceMapNamesResolver._cachedIdentifiersSymbol = Symbol('cachedIdentifi
ers'); | 7 Sources.SourceMapNamesResolver._cachedIdentifiersSymbol = Symbol('cachedIdentifi
ers'); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * @unrestricted | 10 * @unrestricted |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 function resolveSourceName(id) { | 144 function resolveSourceName(id) { |
| 145 var startEntry = sourceMap.findEntry(id.lineNumber, id.columnNumber); | 145 var startEntry = sourceMap.findEntry(id.lineNumber, id.columnNumber); |
| 146 var endEntry = sourceMap.findEntry(id.lineNumber, id.columnNumber + id.name.
length); | 146 var endEntry = sourceMap.findEntry(id.lineNumber, id.columnNumber + id.name.
length); |
| 147 if (!startEntry || !endEntry || !startEntry.sourceURL || startEntry.sourceUR
L !== endEntry.sourceURL || | 147 if (!startEntry || !endEntry || !startEntry.sourceURL || startEntry.sourceUR
L !== endEntry.sourceURL || |
| 148 !startEntry.sourceLineNumber || !startEntry.sourceColumnNumber || !endEn
try.sourceLineNumber || | 148 !startEntry.sourceLineNumber || !startEntry.sourceColumnNumber || !endEn
try.sourceLineNumber || |
| 149 !endEntry.sourceColumnNumber) | 149 !endEntry.sourceColumnNumber) |
| 150 return Promise.resolve(/** @type {?string} */ (null)); | 150 return Promise.resolve(/** @type {?string} */ (null)); |
| 151 var sourceTextRange = new TextUtils.TextRange( | 151 var sourceTextRange = new TextUtils.TextRange( |
| 152 startEntry.sourceLineNumber, startEntry.sourceColumnNumber, endEntry.sou
rceLineNumber, | 152 startEntry.sourceLineNumber, startEntry.sourceColumnNumber, endEntry.sou
rceLineNumber, |
| 153 endEntry.sourceColumnNumber); | 153 endEntry.sourceColumnNumber); |
| 154 var uiSourceCode = | 154 var uiSourceCode = Bindings.debuggerWorkspaceBinding.uiSourceCodeForSourceMa
pSourceURL( |
| 155 Bindings.NetworkProject.uiSourceCodeForScriptURL(Workspace.workspace, st
artEntry.sourceURL, script); | 155 script.debuggerModel, startEntry.sourceURL, script.isContentScript()); |
| 156 if (!uiSourceCode) | 156 if (!uiSourceCode) |
| 157 return Promise.resolve(/** @type {?string} */ (null)); | 157 return Promise.resolve(/** @type {?string} */ (null)); |
| 158 | 158 |
| 159 return uiSourceCode.requestContent().then(onSourceContent.bind(null, sourceT
extRange)); | 159 return uiSourceCode.requestContent().then(onSourceContent.bind(null, sourceT
extRange)); |
| 160 } | 160 } |
| 161 | 161 |
| 162 /** | 162 /** |
| 163 * @param {!TextUtils.TextRange} sourceTextRange | 163 * @param {!TextUtils.TextRange} sourceTextRange |
| 164 * @param {?string} content | 164 * @param {?string} content |
| 165 * @return {?string} | 165 * @return {?string} |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 } | 565 } |
| 566 | 566 |
| 567 /** | 567 /** |
| 568 * @override | 568 * @override |
| 569 * @return {boolean} | 569 * @return {boolean} |
| 570 */ | 570 */ |
| 571 isNode() { | 571 isNode() { |
| 572 return this._object.isNode(); | 572 return this._object.isNode(); |
| 573 } | 573 } |
| 574 }; | 574 }; |
| OLD | NEW |