Bug 1208371 - Track original track in MediaStreamTrack clones. r?jib draft
authorAndreas Pehrson <pehrsons@gmail.com>
Thu, 05 Nov 2015 15:42:21 +0800
changeset 306637 c782bc0983c3d7dac6c416a488c6171931900da1
parent 306636 45c96b266d5eee9d49ab19e97c82adf6ec6ab5ac
child 306638 ad9e68e3740e035d4fb780113b144b44edb0e49b
push id7183
push userpehrsons@gmail.com
push dateThu, 05 Nov 2015 07:42:40 +0000
reviewersjib
bugs1208371
milestone45.0a1
Bug 1208371 - Track original track in MediaStreamTrack clones. r?jib
dom/media/MediaStreamTrack.cpp
dom/media/MediaStreamTrack.h
--- a/dom/media/MediaStreamTrack.cpp
+++ b/dom/media/MediaStreamTrack.cpp
@@ -42,17 +42,17 @@ MediaStreamTrack::MediaStreamTrack(DOMMe
   mID = NS_ConvertASCIItoUTF16(chars);
 }
 
 MediaStreamTrack::~MediaStreamTrack()
 {
 }
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(MediaStreamTrack, DOMEventTargetHelper,
-                                   mOwningStream)
+                                   mOwningStream, mOriginalTrack)
 
 NS_IMPL_ADDREF_INHERITED(MediaStreamTrack, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(MediaStreamTrack, DOMEventTargetHelper)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(MediaStreamTrack)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
 void
 MediaStreamTrack::GetId(nsAString& aID) const
--- a/dom/media/MediaStreamTrack.h
+++ b/dom/media/MediaStreamTrack.h
@@ -69,16 +69,17 @@ public:
   // need to surface this to content.
   void AssignId(const nsAString& aID) { mID = aID; }
 
 protected:
   virtual ~MediaStreamTrack();
 
   RefPtr<DOMMediaStream> mOwningStream;
   TrackID mTrackID;
+  RefPtr<MediaStreamTrack> mOriginalTrack;
   nsString mID;
   bool mEnded;
   bool mEnabled;
 };
 
 } // namespace dom
 } // namespace mozilla