Bug 1166048 - Part 1: Do not set the sourceRoot of a source map that has all source contents embedded. r=jlongster, a=sylvestre
authorNick Fitzgerald <fitzgen@gmail.com>
Wed, 08 Jul 2015 14:40:14 -0700
changeset 275338 7c965ad0f7e7c0dc40343d02a13b653e5ee4ff65
parent 275337 357649efb20886f8b46fd63aa44f7711667ae9c1
child 275339 c423b47c384b4a2b3cd55924c125c5e524514205
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlongster, sylvestre
bugs1166048
milestone40.0
Bug 1166048 - Part 1: Do not set the sourceRoot of a source map that has all source contents embedded. r=jlongster, a=sylvestre
toolkit/devtools/server/actors/utils/TabSources.js
--- a/toolkit/devtools/server/actors/utils/TabSources.js
+++ b/toolkit/devtools/server/actors/utils/TabSources.js
@@ -442,16 +442,22 @@ TabSources.prototype = {
     this._sourceMapCache[aAbsSourceMapURL] = fetching;
     return fetching;
   },
 
   /**
    * Sets the source map's sourceRoot to be relative to the source map url.
    */
   _setSourceMapRoot: function (aSourceMap, aAbsSourceMapURL, aScriptURL) {
+    // No need to do this fiddling if we won't be fetching any sources over the
+    // wire.
+    if (aSourceMap.hasContentsOfAllSources()) {
+      return;
+    }
+
     const base = this._dirname(
       aAbsSourceMapURL.indexOf("data:") === 0
         ? aScriptURL
         : aAbsSourceMapURL);
     aSourceMap.sourceRoot = aSourceMap.sourceRoot
       ? this._normalize(aSourceMap.sourceRoot, base)
       : base;
   },