From 1e4dc15ed461d31a5aff348f92a83dd17587e7fd Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Thu, 27 Oct 2016 06:13:00 -0400 Subject: [PATCH] Bug 1312646 - Carry ChooseApplicationCache flag from child after redirect callback is done. r=jduell --HG-- extra : rebase_source : c91b0722331e9bd897fa97cd380691296b408871 --- netwerk/protocol/http/HttpChannelChild.cpp | 9 ++++++++- netwerk/protocol/http/HttpChannelParent.cpp | 9 ++++++++- netwerk/protocol/http/HttpChannelParent.h | 3 ++- netwerk/protocol/http/PHttpChannel.ipdl | 3 ++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index 945641c3aba7..c12b2fc69a16 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -1684,10 +1684,17 @@ HttpChannelChild::OnRedirectVerifyCallback(nsresult result) } } + bool chooseAppcache = false; + nsCOMPtr appCacheChannel = + do_QueryInterface(newHttpChannel); + if (appCacheChannel) { + appCacheChannel->GetChooseApplicationCache(&chooseAppcache); + } + if (mIPCOpen) SendRedirect2Verify(result, *headerTuples, loadFlags, redirectURI, corsPreflightArgs, forceHSTSPriming, - mixedContentWouldBlock); + mixedContentWouldBlock, chooseAppcache); return NS_OK; } diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp index a6d8f76c6fdb..0e6a5114bb9a 100644 --- a/netwerk/protocol/http/HttpChannelParent.cpp +++ b/netwerk/protocol/http/HttpChannelParent.cpp @@ -697,7 +697,8 @@ HttpChannelParent::RecvRedirect2Verify(const nsresult& result, const OptionalURIParams& aAPIRedirectURI, const OptionalCorsPreflightArgs& aCorsPreflightArgs, const bool& aForceHSTSPriming, - const bool& aMixedContentWouldBlock) + const bool& aMixedContentWouldBlock, + const bool& aChooseAppcache) { LOG(("HttpChannelParent::RecvRedirect2Verify [this=%p result=%x]\n", this, result)); @@ -743,6 +744,12 @@ HttpChannelParent::RecvRedirect2Verify(const nsresult& result, newLoadInfo->SetHSTSPriming(aMixedContentWouldBlock); } } + + nsCOMPtr appCacheChannel = + do_QueryInterface(newHttpChannel); + if (appCacheChannel) { + appCacheChannel->SetChooseApplicationCache(aChooseAppcache); + } } } diff --git a/netwerk/protocol/http/HttpChannelParent.h b/netwerk/protocol/http/HttpChannelParent.h index 4286b5d9d62d..bd4668d41f0b 100644 --- a/netwerk/protocol/http/HttpChannelParent.h +++ b/netwerk/protocol/http/HttpChannelParent.h @@ -155,7 +155,8 @@ protected: const OptionalURIParams& apiRedirectUri, const OptionalCorsPreflightArgs& aCorsPreflightArgs, const bool& aForceHSTSPriming, - const bool& aMixedContentWouldBlock) override; + const bool& aMixedContentWouldBlock, + const bool& aChooseAppcache) override; virtual bool RecvUpdateAssociatedContentSecurity(const int32_t& broken, const int32_t& no) override; virtual bool RecvDocumentChannelCleanup() override; diff --git a/netwerk/protocol/http/PHttpChannel.ipdl b/netwerk/protocol/http/PHttpChannel.ipdl index 221e7cd3135e..558f9740fa03 100644 --- a/netwerk/protocol/http/PHttpChannel.ipdl +++ b/netwerk/protocol/http/PHttpChannel.ipdl @@ -47,7 +47,8 @@ parent: async Redirect2Verify(nsresult result, RequestHeaderTuples changedHeaders, uint32_t loadFlags, OptionalURIParams apiRedirectTo, OptionalCorsPreflightArgs corsPreflightArgs, - bool forceHSTSPriming, bool mixedContentWouldBlock); + bool forceHSTSPriming, bool mixedContentWouldBlock, + bool chooseAppcache); // For document loads we keep this protocol open after child's // OnStopRequest, and send this msg (instead of __delete__) to allow