Bug 537120 part 2: be more conservative as far as application of converters goes. Patch by Boris Zbarsky <bzbarsky@mit.edu>, r=jst, a1.9.0.next=dveditz
git-svn-id: svn://10.0.0.236/trunk@260877 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
bdbbf8c469
commit
997700b5a5
@ -440,7 +440,8 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports *
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we aren't allowed to try other listeners, we're done here.
|
// If we aren't allowed to try other listeners, just skip through to
|
||||||
|
// trying to convert the data.
|
||||||
if (!(mFlags & nsIURILoader::DONT_RETARGET)) {
|
if (!(mFlags & nsIURILoader::DONT_RETARGET)) {
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -519,26 +520,16 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports *
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
LOG((" DONT_RETARGET flag set, so skipped over random other content "
|
||||||
|
"listeners and content handlers"));
|
||||||
}
|
}
|
||||||
} else if (mFlags & nsIURILoader::DONT_RETARGET) {
|
|
||||||
// External handling was forced, but we must not retarget
|
|
||||||
// -> abort
|
|
||||||
LOG((" External handling forced, but not allowed to retarget -> aborting"));
|
|
||||||
return NS_ERROR_WONT_HANDLE_CONTENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_ASSERTION(!m_targetStreamListener,
|
|
||||||
"If we found a listener, why are we not using it?");
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Fifth step: If no listener prefers this type, see if any stream
|
// Fifth step: If no listener prefers this type, see if any stream
|
||||||
// converters exist to transform this content type into
|
// converters exist to transform this content type into
|
||||||
// some other.
|
// some other.
|
||||||
//
|
//
|
||||||
|
|
||||||
// We always want to do this, since even content being forced to
|
|
||||||
// be handled externally may need decoding (eg via the unknown
|
|
||||||
// content decoder).
|
|
||||||
// Don't do this if the server sent us a MIME type of "*/*" because they saw
|
// Don't do this if the server sent us a MIME type of "*/*" because they saw
|
||||||
// it in our Accept header and got confused.
|
// it in our Accept header and got confused.
|
||||||
// XXXbz have to be careful here; may end up in some sort of bizarre infinite
|
// XXXbz have to be careful here; may end up in some sort of bizarre infinite
|
||||||
@ -554,9 +545,14 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports *
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_ASSERTION(!m_targetStreamListener,
|
||||||
|
"If we found a listener, why are we not using it?");
|
||||||
|
|
||||||
if (mFlags & nsIURILoader::DONT_RETARGET) {
|
if (mFlags & nsIURILoader::DONT_RETARGET) {
|
||||||
LOG((" Listener not interested and no stream converter exists, and retargeting disallowed -> aborting"));
|
LOG((" External handling forced or (listener not interested and no "
|
||||||
|
"stream converter exists), and retargeting disallowed -> aborting"));
|
||||||
return NS_ERROR_WONT_HANDLE_CONTENT;
|
return NS_ERROR_WONT_HANDLE_CONTENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user