зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1389738 - Remove @deprecated nsIHttpEventSink. r=mcmanus
MozReview-Commit-ID: 5TaiTc6fSLK --HG-- extra : rebase_source : acbbecb29c61bb1d84efc2fb7418806e61828003
This commit is contained in:
Родитель
487cf3d70c
Коммит
74df77800f
|
@ -12,7 +12,6 @@
|
|||
#include "nsIContentSniffer.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsMimeTypes.h"
|
||||
#include "nsIHttpEventSink.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
#include "nsIChannelEventSink.h"
|
||||
#include "nsIStreamConverterService.h"
|
||||
|
@ -131,9 +130,7 @@ nsBaseChannel::Redirect(nsIChannel *newChannel, uint32_t redirectFlags,
|
|||
}
|
||||
}
|
||||
|
||||
// Notify consumer, giving chance to cancel redirect. For backwards compat,
|
||||
// we support nsIHttpEventSink if we are an HTTP channel and if this is not
|
||||
// an internal redirect.
|
||||
// Notify consumer, giving chance to cancel redirect.
|
||||
|
||||
RefPtr<nsAsyncRedirectVerifyHelper> redirectCallbackHelper =
|
||||
new nsAsyncRedirectVerifyHelper();
|
||||
|
@ -158,23 +155,6 @@ nsBaseChannel::Redirect(nsIChannel *newChannel, uint32_t redirectFlags,
|
|||
nsresult
|
||||
nsBaseChannel::ContinueRedirect()
|
||||
{
|
||||
// Backwards compat for non-internal redirects from a HTTP channel.
|
||||
// XXX Is our http channel implementation going to derive from nsBaseChannel?
|
||||
// If not, this code can be removed.
|
||||
if (!(mRedirectFlags & nsIChannelEventSink::REDIRECT_INTERNAL)) {
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface();
|
||||
if (httpChannel) {
|
||||
nsCOMPtr<nsIHttpEventSink> httpEventSink;
|
||||
GetCallback(httpEventSink);
|
||||
if (httpEventSink) {
|
||||
nsresult rv = httpEventSink->OnRedirect(httpChannel, mRedirectChannel);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure to do this _after_ making all the OnChannelRedirect calls
|
||||
mRedirectChannel->SetOriginalURI(OriginalURI());
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "mozilla/Unused.h"
|
||||
#include "nsIAuthPrompt.h"
|
||||
#include "nsIAuthPrompt2.h"
|
||||
#include "nsIHttpEventSink.h"
|
||||
#include "nsIHttpHeaderVisitor.h"
|
||||
#include "nsIRedirectChannelRegistrar.h"
|
||||
#include "nsIPromptFactory.h"
|
||||
|
@ -123,7 +122,6 @@ NS_IMETHODIMP
|
|||
HttpChannelParentListener::GetInterface(const nsIID& aIID, void **result)
|
||||
{
|
||||
if (aIID.Equals(NS_GET_IID(nsIChannelEventSink)) ||
|
||||
aIID.Equals(NS_GET_IID(nsIHttpEventSink)) ||
|
||||
aIID.Equals(NS_GET_IID(nsINetworkInterceptController)) ||
|
||||
aIID.Equals(NS_GET_IID(nsIRedirectResultListener)))
|
||||
{
|
||||
|
|
|
@ -18,7 +18,6 @@ XPIDL_SOURCES += [
|
|||
'nsIHttpChannelAuthProvider.idl',
|
||||
'nsIHttpChannelChild.idl',
|
||||
'nsIHttpChannelInternal.idl',
|
||||
'nsIHttpEventSink.idl',
|
||||
'nsIHttpHeaderVisitor.idl',
|
||||
'nsIHttpProtocolHandler.idl',
|
||||
'nsIRaceCacheWithNetwork.idl',
|
||||
|
|
|
@ -76,7 +76,6 @@
|
|||
#include "nsICancelable.h"
|
||||
#include "nsIHttpChannelAuthProvider.h"
|
||||
#include "nsIHttpChannelInternal.h"
|
||||
#include "nsIHttpEventSink.h"
|
||||
#include "nsIPrompt.h"
|
||||
#include "nsInputStreamPump.h"
|
||||
#include "nsURLHelper.h"
|
||||
|
@ -3014,18 +3013,6 @@ nsHttpChannel::OpenRedirectChannel(nsresult rv)
|
|||
// i.e. after all sinks had been notified
|
||||
mRedirectChannel->SetOriginalURI(mOriginalURI);
|
||||
|
||||
// And now, notify observers the deprecated way
|
||||
nsCOMPtr<nsIHttpEventSink> httpEventSink;
|
||||
GetCallback(httpEventSink);
|
||||
if (httpEventSink) {
|
||||
// NOTE: nsIHttpEventSink is only used for compatibility with pre-1.8
|
||||
// versions.
|
||||
rv = httpEventSink->OnRedirect(this, mRedirectChannel);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
// open new channel
|
||||
if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
|
||||
MOZ_ASSERT(!mListenerContext, "mListenerContext should be null!");
|
||||
|
@ -5793,16 +5780,6 @@ nsHttpChannel::ContinueProcessRedirection(nsresult rv)
|
|||
// i.e. after all sinks had been notified
|
||||
mRedirectChannel->SetOriginalURI(mOriginalURI);
|
||||
|
||||
// And now, the deprecated way
|
||||
nsCOMPtr<nsIHttpEventSink> httpEventSink;
|
||||
GetCallback(httpEventSink);
|
||||
if (httpEventSink) {
|
||||
// NOTE: nsIHttpEventSink is only used for compatibility with pre-1.8
|
||||
// versions.
|
||||
rv = httpEventSink->OnRedirect(this, mRedirectChannel);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
}
|
||||
// XXX we used to talk directly with the script security manager, but that
|
||||
// should really be handled by the event sink implementation.
|
||||
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIChannel;
|
||||
interface nsIHttpChannel;
|
||||
interface nsIURI;
|
||||
|
||||
/**
|
||||
* nsIHttpEventSink
|
||||
*
|
||||
* Implement this interface to receive control over various HTTP events. The
|
||||
* HTTP channel will try to get this interface from its notificationCallbacks
|
||||
* attribute, and if it doesn't find it there it will look for it from its
|
||||
* loadGroup's notificationCallbacks attribute.
|
||||
*
|
||||
* These methods are called before onStartRequest, and should be handled
|
||||
* SYNCHRONOUSLY.
|
||||
*
|
||||
* @deprecated Newly written code should use nsIChannelEventSink instead of this
|
||||
* interface.
|
||||
*/
|
||||
[scriptable, uuid(9475a6af-6352-4251-90f9-d65b1cd2ea15)]
|
||||
interface nsIHttpEventSink : nsISupports
|
||||
{
|
||||
/**
|
||||
* Called when a redirect occurs due to a HTTP response like 302. The
|
||||
* redirection may be to a non-http channel.
|
||||
*
|
||||
* @return failure cancels redirect
|
||||
*/
|
||||
[must_use] void onRedirect(in nsIHttpChannel httpChannel,
|
||||
in nsIChannel newChannel);
|
||||
};
|
|
@ -286,8 +286,6 @@ loadListener.prototype = {
|
|||
Ci.nsIStreamListener,
|
||||
Ci.nsIChannelEventSink,
|
||||
Ci.nsIInterfaceRequestor,
|
||||
// See FIXME comment below.
|
||||
Ci.nsIHttpEventSink,
|
||||
Ci.nsIProgressEventSink
|
||||
]),
|
||||
|
||||
|
@ -338,9 +336,6 @@ loadListener.prototype = {
|
|||
return this.QueryInterface(aIID);
|
||||
},
|
||||
|
||||
// FIXME: bug 253127
|
||||
// nsIHttpEventSink
|
||||
onRedirect(aChannel, aNewChannel) {},
|
||||
// nsIProgressEventSink
|
||||
onProgress(aRequest, aContext, aProgress, aProgressMax) {},
|
||||
onStatus(aRequest, aContext, aStatus, aStatusArg) {}
|
||||
|
|
Загрузка…
Ссылка в новой задаче