Backed out changeset 1e6392dd7c14 due to build bustage.
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 14 Jul 2011 15:21:42 -0700
changeset 72849 0364084dec4d65ca568e948a3202f01623dd91c0
parent 72847 1e6392dd7c146865f686ccecb0aa23281b10eb51
child 72850 90b7ea6f700a5d779ddd095f48be5cebc5ca5817
push id20776
push usereakhgari@mozilla.com
push dateFri, 15 Jul 2011 12:13:35 +0000
treeherdermozilla-central@9349ae9094f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone8.0a1
backs out1e6392dd7c146865f686ccecb0aa23281b10eb51
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
Backed out changeset 1e6392dd7c14 due to build bustage.
js/src/xpconnect/loader/mozJSSubScriptLoader.cpp
--- a/js/src/xpconnect/loader/mozJSSubScriptLoader.cpp
+++ b/js/src/xpconnect/loader/mozJSSubScriptLoader.cpp
@@ -138,17 +138,17 @@ mozJSSubScriptLoader::ReadScript(nsIURI 
     nsCString buf;
     rv = NS_ReadInputStreamToString(instream, buf, len);
     if (NS_FAILED(rv))
         return rv;
 
     /* we can't hold onto jsPrincipals as a module var because the
      * JSPRINCIPALS_DROP macro takes a JSContext, which we won't have in the
      * destructor */
-    rv = principal->GetJSPrincipals(cx, &jsPrincipals);
+    rv = mSystemPrincipal->GetJSPrincipals(cx, &jsPrincipals);
     if (NS_FAILED(rv) || !jsPrincipals) {
         return ReportError(cx, LOAD_ERROR_NOPRINCIPALS);
     }
 
     /* set our own error reporter so we can report any bad things as catchable
      * exceptions, including the source/line number */
     er = JS_SetErrorReporter(cx, mozJSLoaderErrorReporter);
 
@@ -297,34 +297,23 @@ mozJSSubScriptLoader::LoadSubScript (con
         }
 #ifdef DEBUG_rginda
         fprintf (stderr, "\n");
 #endif  
     }
 
     // Remember an object out of the calling compartment so that we
     // can properly wrap the result later.
-    nsCOMPtr<nsIPrincipal> principal = mSystemPrincipal;
     JSObject *result_obj = target_obj;
     target_obj = JS_FindCompilationScope(cx, target_obj);
     if (!target_obj) return NS_ERROR_FAILURE;
+#ifdef DEBUG_rginda
     if (target_obj != result_obj)
-    {
-        nsCOMPtr<nsIScriptSecurityManager> secman =
-            do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID);
-        if (!secman)
-            return NS_ERROR_FAILURE;
-
-        rv = secman->GetObjectPrincipal(cx, target_obj, getter_AddRefs(principal));
-        NS_ENSURE_SUCCESS(rv, rv);
-
-#ifdef DEBUG_rginda
         fprintf (stderr, "Final global: %p\n", target_obj);
 #endif
-    }
 
     JSAutoEnterCompartment ac;
     if (!ac.enter(cx, target_obj))
         return NS_ERROR_UNEXPECTED;
 
     /* load up the url.  From here on, failures are reflected as ``custom''
      * js exceptions */
     nsCOMPtr<nsIURI> uri;