summaryrefslogtreecommitdiffstats
path: root/netwerk/base
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 09:03:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 09:03:13 +0000
commit0681b3ac9a6ab4879ca2fbfcf8aa9d00a67b8365 (patch)
tree1437375a1c16af40bb2982577c25eb9608e17566 /netwerk/base
parentAdding debian version 115.11.0esr-1~deb12u1. (diff)
downloadfirefox-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')
-rw-r--r--netwerk/base/nsTransportUtils.cpp16
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;
}