From c53d8f1934164067ba551aa66c01c508d558ac88 Mon Sep 17 00:00:00 2001 From: "ben%bengoodger.com" Date: Sun, 13 Feb 2005 04:49:59 +0000 Subject: [PATCH] 274712 - make sure app starts ! git-svn-id: svn://10.0.0.236/branches/PREFERENCES_20050101_BRANCH@169165 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/xul/document/src/nsXULDocument.cpp | 17 ++++++++++++++--- .../content/xul/document/src/nsXULDocument.h | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index bbd41082320..9a912e919f6 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -2676,14 +2676,17 @@ nsXULDocument::LoadOverlay(const nsAString& aURL, nsIObserver* aObserver) if (!obs) mOverlayLoadObservers.Put(uri, aObserver); } - return LoadOverlayInternal(uri, PR_TRUE); + PRBool shouldReturn; + return LoadOverlayInternal(uri, PR_TRUE, &shouldReturn); } nsresult -nsXULDocument::LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic) +nsXULDocument::LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic, PRBool* aShouldReturn) { nsresult rv; + *aShouldReturn = PR_FALSE; + nsCOMPtr secMan = do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); @@ -2748,6 +2751,7 @@ nsXULDocument::LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic) // prototype overlay load's completion. When the content // sink completes, it will trigger an EndLoad(), which'll // wind us back up here, in ResumeWalk(). + *aShouldReturn = PR_TRUE; return NS_OK; } @@ -2761,6 +2765,8 @@ nsXULDocument::LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic) PR_LOG(gXULLog, PR_LOG_DEBUG, ("xul: overlay was cached")); + // If this is a dynamic overlay and we have the prototype in the chrome + // cache already, we must manually call ResumeWalk. if (aIsDynamic) return ResumeWalk(); } @@ -2816,6 +2822,8 @@ nsXULDocument::LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic) // overlay load's completion. When the content sink // completes, it will trigger an EndLoad(), which'll wind // us back in ResumeWalk(). + if (!aIsDynamic) + *aShouldReturn = PR_TRUE; } return NS_OK; } @@ -3012,7 +3020,10 @@ nsXULDocument::ResumeWalk() mUnloadedOverlays->RemoveElementAt(count - 1); - return LoadOverlayInternal(uri, PR_FALSE); + PRBool shouldReturn; + rv = LoadOverlayInternal(uri, PR_FALSE, &shouldReturn); + if (shouldReturn || NS_FAILED(rv)) + return rv; } // If we get here, there is nothing left for us to walk. The content diff --git a/mozilla/content/xul/document/src/nsXULDocument.h b/mozilla/content/xul/document/src/nsXULDocument.h index ebf2e762fe3..69d9ecad054 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.h +++ b/mozilla/content/xul/document/src/nsXULDocument.h @@ -207,7 +207,8 @@ protected: nsIPrincipal* aDocumentPrincipal, nsIParser** aResult); - nsresult LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic); + nsresult + LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic, PRBool* aShouldReturn); nsresult ApplyPersistentAttributes(); nsresult ApplyPersistentAttributesToElements(nsIRDFResource* aResource,