Bug 778680 part 2 - Fix incorrect nsresult usage in netwerk/; r=jduell

This commit is contained in:
Aryeh Gregor 2012-08-01 11:17:09 +03:00
Родитель 5f722a9bf7
Коммит 7c1ebce612
3 изменённых файлов: 7 добавлений и 5 удалений

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

@ -29,7 +29,7 @@ namespace net {
HttpChannelParent::HttpChannelParent(PBrowserParent* iframeEmbedding)
: mIPCClosed(false)
, mStoredStatus(0)
, mStoredStatus(NS_OK)
, mStoredProgress(0)
, mStoredProgressMax(0)
, mSentRedirect1Begin(false)

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

@ -89,7 +89,7 @@ nsHttpBasicAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel,
}
NS_IMETHODIMP
nsHttpBasicAuth::GetAuthFlags(nsresult *flags)
nsHttpBasicAuth::GetAuthFlags(PRUint32 *flags)
{
*flags = REQUEST_BASED | REUSABLE_CREDENTIALS | REUSABLE_CHALLENGE;
return NS_OK;

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

@ -297,7 +297,8 @@ nsHttpConnectionMgr::CancelTransaction(nsHttpTransaction *trans, nsresult reason
LOG(("nsHttpConnectionMgr::CancelTransaction [trans=%x reason=%x]\n", trans, reason));
NS_ADDREF(trans);
nsresult rv = PostEvent(&nsHttpConnectionMgr::OnMsgCancelTransaction, reason, trans);
nsresult rv = PostEvent(&nsHttpConnectionMgr::OnMsgCancelTransaction,
static_cast<PRInt32>(reason), trans);
if (NS_FAILED(rv))
NS_RELEASE(trans);
return rv;
@ -1879,6 +1880,7 @@ nsHttpConnectionMgr::OnMsgCancelTransaction(PRInt32 reason, void *param)
NS_ABORT_IF_FALSE(PR_GetCurrentThread() == gSocketThread, "wrong thread");
LOG(("nsHttpConnectionMgr::OnMsgCancelTransaction [trans=%p]\n", param));
nsresult closeCode = static_cast<nsresult>(reason);
nsHttpTransaction *trans = (nsHttpTransaction *) param;
//
// if the transaction owns a connection and the transaction is not done,
@ -1887,7 +1889,7 @@ nsHttpConnectionMgr::OnMsgCancelTransaction(PRInt32 reason, void *param)
//
nsAHttpConnection *conn = trans->Connection();
if (conn && !trans->IsDone())
conn->CloseTransaction(trans, reason);
conn->CloseTransaction(trans, closeCode);
else {
nsConnectionEntry *ent = LookupConnectionEntry(trans->ConnectionInfo(),
nullptr, trans);
@ -1900,7 +1902,7 @@ nsHttpConnectionMgr::OnMsgCancelTransaction(PRInt32 reason, void *param)
NS_RELEASE(temp); // b/c NS_RELEASE nulls its argument!
}
}
trans->Close(reason);
trans->Close(closeCode);
}
NS_RELEASE(trans);
}