Bug 799344 - Remove virtual from media state machine methods, since they're not inherited. r=roc
authorChris Pearce <cpearce@mozilla.com>
Wed, 07 Nov 2012 11:33:02 +1300
changeset 112464 84a1afc5b15eb9d562996b30bdaa64ae3348658f
parent 112463 c62f225d0dbbd45566bfc810176b0e9f5e6e45dc
child 112465 3f0e699629623280fc46d25f749be343299c9ad0
push id17602
push usercpearce@mozilla.com
push dateTue, 06 Nov 2012 22:33:17 +0000
treeherdermozilla-inbound@3f0e69962962 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs799344
milestone19.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 799344 - Remove virtual from media state machine methods, since they're not inherited. r=roc
content/media/nsBuiltinDecoderStateMachine.h
--- a/content/media/nsBuiltinDecoderStateMachine.h
+++ b/content/media/nsBuiltinDecoderStateMachine.h
@@ -111,17 +111,17 @@ public:
   typedef mozilla::SourceMediaStream SourceMediaStream;
   typedef mozilla::AudioSegment AudioSegment;
   typedef mozilla::VideoSegment VideoSegment;
 
   nsBuiltinDecoderStateMachine(nsBuiltinDecoder* aDecoder, nsBuiltinDecoderReader* aReader, bool aRealTime = false);
   ~nsBuiltinDecoderStateMachine();
 
   // nsDecoderStateMachine interface
-  virtual nsresult Init(nsBuiltinDecoderStateMachine* aCloneDonor);
+  nsresult Init(nsBuiltinDecoderStateMachine* aCloneDonor);
 
   // Enumeration for the valid decoding states
   enum State {
     DECODER_STATE_DECODING_METADATA,
     DECODER_STATE_DECODING,
     DECODER_STATE_SEEKING,
     DECODER_STATE_BUFFERING,
     DECODER_STATE_COMPLETED,
@@ -130,83 +130,83 @@ public:
 
   State GetState() {
     mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
     return mState;
   }
 
   // Set the audio volume. The decoder monitor must be obtained before
   // calling this.
-  virtual void SetVolume(double aVolume);
-  virtual void SetAudioCaptured(bool aCapture);
-  virtual void Shutdown();
+  void SetVolume(double aVolume);
+  void SetAudioCaptured(bool aCapture);
+  void Shutdown();
 
   // Called from the main thread to get the duration. The decoder monitor
   // must be obtained before calling this. It is in units of microseconds.
-  virtual int64_t GetDuration();
+  int64_t GetDuration();
 
   // Called from the main thread to set the duration of the media resource
   // if it is able to be obtained via HTTP headers. Called from the
   // state machine thread to set the duration if it is obtained from the
   // media metadata. The decoder monitor must be obtained before calling this.
   // aDuration is in microseconds.
-  virtual void SetDuration(int64_t aDuration);
+  void SetDuration(int64_t aDuration);
 
   // Called while decoding metadata to set the end time of the media
   // resource. The decoder monitor must be obtained before calling this.
   // aEndTime is in microseconds.
   void SetEndTime(int64_t aEndTime);
 
   // Functions used by assertions to ensure we're calling things
   // on the appropriate threads.
-  virtual bool OnDecodeThread() const {
+  bool OnDecodeThread() const {
     return IsCurrentThread(mDecodeThread);
   }
   bool OnStateMachineThread() const;
   bool OnAudioThread() const {
     return IsCurrentThread(mAudioThread);
   }
 
-  virtual nsHTMLMediaElement::NextFrameStatus GetNextFrameStatus();
+  nsHTMLMediaElement::NextFrameStatus GetNextFrameStatus();
 
   // Cause state transitions. These methods obtain the decoder monitor
   // to synchronise the change of state, and to notify other threads
   // that the state has changed.
-  virtual void Play();
+  void Play();
 
   // Seeks to aTime in seconds.
-  virtual void Seek(double aTime);
+  void Seek(double aTime);
 
   // Returns the current playback position in seconds.
   // Called from the main thread to get the current frame time. The decoder
   // monitor must be obtained before calling this.
-  virtual double GetCurrentTime() const;
+  double GetCurrentTime() const;
 
   // Clear the flag indicating that a playback position change event
   // is currently queued. This is called from the main thread and must
   // be called with the decode monitor held.
-  virtual void ClearPositionChangeFlag();
+  void ClearPositionChangeFlag();
 
   // Called from the main thread to set whether the media resource can
   // seek into unbuffered ranges. The decoder monitor must be obtained
   // before calling this.
-  virtual void SetSeekable(bool aSeekable);
+  void SetSeekable(bool aSeekable);
 
   // Update the playback position. This can result in a timeupdate event
   // and an invalidate of the frame being dispatched asynchronously if
   // there is no such event currently queued.
   // Only called on the decoder thread. Must be called with
   // the decode monitor held.
-  virtual void UpdatePlaybackPosition(int64_t aTime);
+  void UpdatePlaybackPosition(int64_t aTime);
 
   // Causes the state machine to switch to buffering state, and to
   // immediately stop playback and buffer downloaded data. Must be called
   // with the decode monitor held. Called on the state machine thread and
   // the main thread.
-  virtual void StartBuffering();
+  void StartBuffering();
 
   // State machine thread run function. Defers to RunStateMachine().
   NS_IMETHOD Run();
 
   // This is called on the state machine thread and audio thread.
   // The decoder monitor must be obtained before calling this.
   bool HasAudio() const {
     mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
@@ -270,17 +270,17 @@ public:
     if (mReader) {
       return mReader->IsSeekableInBufferedRanges();
     }
     return false;
   }
 
   // Sets the current frame buffer length for the MozAudioAvailable event.
   // Accessed on the main and state machine threads.
-  virtual void SetFrameBufferLength(uint32_t aLength);
+  void SetFrameBufferLength(uint32_t aLength);
 
   // Returns the shared state machine thread.
   static nsIThread* GetStateMachineThread();
 
   // Schedules the shared state machine thread to run the state machine.
   // If the state machine thread is the currently running the state machine,
   // we wait until that has completely finished before running the state
   // machine again.
@@ -318,19 +318,19 @@ public:
   // need it.
   void SendStreamData();
   void FinishStreamData();
   bool HaveEnoughDecodedAudio(int64_t aAmpleAudioUSecs);
   bool HaveEnoughDecodedVideo();
 
   // Returns true if the state machine has shutdown or is in the process of
   // shutting down. The decoder monitor must be held while calling this.
-  bool IsShutdown() MOZ_OVERRIDE;
+  bool IsShutdown();
 
-protected:
+private:
   class WakeDecoderRunnable : public nsRunnable {
   public:
     WakeDecoderRunnable(nsBuiltinDecoderStateMachine* aSM)
       : mMutex("WakeDecoderRunnable"), mStateMachine(aSM) {}
     NS_IMETHOD Run()
     {
       nsRefPtr<nsBuiltinDecoderStateMachine> stateMachine;
       {
@@ -416,17 +416,17 @@ protected:
   // if unknown).  Does not update the playback position on the decoder or
   // media element -- use UpdatePlaybackPosition for that.  Called on the state
   // machine thread, caller must hold the decoder lock.
   void UpdatePlaybackPositionInternal(int64_t aTime);
 
   // Pushes the image down the rendering pipeline. Called on the shared state
   // machine thread. The decoder monitor must *not* be held when calling this.
   void RenderVideoFrame(VideoData* aData, TimeStamp aTarget);
- 
+
   // If we have video, display a video frame if it's time for display has
   // arrived, otherwise sleep until it's time for the next frame. Update the
   // current frame time as appropriate, and trigger ready state update.  The
   // decoder monitor must be held with exactly one lock count. Called on the
   // state machine thread.
   void AdvanceFrame();
 
   // Write aFrames of audio frames of silence to the audio hardware. Returns
@@ -646,17 +646,17 @@ protected:
   // The end time of the last audio frame that's been pushed onto the audio
   // hardware in microseconds. This will approximately be the end time of the
   // audio stream, unless another frame is pushed to the hardware.
   int64_t mAudioEndTime;
 
   // The presentation end time of the last video frame which has been displayed
   // in microseconds. Accessed from the state machine thread.
   int64_t mVideoFrameEndTime;
-  
+
   // Volume of playback. 0.0 = muted. 1.0 = full volume. Read/Written
   // from the state machine and main threads. Synchronised via decoder
   // monitor.
   double mVolume;
 
   // Time at which we started decoding. Synchronised via decoder monitor.
   TimeStamp mDecodeStartTime;
 
@@ -689,17 +689,17 @@ protected:
   // playing, or we've moved into shutdown state, and the threads are to be
   // destroyed. Written by the audio playback thread and read and written by
   // the state machine thread. Synchronised via decoder monitor.
   bool mAudioCompleted;
 
   // True if mDuration has a value obtained from an HTTP header, or from
   // the media index/metadata. Accessed on the state machine thread.
   bool mGotDurationFromMetaData;
-    
+
   // False while decode thread should be running. Accessed state machine
   // and decode threads. Syncrhonised by decoder monitor.
   bool mStopDecodeThread;
 
   // True when the decode thread run function has finished, but the thread
   // has not necessarily been shut down yet. This can happen if we switch
   // from COMPLETED state to SEEKING before the state machine has a chance
   // to run in the COMPLETED state and shutdown the decode thread.
@@ -744,18 +744,17 @@ protected:
   // previous iteration of DecodeLooop. When we transition from
   // throttled to not-throttled we need to pump decoding.
   bool mDidThrottleAudioDecoding;
   bool mDidThrottleVideoDecoding;
 
   // True if we've requested a new decode thread, but it has not yet been
   // created. Synchronized by the decoder monitor.
   bool mRequestedNewDecodeThread;
-  
-private:
+
   // Manager for queuing and dispatching MozAudioAvailable events.  The
   // event manager is accessed from the state machine and audio threads,
   // and takes care of synchronizing access to its internal queue.
   nsAudioAvailableEventManager mEventManager;
 
   // Stores presentation info required for playback. The decoder monitor
   // must be held when accessing this.
   nsVideoInfo mInfo;