Bug 1208371 - Remove obsolete SetTrackEnabled() from DOMMediaStream r=roc
authorAndreas Pehrson <pehrsons@gmail.com>
Tue, 05 Jan 2016 10:16:23 +0800
changeset 292073 ce9ca4390483f48ca5c561efa6f7335234d613d8
parent 292072 4ad566b38ebac36a905795473ed2b2706b8b5d58
child 292074 06d9ea133491f1cb07dcef8afbf66c8b1cb4504f
push id30152
push userkwierso@gmail.com
push dateThu, 07 Apr 2016 20:42:20 +0000
treeherdermozilla-central@06678484909c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1208371
milestone48.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 1208371 - Remove obsolete SetTrackEnabled() from DOMMediaStream r=roc MozReview-Commit-ID: rYB2yACej8
dom/media/DOMMediaStream.cpp
dom/media/DOMMediaStream.h
dom/media/MediaStreamTrack.cpp
--- a/dom/media/DOMMediaStream.cpp
+++ b/dom/media/DOMMediaStream.cpp
@@ -715,25 +715,16 @@ DOMMediaStream::CreateAudioCaptureStream
                                          MediaStreamGraph* aGraph)
 {
   MediaStreamTrackSourceGetter* getter = nullptr;
   RefPtr<DOMMediaStream> stream = new DOMMediaStream(aWindow, getter);
   stream->InitAudioCaptureStream(aGraph);
   return stream.forget();
 }
 
-void
-DOMMediaStream::SetTrackEnabled(TrackID aTrackID, bool aEnabled)
-{
-  // XXX Bug 1208371 - This enables/disables the track across clones.
-  if (mInputStream) {
-    mInputStream->SetTrackEnabled(aTrackID, aEnabled);
-  }
-}
-
 already_AddRefed<Promise>
 DOMMediaStream::ApplyConstraintsToTrack(TrackID aTrackID,
                                         const MediaTrackConstraints& aConstraints,
                                         ErrorResult &aRv)
 {
   nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow);
   RefPtr<Promise> promise = Promise::Create(go, aRv);
   MOZ_RELEASE_ASSERT(!aRv.Failed());
--- a/dom/media/DOMMediaStream.h
+++ b/dom/media/DOMMediaStream.h
@@ -404,22 +404,16 @@ public:
   /**
    * Overridden in DOMLocalMediaStreams to allow getUserMedia to pass
    * data directly to RTCPeerConnection without going through graph queuing.
    * Returns a bool to let us know if direct data will be delivered.
    */
   virtual bool AddDirectListener(MediaStreamDirectListener *aListener) { return false; }
   virtual void RemoveDirectListener(MediaStreamDirectListener *aListener) {}
 
-  /**
-   * Overridden in DOMLocalMediaStreams to allow getUserMedia to disable
-   * media at the SourceMediaStream.
-   */
-  virtual void SetTrackEnabled(TrackID aTrackID, bool aEnabled);
-
   virtual already_AddRefed<dom::Promise>
   ApplyConstraintsToTrack(TrackID aTrackID,
                           const MediaTrackConstraints& aConstraints,
                           ErrorResult &aRv);
 
   virtual DOMLocalMediaStream* AsDOMLocalMediaStream() { return nullptr; }
   virtual DOMHwMediaStream* AsDOMHwMediaStream() { return nullptr; }
 
--- a/dom/media/MediaStreamTrack.cpp
+++ b/dom/media/MediaStreamTrack.cpp
@@ -90,17 +90,18 @@ MediaStreamTrack::GetId(nsAString& aID) 
 
 void
 MediaStreamTrack::SetEnabled(bool aEnabled)
 {
   LOG(LogLevel::Info, ("MediaStreamTrack %p %s",
                        this, aEnabled ? "Enabled" : "Disabled"));
 
   mEnabled = aEnabled;
-  mOwningStream->SetTrackEnabled(mTrackID, aEnabled);
+  // XXX Bug 1208371 - This enables/disables the track across clones.
+  GetInputStream()->SetTrackEnabled(mTrackID, aEnabled);
 }
 
 void
 MediaStreamTrack::Stop()
 {
   LOG(LogLevel::Info, ("MediaStreamTrack %p Stop()", this));
 
   if (mStopped) {