bug 1457058 remove unused GraphDriver::RemoveCallback() r?padenot draft
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 26 Apr 2018 17:50:59 +1200
changeset 788294 33635ea55db40927f196e15763cce5a492cdf4a9
parent 788286 76f35d0ecaa690917347f2b0f97180b05e7272bb
push id107945
push userktomlinson@mozilla.com
push dateThu, 26 Apr 2018 06:56:48 +0000
reviewerspadenot
bugs1457058
milestone61.0a1
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();