bug 1457058 remove unused GraphDriver::RemoveCallback() r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 26 Apr 2018 17:50:59 +1200
changeset 469498 d78701ac0ea19f849ca73dac988484a8da9d3635
parent 469497 63fca25d8f74d8d59b551b3d8e99826497f878f9
child 469499 6b3c256ecab95931cc66ca987cc267f07243eb17
push id9171
push userryanvm@gmail.com
push dateSat, 28 Apr 2018 10:35:57 +0000
treeherdermozilla-beta@89f3ba72015a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1457058
milestone61.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 1457058 remove unused GraphDriver::RemoveCallback() r=padenot MozReview-Commit-ID: 3ZWfWEJ7bko
dom/media/GraphDriver.cpp
dom/media/GraphDriver.h
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -231,21 +231,16 @@ ThreadedDriver::Revive()
     NextDriver()->Start();
   } else {
     nsCOMPtr<nsIRunnable> event = new MediaStreamGraphInitThreadRunnable(this);
     mThread->EventTarget()->Dispatch(event.forget(), NS_DISPATCH_NORMAL);
   }
 }
 
 void
-ThreadedDriver::RemoveCallback()
-{
-}
-
-void
 ThreadedDriver::Shutdown()
 {
   NS_ASSERTION(NS_IsMainThread(), "Must be called on main thread");
   // mGraph's thread is not running so it's OK to do whatever here
   LOG(LogLevel::Debug, ("Stopping threads for MediaStreamGraph %p", this));
 
   if (mThread) {
     mThread->Shutdown();
@@ -324,17 +319,16 @@ ThreadedDriver::RunThread()
       // Enter shutdown mode. The stable-state handler will detect this
       // and complete shutdown if the graph does not get restarted.
       mGraphImpl->SignalMainThreadCleanup();
       return;
     }
     MonitorAutoLock lock(GraphImpl()->GetMonitor());
     if (NextDriver()) {
       LOG(LogLevel::Debug, ("Switching to AudioCallbackDriver"));
-      RemoveCallback();
       NextDriver()->SetGraphTime(this, mIterationStart, mIterationEnd);
       mGraphImpl->SetCurrentDriver(NextDriver());
       NextDriver()->Start();
       return;
     }
   }
 }
 
--- a/dom/media/GraphDriver.h
+++ b/dom/media/GraphDriver.h
@@ -118,18 +118,16 @@ public:
    * offline graphs, this is a no-op. */
   virtual void WaitForNextIteration() = 0;
   /* Wakes up the graph if it is waiting. */
   virtual void WakeUp() = 0;
   /* Start the graph, init the driver, start the thread. */
   virtual void Start() = 0;
   /* Revive this driver, as more messages just arrived. */
   virtual void Revive() = 0;
-  /* Remove Mixer callbacks when switching */
-  virtual void RemoveCallback() = 0;
   /* Shutdown GraphDriver (synchronously) */
   virtual void Shutdown() = 0;
   /* Rate at which the GraphDriver runs, in ms. This can either be user
    * controlled (because we are using a {System,Offline}ClockDriver, and decide
    * how often we want to wakeup/how much we want to process per iteration), or
    * it can be indirectly set by the latency of the audio backend, and the
    * number of buffers of this audio backend: say we have four buffers, and 40ms
    * latency, we will get a callback approximately every 10ms. */
@@ -243,17 +241,16 @@ class MediaStreamGraphInitThreadRunnable
  */
 class ThreadedDriver : public GraphDriver
 {
 public:
   explicit ThreadedDriver(MediaStreamGraphImpl* aGraphImpl);
   virtual ~ThreadedDriver();
   void Start() override;
   void Revive() override;
-  void RemoveCallback() override;
   void Shutdown() override;
   /**
    * Runs main control loop on the graph thread. Normally a single invocation
    * of this runs for the entire lifetime of the graph thread.
    */
   void RunThread();
   friend class MediaStreamGraphInitThreadRunnable;
   uint32_t IterationDuration() override {
@@ -380,17 +377,16 @@ class AudioCallbackDriver : public Graph
 #endif
 {
 public:
   explicit AudioCallbackDriver(MediaStreamGraphImpl* aGraphImpl);
   virtual ~AudioCallbackDriver();
 
   void Start() override;
   void Revive() override;
-  void RemoveCallback() override;
   void WaitForNextIteration() override;
   void WakeUp() override;
   void Shutdown() override;
 #if defined(XP_WIN)
   void ResetDefaultDevice() override;
 #endif
 
   /* Static wrapper function cubeb calls back. */
@@ -467,16 +463,18 @@ public:
 
   void CompleteAudioContextOperations(AsyncCubebOperation aOperation);
 
   /* Fetch, or create a shared thread pool with up to one thread for
    * AsyncCubebTask. */
   SharedThreadPool* GetInitShutdownThread();
 
 private:
+  /* Remove Mixer callbacks when switching */
+  void RemoveCallback() ;
   /**
    * On certain MacBookPro, the microphone is located near the left speaker.
    * We need to pan the sound output to the right speaker if we are using the
    * mic and the built-in speaker, or we will have terrible echo.  */
   void PanOutputIfNeeded(bool aMicrophoneActive);
   /**
    * This is called when the output device used by the cubeb stream changes. */
   void DeviceChangedCallback();