зеркало из https://github.com/mozilla/gecko-dev.git
Bug 904559 - Veto redirect when target channel doesn't implement nsIParentRedirectingChannel. r=jduell
This commit is contained in:
Родитель
e420e52db5
Коммит
de1eeb4be3
|
@ -166,6 +166,14 @@ HttpChannelParentListener::AsyncOnChannelRedirect(
|
|||
{
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIParentRedirectingChannel> activeRedirectingChannel =
|
||||
do_QueryInterface(mNextListener);
|
||||
if (!activeRedirectingChannel) {
|
||||
NS_ERROR("Channel got a redirect response, but doesn't implement "
|
||||
"nsIParentRedirectingChannel to handle it.");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
// Register the new channel and obtain id for it
|
||||
nsCOMPtr<nsIRedirectChannelRegistrar> registrar =
|
||||
do_GetService("@mozilla.org/redirectchannelregistrar;1", &rv);
|
||||
|
@ -176,13 +184,6 @@ HttpChannelParentListener::AsyncOnChannelRedirect(
|
|||
|
||||
LOG(("Registered %p channel under id=%d", newChannel, mRedirectChannelId));
|
||||
|
||||
nsCOMPtr<nsIParentRedirectingChannel> activeRedirectingChannel =
|
||||
do_QueryInterface(mNextListener);
|
||||
if (!activeRedirectingChannel) {
|
||||
NS_RUNTIMEABORT("Channel got a redirect response, but doesn't implement "
|
||||
"nsIParentRedirectingChannel to handle it.");
|
||||
}
|
||||
|
||||
return activeRedirectingChannel->StartRedirect(mRedirectChannelId,
|
||||
newChannel,
|
||||
redirectFlags,
|
||||
|
|
Загрузка…
Ссылка в новой задаче