bug #169583 (r=jst, sr=darin) URILoader should allow nsIContentHandler::DoContent() to fail...

This commit is contained in:
rpotts%netscape.com 2002-09-24 19:53:43 +00:00
Родитель 3a3004fd75
Коммит dc675a9675
6 изменённых файлов: 28 добавлений и 2 удалений

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

@ -3990,6 +3990,9 @@ nsImapService::HandleContent(const char * aContentType, const char * aCommand, n
rv = messengerWindowService->OpenMessengerWindowWithUri("mail:3pane", uriStr.get(), nsMsgKey_None);
NS_ENSURE_SUCCESS(rv, rv);
}
} else {
// The content-type was not x-application-imapfolder
return NS_ERROR_WONT_HANDLE_CONTENT;
}
return rv;

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

@ -1647,6 +1647,9 @@ nsNntpService::HandleContent(const char * aContentType, const char * aCommand, n
NS_ENSURE_SUCCESS(rv, rv);
}
}
} else {
// The content-type was not x-application-newsgroup.
return NS_ERROR_WONT_HANDLE_CONTENT;
}
return rv;

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

@ -49,3 +49,9 @@ interface nsIContentHandler : nsISupports
in nsIRequest aRequest);
};
%{C++
#define NS_ERROR_WONT_HANDLE_CONTENT NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_URILOADER, 1)
%}

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

@ -57,7 +57,6 @@
#include "nsIMultiPartChannel.h"
#include "netCore.h"
#include "nsCRT.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeOwner.h"
@ -864,8 +863,19 @@ NS_IMETHODIMP nsURILoader::DispatchContent(const char * aContentType,
aContentHandler = do_CreateInstance(handlerContractID.get(), &rv);
if (NS_SUCCEEDED(rv)) // we did indeed have a content handler for this type!! yippee...
{
rv = aContentHandler->HandleContent(aContentType, "view", aSrcWindowContext, request);
rv = aContentHandler->HandleContent(aContentType, "view", aSrcWindowContext, request);
if (rv != NS_ERROR_WONT_HANDLE_CONTENT) {
*aAbortProcess = PR_TRUE;
// The content handler has unexpectedly failed. Cancel the request
// just in case the handler didn't...
if (NS_FAILED(rv)) {
request->Cancel(rv);
}
}
// If WONT_HANDLE_CONTENT is returned -- do not abort. Just return the
// failure and keep looking for another consumer (ie. the unknown
// content handler)...
}
return rv;

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

@ -88,6 +88,7 @@
#define NS_ERROR_MODULE_SECURITY 21
#define NS_ERROR_MODULE_DOM_XPATH 22
#define NS_ERROR_MODULE_DOM_RANGE 23
#define NS_ERROR_MODULE_URILOADER 24
/* NS_ERROR_MODULE_GENERAL should be used by modules that do not
* care if return code values overlap. Callers of methods that

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

@ -161,6 +161,9 @@ nsInstallTrigger::HandleContent(const char * aContentType,
}
}
}
} else {
// The content-type was not application/x-xpinstall
return NS_ERROR_WONT_HANDLE_CONTENT;
}
return NS_ERROR_FAILURE;