bug 1025330 - expose the failed channel in nsIDocShell for error pages r=bz

This commit is contained in:
David Keeler
2014-06-19 13:55:55 -07:00
parent 132970a1bc
commit 79ce18aeaa
4 changed files with 49 additions and 3 deletions

View File

@@ -5778,6 +5778,19 @@ nsDocShell::SetMixedContentChannel(nsIChannel* aMixedContentChannel)
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::GetFailedChannel(nsIChannel** aFailedChannel)
{
NS_ENSURE_ARG_POINTER(aFailedChannel);
nsIDocument* doc = GetDocument();
if (!doc) {
*aFailedChannel = nullptr;
return NS_OK;
}
NS_IF_ADDREF(*aFailedChannel = doc->GetFailedChannel());
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::GetMixedContentChannel(nsIChannel **aMixedContentChannel)
{
@@ -8295,6 +8308,11 @@ nsDocShell::CreateContentViewer(const char *aContentType,
nsCOMPtr<nsIChannel> failedChannel = mFailedChannel;
nsIDocument* doc = viewer->GetDocument();
if (doc) {
doc->SetFailedChannel(failedChannel);
}
// Make sure we have a URI to set currentURI.
nsCOMPtr<nsIURI> failedURI;
if (failedChannel) {