Bug 569044 - "e10s HTTP: handle requests with no responseHead" [r=jduell]

This commit is contained in:
Honza Bambas 2010-06-18 03:32:00 -07:00
Родитель e9ace04a4c
Коммит 16be797df3
4 изменённых файлов: 17 добавлений и 7 удалений

Просмотреть файл

@ -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,