Bug 1172992 - Send security info override from HttpChildChannel to the parent, r=jduell

--HG--
extra : rebase_source : 72df514bb695ccdfc280ef124254da3107905a59
This commit is contained in:
Honza Bambas 2015-08-19 14:50:34 -07:00
parent 76991ad628
commit cb0925e6e8
4 changed files with 18 additions and 2 deletions

View File

@ -91,6 +91,7 @@ struct HttpChannelOpenArgs
OptionalFileDescriptorSet fds;
OptionalLoadInfoArgs loadInfo;
OptionalHttpResponseHead synthesizedResponseHead;
nsCString synthesizedSecurityInfoSerialization;
uint32_t cacheKey;
nsCString schedulingContextID;
};

View File

@ -1627,6 +1627,11 @@ HttpChannelChild::ContinueAsyncOpen()
openArgs.synthesizedResponseHead() = mozilla::void_t();
}
nsCOMPtr<nsISerializable> secInfoSer = do_QueryInterface(mSecurityInfo);
if (secInfoSer) {
NS_SerializeToString(secInfoSer, openArgs.synthesizedSecurityInfoSerialization());
}
OptionalFileDescriptorSet optionalFDs;
if (fds.IsEmpty()) {

View File

@ -120,8 +120,9 @@ HttpChannelParent::Init(const HttpChannelCreationArgs& aArgs)
a.thirdPartyFlags(), a.resumeAt(), a.startPos(),
a.entityID(), a.chooseApplicationCache(),
a.appCacheClientID(), a.allowSpdy(), a.allowAltSvc(), a.fds(),
a.loadInfo(), a.synthesizedResponseHead(), a.cacheKey(),
a.schedulingContextID());
a.loadInfo(), a.synthesizedResponseHead(),
a.synthesizedSecurityInfoSerialization(),
a.cacheKey(), a.schedulingContextID());
}
case HttpChannelCreationArgs::THttpChannelConnectArgs:
{
@ -277,6 +278,7 @@ HttpChannelParent::DoAsyncOpen( const URIParams& aURI,
const OptionalFileDescriptorSet& aFds,
const OptionalLoadInfoArgs& aLoadInfoArgs,
const OptionalHttpResponseHead& aSynthesizedResponseHead,
const nsCString& aSecurityInfoSerialization,
const uint32_t& aCacheKey,
const nsCString& aSchedulingContextID)
{
@ -390,6 +392,13 @@ HttpChannelParent::DoAsyncOpen( const URIParams& aURI,
if (aSynthesizedResponseHead.type() == OptionalHttpResponseHead::TnsHttpResponseHead) {
mSynthesizedResponseHead = new nsHttpResponseHead(aSynthesizedResponseHead.get_nsHttpResponseHead());
mShouldIntercept = true;
if (!aSecurityInfoSerialization.IsEmpty()) {
nsCOMPtr<nsISupports> secInfo;
NS_DeserializeObject(aSecurityInfoSerialization, getter_AddRefs(secInfo));
mChannel->OverrideSecurityInfo(secInfo);
}
} else {
mChannel->ForceNoIntercept();
}

View File

@ -118,6 +118,7 @@ protected:
const OptionalFileDescriptorSet& aFds,
const OptionalLoadInfoArgs& aLoadInfoArgs,
const OptionalHttpResponseHead& aSynthesizedResponseHead,
const nsCString& aSecurityInfoSerialization,
const uint32_t& aCacheKey,
const nsCString& aSchedulingContextID);