Bakout of fix for bug 606058 due to oranges. a=backout
authorJohnny Stenback <jst@mozilla.com>
Fri, 19 Nov 2010 23:16:19 -0800
changeset 57944 37b59596c539b9fd75b18b555282664799d63faa
parent 57942 9892fb9d7141c3bbd215673fba3b793eb963f9ca (current diff)
parent 57943 3077e1c11fb6a465333df44c63ad3f14021bdd55 (diff)
child 57945 baa6cc2f72e48cbb22e88bd574f5ef643f926a9c
push idunknown
push userunknown
push dateunknown
reviewersbackout
bugs606058
milestone2.0b8pre
Bakout of fix for bug 606058 due to oranges. a=backout
--- a/content/xul/document/src/nsXULDocument.cpp
+++ b/content/xul/document/src/nsXULDocument.cpp
@@ -2771,28 +2771,17 @@ nsXULDocument::LoadOverlayInternal(nsIUR
         if (! parserObserver)
             return NS_ERROR_OUT_OF_MEMORY;
 
         NS_ADDREF(parserObserver);
         parser->Parse(aURI, parserObserver);
         NS_RELEASE(parserObserver);
 
         nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mDocumentLoadGroup);
-        nsCOMPtr<nsIChannel> channel;
-        rv = NS_NewChannel(getter_AddRefs(channel), aURI);
-        NS_ENSURE_SUCCESS(rv, rv);
-
-        // Set the owner of the channel to be our principal so that
-        // the overlay's JSObjects etc end up being created with the
-        // right principal and in the correct compartment.
-        channel->SetOwner(NodePrincipal());
-
-        rv = channel->AsyncOpen(listener, nsnull);
-        NS_ENSURE_SUCCESS(rv, rv);
-
+        rv = NS_OpenURI(listener, nsnull, aURI, nsnull, group);
         if (NS_FAILED(rv)) {
             // Abandon this prototype
             mCurrentPrototype = nsnull;
 
             // The parser won't get an OnStartRequest and
             // OnStopRequest, so it needs a Terminate.
             parser->Terminate();
 
@@ -4538,17 +4527,17 @@ nsXULDocument::ParserObserver::OnStartRe
     if (mPrototype) {
         nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
         nsIScriptSecurityManager* secMan = nsContentUtils::GetSecurityManager();
         if (channel && secMan) {
             nsCOMPtr<nsIPrincipal> principal;
             secMan->GetChannelPrincipal(channel, getter_AddRefs(principal));
 
             // Failure there is ok -- it'll just set a (safe) null principal
-            mPrototype->SetDocumentPrincipal(principal);
+            mPrototype->SetDocumentPrincipal(principal);            
         }
 
         // Make sure to avoid cycles
         mPrototype = nsnull;
     }
         
     return NS_OK;
 }