зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1376914 - Make nsConnecionEntry weak reference in nsHalfOpenSock. r=mcmanus
This commit is contained in:
Родитель
2d08e4a243
Коммит
1f4bf966d7
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче