Bug 1356412: Part 1 - Remove subscript loader path mangling. r=mccr8
authorKris Maglione <maglione.k@gmail.com>
Fri, 02 Nov 2018 14:45:12 -0700
changeset 444425 9b4bf02afd60b4bec3e7d2cd8b3179e8b63faa3b
parent 444424 56bb430315885b97469a28aef13c2f48bc6fc276
child 444426 00f962601b8b2ce44ce6e26eed1bc82fd0f130a4
push id109589
push usermaglione.k@gmail.com
push dateMon, 05 Nov 2018 19:20:12 +0000
treeherdermozilla-inbound@00f962601b8b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1356412
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1356412: Part 1 - Remove subscript loader path mangling. r=mccr8 This was only ever useful before we had compartment-based security isolation. Now it is just a pervasive nuisance. Differential Revision: https://phabricator.services.mozilla.com/D10795
devtools/client/shared/components/Frame.js
devtools/client/shared/components/StackTrace.js
js/xpconnect/loader/mozJSSubScriptLoader.cpp
--- a/devtools/client/shared/components/Frame.js
+++ b/devtools/client/shared/components/Frame.js
@@ -118,22 +118,17 @@ class Frame extends Component {
 
     if (this.state && this.state.isSourceMapped && this.state.frame) {
       frame = this.state.frame;
       isSourceMapped = this.state.isSourceMapped;
     } else {
       frame = this.props.frame;
     }
 
-    // If the resource was loaded by browser-loader.js, `frame.source` looks like:
-    // resource://devtools/shared/base-loader.js -> resource://devtools/path/to/file.js .
-    // What's needed is only the last part after " -> ".
-    const source = frame.source
-      ? String(frame.source).split(" -> ").pop()
-      : "";
+    const source = frame.source || "";
     const line = frame.line != void 0 ? Number(frame.line) : null;
     const column = frame.column != void 0 ? Number(frame.column) : null;
 
     const { short, long, host } = getSourceNames(source);
     const unicodeShort = getUnicodeUrlPath(short);
     const unicodeLong  = getUnicodeUrl(long);
     const unicodeHost  = host ? getUnicodeHostname(host) : "";
 
--- a/devtools/client/shared/components/StackTrace.js
+++ b/devtools/client/shared/components/StackTrace.js
@@ -52,17 +52,17 @@ class StackTrace extends Component {
     stacktrace.forEach((s, i) => {
       if (s.asyncCause) {
         frames.push("\t", AsyncFrame({
           key: `${i}-asyncframe`,
           asyncCause: s.asyncCause,
         }), "\n");
       }
 
-      const source = s.filename.split(" -> ").pop();
+      const source = s.filename;
       frames.push("\t", Frame({
         key: `${i}-frame`,
         frame: {
           functionDisplayName: s.functionName,
           source,
           line: s.lineNumber,
           column: s.columnNumber,
         },
--- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
@@ -693,35 +693,16 @@ mozJSSubScriptLoader::DoLoadSubScriptWit
     }
 
     rv = uri->GetScheme(scheme);
     if (NS_FAILED(rv)) {
         ReportError(cx, LOAD_ERROR_NOSCHEME, uri);
         return NS_OK;
     }
 
-    if (!scheme.EqualsLiteral("chrome") && !scheme.EqualsLiteral("app") &&
-        !scheme.EqualsLiteral("blob")) {
-        // This might be a URI to a local file, though!
-        nsCOMPtr<nsIURI> innerURI = NS_GetInnermostURI(uri);
-        nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(innerURI);
-        if (!fileURL) {
-            ReportError(cx, LOAD_ERROR_URI_NOT_LOCAL, uri);
-            return NS_OK;
-        }
-
-        // For file URIs prepend the filename with the filename of the
-        // calling script, and " -> ". See bug 418356.
-        nsAutoCString tmp(filename.get());
-        tmp.AppendLiteral(" -> ");
-        tmp.Append(uriStr);
-
-        uriStr = tmp;
-    }
-
     // Suppress caching if we're compiling as content or if we're loading a
     // blob: URI.
     bool useCompilationScope = false;
     auto* principal = BasePrincipal::Cast(GetObjectPrincipal(targetObj));
     bool isSystem = principal->Is<SystemPrincipal>();
     if (!isSystem && principal->Is<ContentPrincipal>()) {
         auto* content = principal->As<ContentPrincipal>();