bug 1190285 remove unused GetCurrentTime() r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 23 Jul 2015 17:31:32 +1200
changeset 256074 e89ea131df69dcace07e483eac07fc569c1c0bfe
parent 256073 bd2d8b78d1fc6c2e9114d6aa300f8c16180fe77b
child 256075 2bcb21c74b7438c6587466ab60b92692633b87f8
push id29167
push userryanvm@gmail.com
push dateTue, 04 Aug 2015 19:53:20 +0000
treeherdermozilla-central@a41bc7b8a24b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1190285
milestone42.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 1190285 remove unused GetCurrentTime() r=padenot
dom/media/GraphDriver.cpp
dom/media/GraphDriver.h
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -331,22 +331,16 @@ SystemClockDriver::GetIntervalForIterati
 
   if (aFrom >= aTo) {
     NS_ASSERTION(aFrom == aTo , "Time can't go backwards!");
     // This could happen due to low clock resolution, maybe?
     STREAM_LOG(LogLevel::Debug, ("Time did not advance"));
   }
 }
 
-GraphTime
-SystemClockDriver::GetCurrentTime()
-{
-  return IterationEnd();
-}
-
 TimeStamp
 OfflineClockDriver::GetCurrentTimeStamp()
 {
   MOZ_CRASH("This driver does not support getting the current timestamp.");
   return TimeStamp();
 }
 
 void
@@ -445,23 +439,16 @@ OfflineClockDriver::GetIntervalForIterat
 
   if (aFrom >= aTo) {
     NS_ASSERTION(aFrom == aTo , "Time can't go backwards!");
     // This could happen due to low clock resolution, maybe?
     STREAM_LOG(LogLevel::Debug, ("Time did not advance"));
   }
 }
 
-GraphTime
-OfflineClockDriver::GetCurrentTime()
-{
-  return mIterationEnd;
-}
-
-
 void
 OfflineClockDriver::WaitForNextIteration()
 {
   // No op: we want to go as fast as possible when we are offline
 }
 
 void
 OfflineClockDriver::WakeUp()
@@ -706,28 +693,16 @@ AudioCallbackDriver::Revive()
 }
 
 void
 AudioCallbackDriver::GetIntervalForIteration(GraphTime& aFrom,
                                              GraphTime& aTo)
 {
 }
 
-GraphTime
-AudioCallbackDriver::GetCurrentTime()
-{
-  uint64_t position = 0;
-
-  if (cubeb_stream_get_position(mAudioStream, &position) != CUBEB_OK) {
-    NS_WARNING("Could not get current time from cubeb.");
-  }
-
-  return mSampleRate * position;
-}
-
 void AudioCallbackDriver::WaitForNextIteration()
 {
 }
 
 void
 AudioCallbackDriver::WakeUp()
 {
   mGraphImpl->GetMonitor().AssertCurrentThreadOwns();
--- a/dom/media/GraphDriver.h
+++ b/dom/media/GraphDriver.h
@@ -83,19 +83,16 @@ class GraphDriver
 public:
   explicit GraphDriver(MediaStreamGraphImpl* aGraphImpl);
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GraphDriver);
   /* When the graph wakes up to do an iteration, this returns the range of time
    * that will be processed. */
   virtual void GetIntervalForIteration(GraphTime& aFrom,
                                        GraphTime& aTo) = 0;
-  /* Returns the current time for this graph. This is the end of the current
-   * iteration. */
-  virtual GraphTime GetCurrentTime() = 0;
   /* For real-time graphs, this waits until it's time to process more data. For
    * offline graphs, this is a no-op. */
   virtual void WaitForNextIteration() = 0;
   /* Wakes up the graph if it is waiting. */
   virtual void WakeUp() = 0;
   virtual void Destroy() {}
   /* Start the graph, init the driver, start the thread. */
   virtual void Start() = 0;
@@ -287,17 +284,16 @@ protected:
  */
 class SystemClockDriver : public ThreadedDriver
 {
 public:
   explicit SystemClockDriver(MediaStreamGraphImpl* aGraphImpl);
   virtual ~SystemClockDriver();
   virtual void GetIntervalForIteration(GraphTime& aFrom,
                                        GraphTime& aTo) override;
-  virtual GraphTime GetCurrentTime() override;
   virtual void WaitForNextIteration() override;
   virtual void WakeUp() override;
 
 
 private:
   TimeStamp mInitialTimeStamp;
   TimeStamp mLastTimeStamp;
 };
@@ -308,17 +304,16 @@ private:
  */
 class OfflineClockDriver : public ThreadedDriver
 {
 public:
   OfflineClockDriver(MediaStreamGraphImpl* aGraphImpl, GraphTime aSlice);
   virtual ~OfflineClockDriver();
   virtual void GetIntervalForIteration(GraphTime& aFrom,
                                        GraphTime& aTo) override;
-  virtual GraphTime GetCurrentTime() override;
   virtual void WaitForNextIteration() override;
   virtual void WakeUp() override;
   virtual TimeStamp GetCurrentTimeStamp() override;
   virtual OfflineClockDriver* AsOfflineClockDriver() override {
     return this;
   }
 
 private:
@@ -371,17 +366,16 @@ public:
 
   virtual void Destroy() override;
   virtual void Start() override;
   virtual void Stop() override;
   virtual void Resume() override;
   virtual void Revive() override;
   virtual void GetIntervalForIteration(GraphTime& aFrom,
                                        GraphTime& aTo) override;
-  virtual GraphTime GetCurrentTime() override;
   virtual void WaitForNextIteration() override;
   virtual void WakeUp() override;
 
   /* Static wrapper function cubeb calls back. */
   static long DataCallback_s(cubeb_stream * aStream,
                              void * aUser, void * aBuffer,
                              long aFrames);
   static void StateCallback_s(cubeb_stream* aStream, void * aUser,