Bug 1405962. P2 - use thread-safe ref counting. draft
authorJW Wang <jwwang@mozilla.com>
Wed, 20 Sep 2017 17:14:01 +0800
changeset 675836 7dc29f0c976a5d0b606321a3c9ed64d6f4bf6324
parent 675835 228b08c8c93437a938ca3e3b6f24bf597690e65d
child 734727 1e2c7c336ddf4bca33fb3058151eef9f7d38bce3
push id83260
push userjwwang@mozilla.com
push dateThu, 05 Oct 2017 23:40:33 +0000
bugs1405962
milestone58.0a1
Bug 1405962. P2 - use thread-safe ref counting. These listeners will be AddRefed/Released off the main thread when OMT data delivery is enabled. MozReview-Commit-ID: CSOBgNNf3OW
dom/html/HTMLMediaElement.cpp
dom/media/ChannelMediaResource.h
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -453,17 +453,17 @@ class HTMLMediaElement::MediaLoadListene
   : public nsIStreamListener
   , public nsIChannelEventSink
   , public nsIInterfaceRequestor
   , public nsIObserver
   , public nsIThreadRetargetableStreamListener
 {
   ~MediaLoadListener() {}
 
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSICHANNELEVENTSINK
   NS_DECL_NSIOBSERVER
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
 
 public:
--- a/dom/media/ChannelMediaResource.h
+++ b/dom/media/ChannelMediaResource.h
@@ -117,17 +117,17 @@ public:
   public:
     Listener(ChannelMediaResource* aResource, int64_t aOffset, uint32_t aLoadID)
       : mMutex("Listener.mMutex")
       , mResource(aResource)
       , mOffset(aOffset)
       , mLoadID(aLoadID)
     {}
 
-    NS_DECL_ISUPPORTS
+    NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
     NS_DECL_NSICHANNELEVENTSINK
     NS_DECL_NSIINTERFACEREQUESTOR
     NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
 
     void Revoke();