Bug 1213150 - Part 3: Remove nsIInterceptedChannel.isNavigation; r=jdm

This commit is contained in:
Ehsan Akhgari 2015-10-06 22:52:43 -04:00
parent 3163858808
commit 23271d86e1
6 changed files with 8 additions and 41 deletions

View File

@ -13,11 +13,9 @@ using namespace mozilla::net;
NS_IMPL_ISUPPORTS(InterceptedJARChannel, nsIInterceptedChannel)
InterceptedJARChannel::InterceptedJARChannel(nsJARChannel* aChannel,
nsINetworkInterceptController* aController,
bool aIsNavigation)
nsINetworkInterceptController* aController)
: mController(aController)
, mChannel(aChannel)
, mIsNavigation(aIsNavigation)
{
}
@ -28,13 +26,6 @@ InterceptedJARChannel::GetResponseBody(nsIOutputStream** aStream)
return NS_OK;
}
NS_IMETHODIMP
InterceptedJARChannel::GetIsNavigation(bool* aIsNavigation)
{
*aIsNavigation = mIsNavigation;
return NS_OK;
}
NS_IMETHODIMP
InterceptedJARChannel::GetInternalContentPolicyType(nsContentPolicyType* aPolicyType)
{

View File

@ -44,14 +44,10 @@ class InterceptedJARChannel : public nsIInterceptedChannel
// The content type of the synthesized response.
nsCString mContentType;
// Wether this intercepted channel was performing a navigation.
bool mIsNavigation;
virtual ~InterceptedJARChannel() {};
public:
InterceptedJARChannel(nsJARChannel* aChannel,
nsINetworkInterceptController* aController,
bool aIsNavigation);
nsINetworkInterceptController* aController);
NS_DECL_ISUPPORTS
NS_DECL_NSIINTERCEPTEDCHANNEL

View File

@ -968,9 +968,8 @@ nsJARChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctx)
NS_GET_IID(nsINetworkInterceptController),
getter_AddRefs(controller));
bool isNavigation = mLoadFlags & LOAD_DOCUMENT_URI;
nsRefPtr<InterceptedJARChannel> intercepted =
new InterceptedJARChannel(this, controller, isNavigation);
new InterceptedJARChannel(this, controller);
intercepted->NotifyController();
// We get the JAREntry so we can infer the content type later in case

View File

@ -27,7 +27,7 @@ class ChannelInfo;
* which do not implement nsIChannel.
*/
[scriptable, uuid(91d430cc-7e04-4df1-a3c0-879fa30f7ab9)]
[scriptable, uuid(6be00c37-2e85-42ee-b53c-e6508ce4cef0)]
interface nsIInterceptedChannel : nsISupports
{
/**
@ -72,11 +72,6 @@ interface nsIInterceptedChannel : nsISupports
*/
readonly attribute nsIChannel channel;
/**
* True if the underlying request was caused by a navigation attempt.
*/
readonly attribute bool isNavigation;
/**
* This method allows to override the channel info for the channel.
*/

View File

@ -30,10 +30,8 @@ DoAddCacheEntryHeaders(nsHttpChannel *self,
NS_IMPL_ISUPPORTS(InterceptedChannelBase, nsIInterceptedChannel)
InterceptedChannelBase::InterceptedChannelBase(nsINetworkInterceptController* aController,
bool aIsNavigation)
InterceptedChannelBase::InterceptedChannelBase(nsINetworkInterceptController* aController)
: mController(aController)
, mIsNavigation(aIsNavigation)
{
}
@ -76,13 +74,6 @@ InterceptedChannelBase::DoNotifyController()
mController = nullptr;
}
NS_IMETHODIMP
InterceptedChannelBase::GetIsNavigation(bool* aIsNavigation)
{
*aIsNavigation = mIsNavigation;
return NS_OK;
}
nsresult
InterceptedChannelBase::DoSynthesizeStatus(uint16_t aStatus, const nsACString& aReason)
{
@ -114,7 +105,7 @@ InterceptedChannelBase::DoSynthesizeHeader(const nsACString& aName, const nsACSt
InterceptedChannelChrome::InterceptedChannelChrome(nsHttpChannel* aChannel,
nsINetworkInterceptController* aController,
nsICacheEntry* aEntry)
: InterceptedChannelBase(aController, aChannel->IsNavigation())
: InterceptedChannelBase(aController)
, mChannel(aChannel)
, mSynthesizedCacheEntry(aEntry)
{
@ -279,7 +270,7 @@ InterceptedChannelChrome::GetInternalContentPolicyType(nsContentPolicyType* aPol
InterceptedChannelContent::InterceptedChannelContent(HttpChannelChild* aChannel,
nsINetworkInterceptController* aController,
nsIStreamListener* aListener)
: InterceptedChannelBase(aController, aChannel->IsNavigation())
: InterceptedChannelBase(aController)
, mChannel(aChannel)
, mStreamListener(aListener)
{

View File

@ -35,9 +35,6 @@ protected:
// Response head for use when synthesizing
Maybe<nsAutoPtr<nsHttpResponseHead>> mSynthesizedResponseHead;
// Whether this intercepted channel was performing a navigation.
bool mIsNavigation;
void EnsureSynthesizedResponse();
void DoNotifyController();
nsresult DoSynthesizeStatus(uint16_t aStatus, const nsACString& aReason);
@ -45,8 +42,7 @@ protected:
virtual ~InterceptedChannelBase();
public:
InterceptedChannelBase(nsINetworkInterceptController* aController,
bool aIsNavigation);
explicit InterceptedChannelBase(nsINetworkInterceptController* aController);
// Notify the interception controller that the channel has been intercepted
// and prepare the response body output stream.
@ -55,7 +51,6 @@ public:
NS_DECL_ISUPPORTS
NS_IMETHOD GetResponseBody(nsIOutputStream** aOutput) override;
NS_IMETHOD GetIsNavigation(bool* aIsNavigation) override;
};
class InterceptedChannelChrome : public InterceptedChannelBase