diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 09:03:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 09:03:13 +0000 |
commit | 0681b3ac9a6ab4879ca2fbfcf8aa9d00a67b8365 (patch) | |
tree | 1437375a1c16af40bb2982577c25eb9608e17566 /netwerk/base/nsTransportUtils.cpp | |
parent | Adding debian version 115.11.0esr-1~deb12u1. (diff) | |
download | firefox-esr-0681b3ac9a6ab4879ca2fbfcf8aa9d00a67b8365.tar.xz firefox-esr-0681b3ac9a6ab4879ca2fbfcf8aa9d00a67b8365.zip |
Merging upstream version 115.12.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/base/nsTransportUtils.cpp')
-rw-r--r-- | netwerk/base/nsTransportUtils.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/netwerk/base/nsTransportUtils.cpp b/netwerk/base/nsTransportUtils.cpp index df53ead198..242907da08 100644 --- a/netwerk/base/nsTransportUtils.cpp +++ b/netwerk/base/nsTransportUtils.cpp @@ -24,24 +24,21 @@ class nsTransportEventSinkProxy : public nsITransportEventSink { nsTransportEventSinkProxy(nsITransportEventSink* sink, nsIEventTarget* target) : mSink(sink), mTarget(target), - mLock("nsTransportEventSinkProxy.mLock"), - mLastEvent(nullptr) { - NS_ADDREF(mSink); - } + mLock("nsTransportEventSinkProxy.mLock") {} private: virtual ~nsTransportEventSinkProxy() { // our reference to mSink could be the last, so be sure to release // it on the target thread. otherwise, we could get into trouble. NS_ProxyRelease("nsTransportEventSinkProxy::mSink", mTarget, - dont_AddRef(mSink)); + mSink.forget()); } public: - nsITransportEventSink* mSink; + nsCOMPtr<nsITransportEventSink> mSink; nsCOMPtr<nsIEventTarget> mTarget; Mutex mLock MOZ_UNANNOTATED; - nsTransportStatusEvent* mLastEvent; + RefPtr<nsTransportStatusEvent> mLastEvent; }; class nsTransportStatusEvent : public Runnable { @@ -69,11 +66,14 @@ class nsTransportStatusEvent : public Runnable { // if not coalescing all, then last event may not equal self! { MutexAutoLock lock(mProxy->mLock); - if (mProxy->mLastEvent == this) mProxy->mLastEvent = nullptr; + if (mProxy->mLastEvent == this) { + mProxy->mLastEvent = nullptr; + } } mProxy->mSink->OnTransportStatus(mTransport, mStatus, mProgress, mProgressMax); + mProxy = nullptr; return NS_OK; } |