Skip to content

Commit

Permalink
Bug 1087442 - Attach LoadInfo inside each individual ProtocolHandler …
Browse files Browse the repository at this point in the history
…- chrome/ changes (r=sicking)
  • Loading branch information
Christoph Kerschbaumer committed Dec 12, 2014
1 parent 0175393 commit 2aeee3c
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions chrome/nsChromeProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ nsChromeProtocolHandler::NewURI(const nsACString &aSpec,

NS_IMETHODIMP
nsChromeProtocolHandler::NewChannel2(nsIURI* aURI,
nsILoadInfo* aLoadinfo,
nsILoadInfo* aLoadInfo,
nsIChannel** aResult)
{
nsresult rv;
Expand Down Expand Up @@ -147,12 +147,22 @@ nsChromeProtocolHandler::NewChannel2(nsIURI* aURI,
return rv;
}

nsCOMPtr<nsIIOService> ioServ(do_GetIOService(&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(result),
resolvedURI,
aLoadInfo);
}
else {
nsCOMPtr<nsIIOService> ioServ(do_GetIOService(&rv));
NS_ENSURE_SUCCESS(rv, rv);
rv = ioServ->NewChannelFromURI(resolvedURI, getter_AddRefs(result));
}
NS_ENSURE_SUCCESS(rv, rv);

rv = ioServ->NewChannelFromURI(resolvedURI, getter_AddRefs(result));
if (NS_FAILED(rv)) return rv;

#ifdef DEBUG
nsCOMPtr<nsIFileChannel> fileChan(do_QueryInterface(result));
if (fileChan) {
Expand Down

0 comments on commit 2aeee3c

Please sign in to comment.