зеркало из https://github.com/mozilla/gecko-dev.git
Bug 569044 - "e10s HTTP: handle requests with no responseHead" [r=jduell]
This commit is contained in:
Родитель
e9ace04a4c
Коммит
16be797df3
|
@ -103,13 +103,18 @@ NS_INTERFACE_MAP_END_INHERITING(HttpBaseChannel)
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool
|
||||
HttpChannelChild::RecvOnStartRequest(const nsHttpResponseHead& responseHead)
|
||||
HttpChannelChild::RecvOnStartRequest(const nsHttpResponseHead& responseHead,
|
||||
const PRBool& useResponseHead)
|
||||
{
|
||||
LOG(("HttpChannelChild::RecvOnStartRequest [this=%x]\n", this));
|
||||
|
||||
mState = HCC_ONSTART;
|
||||
|
||||
mResponseHead = new nsHttpResponseHead(responseHead);
|
||||
if (useResponseHead)
|
||||
mResponseHead = new nsHttpResponseHead(responseHead);
|
||||
else
|
||||
mResponseHead = nsnull;
|
||||
|
||||
|
||||
nsresult rv = mListener->OnStartRequest(this, mListenerContext);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -121,7 +126,8 @@ HttpChannelChild::RecvOnStartRequest(const nsHttpResponseHead& responseHead)
|
|||
return false;
|
||||
}
|
||||
|
||||
SetCookie(mResponseHead->PeekHeader(nsHttp::Set_Cookie));
|
||||
if (mResponseHead)
|
||||
SetCookie(mResponseHead->PeekHeader(nsHttp::Set_Cookie));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -114,7 +114,8 @@ public:
|
|||
|
||||
protected:
|
||||
void RefcountHitZero();
|
||||
bool RecvOnStartRequest(const nsHttpResponseHead& responseHead);
|
||||
bool RecvOnStartRequest(const nsHttpResponseHead& responseHead,
|
||||
const PRBool& useResponseHead);
|
||||
bool RecvOnDataAvailable(const nsCString& data,
|
||||
const PRUint32& offset,
|
||||
const PRUint32& count);
|
||||
|
|
|
@ -192,10 +192,12 @@ HttpChannelParent::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
|
|||
|
||||
nsHttpChannel *chan = static_cast<nsHttpChannel *>(aRequest);
|
||||
nsHttpResponseHead *responseHead = chan->GetResponseHead();
|
||||
NS_ABORT_IF_FALSE(responseHead, "Missing HTTP responseHead!");
|
||||
|
||||
if (mIPCClosed || !SendOnStartRequest(*responseHead))
|
||||
if (mIPCClosed || !SendOnStartRequest(responseHead ? *responseHead : nsHttpResponseHead(),
|
||||
!!responseHead)) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,8 @@ parent:
|
|||
SetPriority(PRUint16 priority);
|
||||
|
||||
child:
|
||||
OnStartRequest(nsHttpResponseHead responseHead);
|
||||
OnStartRequest(nsHttpResponseHead responseHead,
|
||||
PRBool useResponseHead);
|
||||
|
||||
OnDataAvailable(nsCString data,
|
||||
PRUint32 offset,
|
||||
|
|
Загрузка…
Ссылка в новой задаче