Bug 1217876 - nsIXMLHttpRequest must show the authentication prompt correctly when used by addons in e10s, r=mayhemer

This commit is contained in:
Andrea Marchesini 2016-09-06 21:21:29 +02:00
parent 16a43fb17e
commit 52b87b9b14

View File

@ -10,9 +10,12 @@
#include "HttpChannelParentListener.h"
#include "mozilla/net/HttpChannelParent.h"
#include "mozilla/Unused.h"
#include "nsIRedirectChannelRegistrar.h"
#include "nsIAuthPrompt.h"
#include "nsIAuthPrompt2.h"
#include "nsIHttpEventSink.h"
#include "nsIHttpHeaderVisitor.h"
#include "nsIRedirectChannelRegistrar.h"
#include "nsIPromptFactory.h"
#include "nsQueryObject.h"
using mozilla::Unused;
@ -132,6 +135,17 @@ HttpChannelParentListener::GetInterface(const nsIID& aIID, void **result)
return ir->GetInterface(aIID, result);
}
if (aIID.Equals(NS_GET_IID(nsIAuthPrompt)) ||
aIID.Equals(NS_GET_IID(nsIAuthPrompt2))) {
nsresult rv;
nsCOMPtr<nsIPromptFactory> wwatch =
do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
return wwatch->GetPrompt(nullptr, aIID,
reinterpret_cast<void**>(result));
}
return NS_NOINTERFACE;
}