Bug 916985 - nsDSURIContentListener::DoContent does not handle CreateContentViewer failures correctly. r=bz

This commit is contained in:
Deian Stefan 2013-09-22 19:54:53 -07:00
parent 13f1f6dfdc
commit e424826f91
2 changed files with 9 additions and 5 deletions

View File

@ -123,12 +123,14 @@ nsDSURIContentListener::DoContent(const char* aContentType,
if (rv == NS_ERROR_REMOTE_XUL) {
request->Cancel(rv);
*aAbortProcess = true;
return NS_OK;
}
if (NS_FAILED(rv)) {
// it's okay if we don't know how to handle the content
return NS_OK;
if (NS_FAILED(rv)) {
// we don't know how to handle the content
*aContentHandler = nullptr;
return rv;
}
if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI) {

View File

@ -41,9 +41,11 @@ interface nsIURIContentListener : nsISupports
* @param aContentHandler nsIStreamListener that will consume the data.
* This should be set to <code>nullptr</code> if
* this content listener can't handle the content
* type.
* type; in this case, doContent should also fail
* (i.e., return failure nsresult).
*
* @return <code>true</code> if the consumer wants to
* @return <code>true</code> if the load should
* be aborted and consumer wants to
* handle the load completely by itself. This
* causes the URI Loader do nothing else...
* <code>false</code> if the URI Loader should