Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js

Issue 2869293002: DevTools: make CompilerScriptMapping / SASSSourceMapping manage UISourceCodes (Closed)
Patch Set: address comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698