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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js

Issue 2875533002: DevTools: inline SourceMaps should report data url as their url. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/inline-source-map-loading-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js b/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
index 53a3862520f99d9c32d62e644461529384b25707..becf68d57cbd8974a3cbd02a8daefa206f96e68f 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
@@ -203,6 +203,8 @@ SDK.TextSourceMap = class {
this._json = payload;
this._compiledURL = compiledURL;
this._sourceMappingURL = sourceMappingURL;
+ this._baseURL = sourceMappingURL.startsWith('data:') ? compiledURL : sourceMappingURL;
+
/** @type {?Array<!SDK.SourceMapEntry>} */
this._mappings = null;
/** @type {!Map<string, !SDK.TextSourceMap.SourceInfo>} */
@@ -237,8 +239,7 @@ SDK.TextSourceMap = class {
content = content.substring(content.indexOf('\n'));
try {
var payload = /** @type {!SDK.SourceMapV3} */ (JSON.parse(content));
- var baseURL = sourceMapURL.startsWith('data:') ? compiledURL : sourceMapURL;
- callback(new SDK.TextSourceMap(compiledURL, baseURL, payload));
+ callback(new SDK.TextSourceMap(compiledURL, sourceMapURL, payload));
} catch (e) {
console.error(e);
Common.console.warn('DevTools failed to parse SourceMap: ' + sourceMapURL);
@@ -432,7 +433,7 @@ SDK.TextSourceMap = class {
sourceRoot += '/';
for (var i = 0; i < sourceMap.sources.length; ++i) {
var href = sourceRoot + sourceMap.sources[i];
- var url = Common.ParsedURL.completeURL(this._sourceMappingURL, href) || href;
+ var url = Common.ParsedURL.completeURL(this._baseURL, href) || href;
var source = sourceMap.sourcesContent && sourceMap.sourcesContent[i];
if (url === this._compiledURL && source)
url += Common.UIString('? [sm]');
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/inline-source-map-loading-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698