Bug 1425621 - Part 3: Implementation for MediaStream.onremovetrack. r=pehrsons
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 20 Dec 2017 12:36:19 -0600
changeset 450928 463ebca87767698554f417352fadf5d516a99d40
parent 450927 eb93d67c574758aea9936e5be6117bd2af3a3573
child 450929 6fc395c1746df13107d9f1baffbdad8a2433f7fa
push id8543
push userryanvm@gmail.com
push dateTue, 16 Jan 2018 14:33:22 +0000
treeherdermozilla-beta@a6525ed16a32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1425621
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1425621 - Part 3: Implementation for MediaStream.onremovetrack. r=pehrsons MozReview-Commit-ID: 70Hsr4G4cp6
dom/media/DOMMediaStream.cpp
dom/media/DOMMediaStream.h
--- a/dom/media/DOMMediaStream.cpp
+++ b/dom/media/DOMMediaStream.cpp
@@ -1460,19 +1460,16 @@ DOMMediaStream::NotifyTrackRemoved(const
     NotifyInactive();
   }
 }
 
 nsresult
 DOMMediaStream::DispatchTrackEvent(const nsAString& aName,
                                    const RefPtr<MediaStreamTrack>& aTrack)
 {
-  MOZ_ASSERT(aName == NS_LITERAL_STRING("addtrack"),
-             "Only 'addtrack' is supported at this time");
-
   MediaStreamTrackEventInit init;
   init.mTrack = aTrack;
 
   RefPtr<MediaStreamTrackEvent> event =
     MediaStreamTrackEvent::Constructor(this, aName, init);
 
   return DispatchTrustedEvent(event);
 }
--- a/dom/media/DOMMediaStream.h
+++ b/dom/media/DOMMediaStream.h
@@ -373,16 +373,17 @@ public:
   void RemoveTrack(MediaStreamTrack& aTrack);
 
   /** Identical to CloneInternal(TrackForwardingOption::EXPLICIT) */
   already_AddRefed<DOMMediaStream> Clone();
 
   bool Active() const;
 
   IMPL_EVENT_HANDLER(addtrack)
+  IMPL_EVENT_HANDLER(removetrack)
 
   // NON-WebIDL
 
   /**
    * Option to provide to CloneInternal() of which tracks should be forwarded
    * from the source stream (`this`) to the returned stream clone.
    *
    * CURRENT forwards the tracks currently in the source stream's track set.