Bug 1194519 - call AsyncOpen2 within child and parent if securityFlags are present (r=jduell)

This commit is contained in:
Christoph Kerschbaumer 2015-08-21 20:33:56 -07:00
parent 5cc836a140
commit 9d3911f687
6 changed files with 38 additions and 5 deletions

View File

@ -40,7 +40,14 @@ NS_IMETHODIMP
DataChannelChild::CompleteRedirectSetup(nsIStreamListener *aListener,
nsISupports *aContext)
{
nsresult rv = AsyncOpen(aListener, aContext);
nsresult rv;
if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
MOZ_ASSERT(!aContext, "aContext should be null!");
rv = AsyncOpen2(aListener);
}
else {
rv = AsyncOpen(aListener, aContext);
}
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}

View File

@ -188,10 +188,16 @@ FTPChannelParent::DoAsyncOpen(const URIParams& aURI,
if (NS_FAILED(rv))
return SendFailedAsyncOpen(rv);
rv = ftpChan->AsyncOpen(this, nullptr);
if (loadInfo && loadInfo->GetEnforceSecurity()) {
rv = ftpChan->AsyncOpen2(this);
}
else {
rv = ftpChan->AsyncOpen(this, nullptr);
}
if (NS_FAILED(rv))
return SendFailedAsyncOpen(rv);
return true;
}

View File

@ -1307,6 +1307,10 @@ HttpChannelChild::CompleteRedirectSetup(nsIStreamListener *listener,
// fresh - we will intercept the child channel this time, before creating a new
// parent channel unnecessarily.
PHttpChannelChild::Send__delete__(this);
if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
MOZ_ASSERT(!aContext, "aContext should be null!");
return AsyncOpen2(listener);
}
return AsyncOpen(listener, aContext);
}

View File

@ -476,7 +476,12 @@ HttpChannelParent::DoAsyncOpen( const URIParams& aURI,
schedulingContextID.Parse(aSchedulingContextID.BeginReading());
mChannel->SetSchedulingContextID(schedulingContextID);
rv = mChannel->AsyncOpen(mParentListener, nullptr);
if (loadInfo && loadInfo->GetEnforceSecurity()) {
rv = mChannel->AsyncOpen2(mParentListener);
}
else {
rv = mChannel->AsyncOpen(mParentListener, nullptr);
}
if (NS_FAILED(rv))
return SendFailedAsyncOpen(rv);

View File

@ -280,6 +280,10 @@ NS_IMETHODIMP
RtspChannelChild::CompleteRedirectSetup(nsIStreamListener *aListener,
nsISupports *aContext)
{
if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
MOZ_ASSERT(!aContext, "aContext should be null!");
return AsyncOpen2(aListener);
}
return AsyncOpen(aListener, aContext);
}

View File

@ -186,7 +186,14 @@ WyciwygChannelParent::RecvAsyncOpen(const URIParams& aOriginal,
if (NS_FAILED(rv))
return SendCancelEarly(rv);
rv = mChannel->AsyncOpen(this, nullptr);
nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
if (loadInfo && loadInfo->GetEnforceSecurity()) {
rv = mChannel->AsyncOpen2(this);
}
else {
rv = mChannel->AsyncOpen(this, nullptr);
}
if (NS_FAILED(rv))
return SendCancelEarly(rv);