Bug 1087442 - Attach LoadInfo inside each individual ProtocolHandler - browser/ changes (r=sicking)

This commit is contained in:
Christoph Kerschbaumer 2014-12-12 09:08:27 -08:00
parent 00ff1ea758
commit 0783aa8189

View File

@ -153,8 +153,22 @@ AboutRedirector::NewChannel(nsIURI* aURI,
for (int i = 0; i < kRedirTotal; i++) {
if (!strcmp(path.get(), kRedirMap[i].id)) {
nsCOMPtr<nsIChannel> tempChannel;
rv = ioService->NewChannel(nsDependentCString(kRedirMap[i].url),
nullptr, nullptr, getter_AddRefs(tempChannel));
nsCOMPtr<nsIURI> tempURI;
rv = NS_NewURI(getter_AddRefs(tempURI),
nsDependentCString(kRedirMap[i].url));
NS_ENSURE_SUCCESS(rv, rv);
// Bug 1087720 (and Bug 1099296):
// Once all callsites have been updated to call NewChannel2()
// instead of NewChannel() we should have a non-null loadInfo
// consistently. Until then we have to branch on the loadInfo.
if (aLoadInfo) {
rv = NS_NewChannelInternal(getter_AddRefs(tempChannel),
tempURI,
aLoadInfo);
}
else {
rv = ioService->NewChannelFromURI(tempURI, getter_AddRefs(tempChannel));
}
NS_ENSURE_SUCCESS(rv, rv);
tempChannel->SetOriginalURI(aURI);