Bug 1376914 - Make nsConnecionEntry weak reference in nsHalfOpenSock. r=mcmanus

This commit is contained in:
Dragana Damjanovic dd.mozilla@gmail.com 2017-07-03 10:52:46 +02:00
Родитель 2d08e4a243
Коммит 1f4bf966d7
2 изменённых файлов: 7 добавлений и 2 удалений

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

@ -4030,6 +4030,7 @@ nsHalfOpenSocket::OnOutputStreamReady(nsIAsyncOutputStream *out)
mFastOpenInProgress = false;
mConnectionNegotiatingFastOpen = nullptr;
}
MOZ_DIAGNOSTIC_ASSERT(mEnt);
nsresult rv = SetupConn(out, false);
if (mEnt) {
mEnt->mDoNotDestroy = false;
@ -4043,6 +4044,8 @@ nsHalfOpenSocket::FastOpenEnabled()
{
LOG(("nsHalfOpenSocket::FastOpenEnabled [this=%p]\n", this));
MOZ_DIAGNOSTIC_ASSERT(mEnt);
if (!mEnt) {
return false;
}
@ -4534,6 +4537,7 @@ nsHttpConnectionMgr::nsHalfOpenSocket::OnTransportStatus(nsITransport *trans,
{
MOZ_ASSERT(OnSocketThread(), "not on socket thread");
MOZ_DIAGNOSTIC_ASSERT(mEnt);
if (mTransaction) {
RefPtr<PendingTransactionInfo> info = FindTransactionHelper(false);
if ((trans == mSocketTransport) ||

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

@ -244,9 +244,10 @@ private:
// contains list of active and idle connections as well as the list of
// pending transactions.
//
class nsConnectionEntry
class nsConnectionEntry : public SupportsWeakPtr<nsConnectionEntry>
{
public:
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(nsConnectionEntry)
explicit nsConnectionEntry(nsHttpConnectionInfo *ci);
~nsConnectionEntry();
@ -415,7 +416,7 @@ private:
already_AddRefed<PendingTransactionInfo>
FindTransactionHelper(bool removeWhenFound);
nsConnectionEntry *mEnt;
WeakPtr<nsConnectionEntry> mEnt;
RefPtr<nsAHttpTransaction> mTransaction;
bool mDispatchedMTransaction;
nsCOMPtr<nsISocketTransport> mSocketTransport;