Abandon prototypes for failed overlays (fixes bug 320652) r=mrbkap sr=dbaron

This commit is contained in:
neil%parkwaycc.co.uk 2005-12-23 10:48:34 +00:00
Родитель 98c737bbd9
Коммит df831828e8
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -667,6 +667,10 @@ nsXULDocument::SetPrincipal(nsIPrincipal *aPrincipal)
void
nsXULDocument::EndLoad()
{
// This can happen if an overlay fails to load
if (!mCurrentPrototype)
return;
nsresult rv;
// Whack the prototype document into the cache so that the next
@ -2737,6 +2741,9 @@ nsXULDocument::LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic, PRBool* aSho
nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mDocumentLoadGroup);
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();
@ -3080,6 +3087,9 @@ nsXULDocument::ResumeWalk()
nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mDocumentLoadGroup);
rv = NS_OpenURI(listener, nsnull, uri, 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();