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

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js

Issue 1583383003: [DevTools] Send source map content from frontend to backend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blackbox-inline-source-map
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
index 6584ca8213350e12216a1ca331fcaa21ef8079c4..5dcab835bae324b0ac2fea4f091760109df50f72 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
@@ -49,7 +49,7 @@ WebInspector.CompilerScriptMapping = function(debuggerModel, workspace, networkM
/** @type {!Object.<string, !WebInspector.SourceMap>} */
this._sourceMapForSourceMapURL = {};
- /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>} */
+ /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap, string=)>>} */
this._pendingSourceMapLoadingCallbacks = {};
/** @type {!Object.<string, !WebInspector.SourceMap>} */
this._sourceMapForScriptId = {};
@@ -324,16 +324,17 @@ WebInspector.CompilerScriptMapping.prototype = {
return;
}
- pendingCallbacks = [callback];
+ pendingCallbacks = [ sourceMapContentLoaded.bind(this), callback ];
this._pendingSourceMapLoadingCallbacks[sourceMapURL] = pendingCallbacks;
WebInspector.SourceMap.load(sourceMapURL, scriptURL, sourceMapLoaded.bind(this));
/**
* @param {?WebInspector.SourceMap} sourceMap
+ * @param {string=} content
* @this {WebInspector.CompilerScriptMapping}
*/
- function sourceMapLoaded(sourceMap)
+ function sourceMapLoaded(sourceMap, content)
{
var url = /** @type {string} */ (sourceMapURL);
var callbacks = this._pendingSourceMapLoadingCallbacks[url];
@@ -343,7 +344,19 @@ WebInspector.CompilerScriptMapping.prototype = {
if (sourceMap)
this._sourceMapForSourceMapURL[url] = sourceMap;
for (var i = 0; i < callbacks.length; ++i)
- callbacks[i](sourceMap);
+ callbacks[i](sourceMap, content);
+ }
+
+ /**
+ * @param {?WebInspector.SourceMap} sourceMap
+ * @param {string} content
+ * @this {WebInspector.CompilerScriptMapping}
+ */
+ function sourceMapContentLoaded(sourceMap, content)
+ {
+ if (!content)
+ return;
+ this._debuggerModel.setSourceMapContent(script.scriptId, scriptSourceMapURL, content);
}
},

Powered by Google App Engine
This is Rietveld 408576698