Bug 1117261 - Mark virtual overridden functions as MOZ_OVERRIDE in DOM media code; r=rillian a=mse
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 02 Jan 2015 21:08:06 -0500
changeset 234693 6c65348fb3c8
parent 234692 8fc0d98dd7d0
child 234694 38492efb4a02
push id7461
push usereakhgari@mozilla.com
push date2015-01-09 19:24 +0000
treeherdermozilla-aurora@6c65348fb3c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian, mse
bugs1117261
milestone36.0a2
Bug 1117261 - Mark virtual overridden functions as MOZ_OVERRIDE in DOM media code; r=rillian a=mse
dom/media/AudioStreamTrack.h
dom/media/BufferMediaResource.h
dom/media/GraphDriver.h
dom/media/MediaDecoder.h
dom/media/MediaManager.cpp
dom/media/MediaPromise.h
dom/media/MediaRecorder.cpp
dom/media/MediaResource.cpp
dom/media/MediaResource.h
dom/media/MediaSegment.h
dom/media/MediaStreamGraph.h
dom/media/SharedThreadPool.h
dom/media/VideoStreamTrack.h
dom/media/encoder/OpusTrackEncoder.h
dom/media/fmp4/MP4Decoder.h
dom/media/gmp/GMPDecryptorChild.h
dom/media/mediasource/MediaSourceReader.h
dom/media/mediasource/SourceBufferDecoder.h
dom/media/ogg/OggReader.h
dom/media/raw/RawReader.h
dom/media/wave/WaveReader.h
dom/media/webm/WebMReader.h
dom/media/webrtc/MediaEngineCameraVideoSource.h
dom/media/webrtc/MediaEngineDefault.h
dom/media/webrtc/MediaEngineWebRTC.h
--- a/dom/media/AudioStreamTrack.h
+++ b/dom/media/AudioStreamTrack.h
@@ -14,18 +14,18 @@ namespace dom {
 
 class AudioStreamTrack : public MediaStreamTrack {
 public:
   AudioStreamTrack(DOMMediaStream* aStream, TrackID aTrackID)
     : MediaStreamTrack(aStream, aTrackID) {}
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
-  virtual AudioStreamTrack* AsAudioStreamTrack() { return this; }
+  virtual AudioStreamTrack* AsAudioStreamTrack() MOZ_OVERRIDE { return this; }
 
   // WebIDL
-  virtual void GetKind(nsAString& aKind) { aKind.AssignLiteral("audio"); }
+  virtual void GetKind(nsAString& aKind) MOZ_OVERRIDE { aKind.AssignLiteral("audio"); }
 };
 
 }
 }
 
 #endif /* AUDIOSTREAMTRACK_H_ */
--- a/dom/media/BufferMediaResource.h
+++ b/dom/media/BufferMediaResource.h
@@ -35,51 +35,51 @@ public:
 
 protected:
   virtual ~BufferMediaResource()
   {
     MOZ_COUNT_DTOR(BufferMediaResource);
   }
 
 private:
-  virtual nsresult Close() { return NS_OK; }
-  virtual void Suspend(bool aCloseImmediately) {}
-  virtual void Resume() {}
+  virtual nsresult Close() MOZ_OVERRIDE { return NS_OK; }
+  virtual void Suspend(bool aCloseImmediately) MOZ_OVERRIDE {}
+  virtual void Resume() MOZ_OVERRIDE {}
   // Get the current principal for the channel
-  virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal()
+  virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() MOZ_OVERRIDE
   {
     nsCOMPtr<nsIPrincipal> principal = mPrincipal;
     return principal.forget();
   }
-  virtual bool CanClone() { return false; }
-  virtual already_AddRefed<MediaResource> CloneData(MediaDecoder* aDecoder)
+  virtual bool CanClone() MOZ_OVERRIDE { return false; }
+  virtual already_AddRefed<MediaResource> CloneData(MediaDecoder* aDecoder) MOZ_OVERRIDE
   {
     return nullptr;
   }
 
   // These methods are called off the main thread.
   // The mode is initially MODE_PLAYBACK.
-  virtual void SetReadMode(MediaCacheStream::ReadMode aMode) {}
-  virtual void SetPlaybackRate(uint32_t aBytesPerSecond) {}
-  virtual nsresult Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes)
+  virtual void SetReadMode(MediaCacheStream::ReadMode aMode) MOZ_OVERRIDE {}
+  virtual void SetPlaybackRate(uint32_t aBytesPerSecond) MOZ_OVERRIDE {}
+  virtual nsresult Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes) MOZ_OVERRIDE
   {
     *aBytes = std::min(mLength - mOffset, aCount);
     memcpy(aBuffer, mBuffer + mOffset, *aBytes);
     mOffset += *aBytes;
     MOZ_ASSERT(mOffset <= mLength);
     return NS_OK;
   }
   virtual nsresult ReadAt(int64_t aOffset, char* aBuffer,
-                          uint32_t aCount, uint32_t* aBytes)
+                          uint32_t aCount, uint32_t* aBytes) MOZ_OVERRIDE
   {
     nsresult rv = Seek(nsISeekableStream::NS_SEEK_SET, aOffset);
     if (NS_FAILED(rv)) return rv;
     return Read(aBuffer, aCount, aBytes);
   }
-  virtual nsresult Seek(int32_t aWhence, int64_t aOffset)
+  virtual nsresult Seek(int32_t aWhence, int64_t aOffset) MOZ_OVERRIDE
   {
     MOZ_ASSERT(aOffset <= UINT32_MAX);
     switch (aWhence) {
     case nsISeekableStream::NS_SEEK_SET:
       if (aOffset < 0 || aOffset > mLength) {
         return NS_ERROR_FAILURE;
       }
       mOffset = static_cast<uint32_t> (aOffset);
@@ -95,48 +95,46 @@ private:
         return NS_ERROR_FAILURE;
       }
       mOffset = mLength - aOffset;
       break;
     }
 
     return NS_OK;
   }
-  virtual void StartSeekingForMetadata() {}
-  virtual void EndSeekingForMetadata() {}
-  virtual int64_t Tell() { return mOffset; }
+  virtual int64_t Tell() MOZ_OVERRIDE { return mOffset; }
 
-  virtual void Pin() {}
-  virtual void Unpin() {}
-  virtual double GetDownloadRate(bool* aIsReliable) { *aIsReliable = false; return 0.; }
-  virtual int64_t GetLength() { return mLength; }
-  virtual int64_t GetNextCachedData(int64_t aOffset) { return aOffset; }
-  virtual int64_t GetCachedDataEnd(int64_t aOffset) { return mLength; }
-  virtual bool IsDataCachedToEndOfResource(int64_t aOffset) { return true; }
-  virtual bool IsSuspendedByCache() { return false; }
-  virtual bool IsSuspended() { return false; }
+  virtual void Pin() MOZ_OVERRIDE {}
+  virtual void Unpin() MOZ_OVERRIDE {}
+  virtual double GetDownloadRate(bool* aIsReliable) MOZ_OVERRIDE { *aIsReliable = false; return 0.; }
+  virtual int64_t GetLength() MOZ_OVERRIDE { return mLength; }
+  virtual int64_t GetNextCachedData(int64_t aOffset) MOZ_OVERRIDE { return aOffset; }
+  virtual int64_t GetCachedDataEnd(int64_t aOffset) MOZ_OVERRIDE { return mLength; }
+  virtual bool IsDataCachedToEndOfResource(int64_t aOffset) MOZ_OVERRIDE { return true; }
+  virtual bool IsSuspendedByCache() MOZ_OVERRIDE { return false; }
+  virtual bool IsSuspended() MOZ_OVERRIDE { return false; }
   virtual nsresult ReadFromCache(char* aBuffer,
                                  int64_t aOffset,
-                                 uint32_t aCount)
+                                 uint32_t aCount) MOZ_OVERRIDE
   {
     if (aOffset < 0) {
       return NS_ERROR_FAILURE;
     }
 
     uint32_t bytes = std::min(mLength - static_cast<uint32_t>(aOffset), aCount);
     memcpy(aBuffer, mBuffer + aOffset, bytes);
     return NS_OK;
   }
 
-  virtual nsresult Open(nsIStreamListener** aStreamListener)
+  virtual nsresult Open(nsIStreamListener** aStreamListener) MOZ_OVERRIDE
   {
     return NS_ERROR_FAILURE;
   }
 
-  virtual nsresult GetCachedRanges(nsTArray<MediaByteRange>& aRanges)
+  virtual nsresult GetCachedRanges(nsTArray<MediaByteRange>& aRanges) MOZ_OVERRIDE
   {
     aRanges.AppendElement(MediaByteRange(0, mLength));
     return NS_OK;
   }
 
   bool IsTransportSeekable() MOZ_OVERRIDE { return true; }
 
   virtual const nsCString& GetContentType() const MOZ_OVERRIDE
--- a/dom/media/GraphDriver.h
+++ b/dom/media/GraphDriver.h
@@ -261,17 +261,17 @@ public:
   virtual void Resume() MOZ_OVERRIDE;
   virtual void Revive() MOZ_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() {
+  virtual uint32_t IterationDuration() MOZ_OVERRIDE {
     return MEDIA_GRAPH_TARGET_PERIOD_MS;
   }
 
   virtual bool OnThread() MOZ_OVERRIDE { return !mThread || NS_GetCurrentThread() == mThread; }
 
 protected:
   nsCOMPtr<nsIThread> mThread;
 };
@@ -307,17 +307,17 @@ public:
   OfflineClockDriver(MediaStreamGraphImpl* aGraphImpl, GraphTime aSlice);
   virtual ~OfflineClockDriver();
   virtual void GetIntervalForIteration(GraphTime& aFrom,
                                        GraphTime& aTo) MOZ_OVERRIDE;
   virtual GraphTime GetCurrentTime() MOZ_OVERRIDE;
   virtual void WaitForNextIteration() MOZ_OVERRIDE;
   virtual void WakeUp() MOZ_OVERRIDE;
   virtual TimeStamp GetCurrentTimeStamp() MOZ_OVERRIDE;
-  virtual OfflineClockDriver* AsOfflineClockDriver() {
+  virtual OfflineClockDriver* AsOfflineClockDriver() MOZ_OVERRIDE {
     return this;
   }
 
 private:
   // Time, in GraphTime, for each iteration
   GraphTime mSlice;
 };
 
@@ -373,27 +373,27 @@ public:
    * called again. If it is less than aFrames, the stream will go in draining
    * mode, and this function will not be called again. */
   long DataCallback(AudioDataValue* aBuffer, long aFrames);
   /* This function is called by the underlying audio backend, but is only used
    * for informational purposes at the moment. */
   void StateCallback(cubeb_state aState);
   /* This is an approximation of the number of millisecond there are between two
    * iterations of the graph. */
-  uint32_t IterationDuration();
+  virtual uint32_t IterationDuration() MOZ_OVERRIDE;
 
   /* This function gets called when the graph has produced the audio frames for
    * this iteration. */
   virtual void MixerCallback(AudioDataValue* aMixedBuffer,
                              AudioSampleFormat aFormat,
                              uint32_t aChannels,
                              uint32_t aFrames,
                              uint32_t aSampleRate) MOZ_OVERRIDE;
 
-  virtual AudioCallbackDriver* AsAudioCallbackDriver() {
+  virtual AudioCallbackDriver* AsAudioCallbackDriver() MOZ_OVERRIDE {
     return this;
   }
 
   bool IsSwitchingDevice() {
 #ifdef XP_MACOSX
     return mSelfReference;
 #else
     return false;
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -613,17 +613,17 @@ public:
   // Set a flag indicating whether seeking is supported
   virtual void SetMediaSeekable(bool aMediaSeekable) MOZ_OVERRIDE;
 
   // Returns true if this media supports seeking. False for example for WebM
   // files without an index and chained ogg files.
   virtual bool IsMediaSeekable() MOZ_FINAL MOZ_OVERRIDE;
   // Returns true if seeking is supported on a transport level (e.g. the server
   // supports range requests, we are playing a file, etc.).
-  virtual bool IsTransportSeekable();
+  virtual bool IsTransportSeekable() MOZ_OVERRIDE;
 
   // Return the time ranges that can be seeked into.
   virtual nsresult GetSeekable(dom::TimeRanges* aSeekable);
 
   // Set the end time of the media resource. When playback reaches
   // this point the media pauses. aTime is in seconds.
   virtual void SetFragmentEndTime(double aTime);
 
@@ -758,17 +758,17 @@ public:
   void SetAudioChannel(dom::AudioChannel aChannel) { mAudioChannel = aChannel; }
   dom::AudioChannel GetAudioChannel() { return mAudioChannel; }
 
   // Send a new set of metadata to the state machine, to be dispatched to the
   // main thread to be presented when the |currentTime| of the media is greater
   // or equal to aPublishTime.
   void QueueMetadata(int64_t aPublishTime,
                      nsAutoPtr<MediaInfo> aInfo,
-                     nsAutoPtr<MetadataTags> aTags);
+                     nsAutoPtr<MetadataTags> aTags) MOZ_OVERRIDE;
 
   int64_t GetSeekTime() { return mRequestedSeekTarget.mTime; }
   void ResetSeekTime() { mRequestedSeekTarget.Reset(); }
 
   /******
    * The following methods must only be called on the main
    * thread.
    ******/
@@ -784,21 +784,21 @@ public:
 
   // May be called by the reader to notify this decoder that the metadata from
   // the media file has been read. Call on the decode thread only.
   void OnReadMetadataCompleted() MOZ_OVERRIDE { }
 
   // Called when the metadata from the media file has been loaded by the
   // state machine. Call on the main thread only.
   virtual void MetadataLoaded(nsAutoPtr<MediaInfo> aInfo,
-                              nsAutoPtr<MetadataTags> aTags);
+                              nsAutoPtr<MetadataTags> aTags) MOZ_OVERRIDE;
 
   // Called when the first audio and/or video from the media file has been loaded
   // by the state machine. Call on the main thread only.
-  virtual void FirstFrameLoaded(nsAutoPtr<MediaInfo> aInfo);
+  virtual void FirstFrameLoaded(nsAutoPtr<MediaInfo> aInfo) MOZ_OVERRIDE;
 
   // Called from MetadataLoaded(). Creates audio tracks and adds them to its
   // owner's audio track list, and implies to video tracks respectively.
   // Call on the main thread only.
   void ConstructMediaTracks();
 
   // Removes all audio tracks and video tracks that are previously added into
   // the track list. Call on the main thread only.
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -592,28 +592,28 @@ public:
     if (mPort) {
       mPort->Destroy();
     }
     if (mSourceStream) {
       mSourceStream->Destroy();
     }
   }
 
-  virtual void Stop()
+  virtual void Stop() MOZ_OVERRIDE
   {
     if (mSourceStream) {
       mSourceStream->EndAllTrackAndFinish();
     }
   }
 
   // For gUM streams, we have a trackunion which assigns TrackIDs.  However, for a
   // single-source trackunion like we have here, the TrackUnion will assign trackids
   // that match the source's trackids, so we can avoid needing a mapping function.
   // XXX This will not handle more complex cases well.
-  virtual void StopTrack(TrackID aTrackID)
+  virtual void StopTrack(TrackID aTrackID) MOZ_OVERRIDE
   {
     if (mSourceStream) {
       mSourceStream->EndTrack(aTrackID);
       // We could override NotifyMediaStreamTrackEnded(), and maybe should, but it's
       // risky to do late in a release since that will affect all track ends, and not
       // just StopTrack()s.
       if (GetDOMTrackFor(aTrackID)) {
         mListener->StopTrack(aTrackID, !!GetDOMTrackFor(aTrackID)->AsAudioStreamTrack());
@@ -676,22 +676,22 @@ public:
     // We encapsulate the SourceMediaStream and TrackUnion into one entity, so
     // we can handle the disabling at the SourceMediaStream
 
     // We need to find the input track ID for output ID aID, so we let the TrackUnion
     // forward the request to the source and translate the ID
     GetStream()->AsProcessedStream()->ForwardTrackEnabled(aID, aEnabled);
   }
 
-  virtual DOMLocalMediaStream* AsDOMLocalMediaStream()
+  virtual DOMLocalMediaStream* AsDOMLocalMediaStream() MOZ_OVERRIDE
   {
     return this;
   }
 
-  virtual MediaEngineSource* GetMediaEngine(TrackID aTrackID)
+  virtual MediaEngineSource* GetMediaEngine(TrackID aTrackID) MOZ_OVERRIDE
   {
     // MediaEngine supports only one video and on video track now and TrackID is
     // fixed in MediaEngine.
     if (aTrackID == kVideoTrack) {
       return mVideoSource;
     }
     else if (aTrackID == kAudioTrack) {
       return mAudioSource;
--- a/dom/media/MediaPromise.h
+++ b/dom/media/MediaPromise.h
@@ -215,22 +215,22 @@ protected:
       PROMISE_LOG("%s Then() call made from %s [Runnable=%p, Promise=%p, ThenValue=%p]",
                   resolved ? "Resolving" : "Rejecting", ThenValueBase::mCallSite,
                   runnable.get(), aPromise, this);
       DebugOnly<nsresult> rv = detail::DispatchMediaPromiseRunnable(mResponseTarget, runnable);
       MOZ_ASSERT(NS_SUCCEEDED(rv));
     }
 
   protected:
-    virtual void DoResolve(ResolveValueType aResolveValue)
+    virtual void DoResolve(ResolveValueType aResolveValue) MOZ_OVERRIDE
     {
       InvokeCallbackMethod(mThisVal.get(), mResolveMethod, aResolveValue);
     }
 
-    virtual void DoReject(RejectValueType aRejectValue)
+    virtual void DoReject(RejectValueType aRejectValue) MOZ_OVERRIDE
     {
       InvokeCallbackMethod(mThisVal.get(), mRejectMethod, aRejectValue);
     }
 
     virtual ~ThenValue() {}
 
   private:
     nsRefPtr<TargetType> mResponseTarget;
--- a/dom/media/MediaRecorder.cpp
+++ b/dom/media/MediaRecorder.cpp
@@ -67,17 +67,17 @@ public:
     recorders.RemoveElement(aRecorder);
     if (recorders.IsEmpty()) {
       sUniqueInstance = nullptr;
     }
   }
 
   NS_METHOD
   CollectReports(nsIHandleReportCallback* aHandleReport,
-                 nsISupports* aData, bool aAnonymize)
+                 nsISupports* aData, bool aAnonymize) MOZ_OVERRIDE
   {
     int64_t amount = 0;
     RecordersArray& recorders = GetRecorders();
     for (size_t i = 0; i < recorders.Length(); ++i) {
       amount += recorders[i]->SizeOfExcludingThis(MallocSizeOf);
     }
 
   #define MEMREPORT(_path, _amount, _desc)                                    \
@@ -624,17 +624,17 @@ private:
     }
 
     if (mTrackUnionStream.get()) {
       mTrackUnionStream->Destroy();
       mTrackUnionStream = nullptr;
     }
   }
 
-  NS_IMETHODIMP Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData)
+  NS_IMETHODIMP Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData) MOZ_OVERRIDE
   {
     MOZ_ASSERT(NS_IsMainThread());
     LOG(PR_LOG_DEBUG, ("Session.Observe XPCOM_SHUTDOWN %p", this));
     if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
       // Force stop Session to terminate Read Thread.
       mEncoder->Cancel();
       if (mReadThread) {
         mReadThread->Shutdown();
--- a/dom/media/MediaResource.cpp
+++ b/dom/media/MediaResource.cpp
@@ -1192,70 +1192,70 @@ public:
     mSizeInitialized(false)
   {
   }
   ~FileMediaResource()
   {
   }
 
   // Main thread
-  virtual nsresult Open(nsIStreamListener** aStreamListener);
-  virtual nsresult Close();
-  virtual void     Suspend(bool aCloseImmediately) {}
-  virtual void     Resume() {}
-  virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal();
-  virtual bool     CanClone();
-  virtual already_AddRefed<MediaResource> CloneData(MediaDecoder* aDecoder);
-  virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount);
+  virtual nsresult Open(nsIStreamListener** aStreamListener) MOZ_OVERRIDE;
+  virtual nsresult Close() MOZ_OVERRIDE;
+  virtual void     Suspend(bool aCloseImmediately) MOZ_OVERRIDE {}
+  virtual void     Resume() MOZ_OVERRIDE {}
+  virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() MOZ_OVERRIDE;
+  virtual bool     CanClone() MOZ_OVERRIDE;
+  virtual already_AddRefed<MediaResource> CloneData(MediaDecoder* aDecoder) MOZ_OVERRIDE;
+  virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) MOZ_OVERRIDE;
 
   // These methods are called off the main thread.
 
   // Other thread
-  virtual void     SetReadMode(MediaCacheStream::ReadMode aMode) {}
-  virtual void     SetPlaybackRate(uint32_t aBytesPerSecond) {}
-  virtual nsresult Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes);
+  virtual void     SetReadMode(MediaCacheStream::ReadMode aMode) MOZ_OVERRIDE {}
+  virtual void     SetPlaybackRate(uint32_t aBytesPerSecond) MOZ_OVERRIDE {}
+  virtual nsresult Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes) MOZ_OVERRIDE;
   virtual nsresult ReadAt(int64_t aOffset, char* aBuffer,
-                          uint32_t aCount, uint32_t* aBytes);
-  virtual nsresult Seek(int32_t aWhence, int64_t aOffset);
-  virtual int64_t  Tell();
+                          uint32_t aCount, uint32_t* aBytes) MOZ_OVERRIDE;
+  virtual nsresult Seek(int32_t aWhence, int64_t aOffset) MOZ_OVERRIDE;
+  virtual int64_t  Tell() MOZ_OVERRIDE;
 
   // Any thread
-  virtual void    Pin() {}
-  virtual void    Unpin() {}
-  virtual double  GetDownloadRate(bool* aIsReliable)
+  virtual void    Pin() MOZ_OVERRIDE {}
+  virtual void    Unpin() MOZ_OVERRIDE {}
+  virtual double  GetDownloadRate(bool* aIsReliable) MOZ_OVERRIDE
   {
     // The data's all already here
     *aIsReliable = true;
     return 100*1024*1024; // arbitray, use 100MB/s
   }
-  virtual int64_t GetLength() {
+  virtual int64_t GetLength() MOZ_OVERRIDE {
     MutexAutoLock lock(mLock);
 
     EnsureSizeInitialized();
     return mSizeInitialized ? mSize : 0;
   }
-  virtual int64_t GetNextCachedData(int64_t aOffset)
+  virtual int64_t GetNextCachedData(int64_t aOffset) MOZ_OVERRIDE
   {
     MutexAutoLock lock(mLock);
 
     EnsureSizeInitialized();
     return (aOffset < mSize) ? aOffset : -1;
   }
-  virtual int64_t GetCachedDataEnd(int64_t aOffset) {
+  virtual int64_t GetCachedDataEnd(int64_t aOffset) MOZ_OVERRIDE {
     MutexAutoLock lock(mLock);
 
     EnsureSizeInitialized();
     return std::max(aOffset, mSize);
   }
-  virtual bool    IsDataCachedToEndOfResource(int64_t aOffset) { return true; }
-  virtual bool    IsSuspendedByCache() { return true; }
-  virtual bool    IsSuspended() { return true; }
+  virtual bool    IsDataCachedToEndOfResource(int64_t aOffset) MOZ_OVERRIDE { return true; }
+  virtual bool    IsSuspendedByCache() MOZ_OVERRIDE { return true; }
+  virtual bool    IsSuspended() MOZ_OVERRIDE { return true; }
   virtual bool    IsTransportSeekable() MOZ_OVERRIDE { return true; }
 
-  nsresult GetCachedRanges(nsTArray<MediaByteRange>& aRanges);
+  nsresult GetCachedRanges(nsTArray<MediaByteRange>& aRanges) MOZ_OVERRIDE;
 
   virtual size_t SizeOfExcludingThis(
                         MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
   {
     // Might be useful to track in the future:
     // - mInput
     return BaseMediaResource::SizeOfExcludingThis(aMallocSizeOf);
   }
--- a/dom/media/MediaResource.h
+++ b/dom/media/MediaResource.h
@@ -425,17 +425,17 @@ protected:
   virtual ~MediaResource() {};
 
 private:
   void Destroy();
 };
 
 class BaseMediaResource : public MediaResource {
 public:
-  virtual nsIURI* URI() const { return mURI; }
+  virtual nsIURI* URI() const MOZ_OVERRIDE { return mURI; }
   virtual void MoveLoadsToBackground();
 
   virtual size_t SizeOfExcludingThis(
                   MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
   {
     // Might be useful to track in the future:
     // - mChannel
     // - mURI (possibly owned, looks like just a ref from mChannel)
@@ -555,56 +555,56 @@ public:
   // Ensure that the media cache writes any data held in its partial block.
   // Called on the main thread.
   virtual void FlushCache() MOZ_OVERRIDE;
 
   // Notify that the last data byte range was loaded.
   virtual void NotifyLastByteRange() MOZ_OVERRIDE;
 
   // Main thread
-  virtual nsresult Open(nsIStreamListener** aStreamListener);
-  virtual nsresult Close();
-  virtual void     Suspend(bool aCloseImmediately);
-  virtual void     Resume();
-  virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal();
+  virtual nsresult Open(nsIStreamListener** aStreamListener) MOZ_OVERRIDE;
+  virtual nsresult Close() MOZ_OVERRIDE;
+  virtual void     Suspend(bool aCloseImmediately) MOZ_OVERRIDE;
+  virtual void     Resume() MOZ_OVERRIDE;
+  virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() MOZ_OVERRIDE;
   // Return true if the stream has been closed.
   bool IsClosed() const { return mCacheStream.IsClosed(); }
-  virtual bool     CanClone();
-  virtual already_AddRefed<MediaResource> CloneData(MediaDecoder* aDecoder);
+  virtual bool     CanClone() MOZ_OVERRIDE;
+  virtual already_AddRefed<MediaResource> CloneData(MediaDecoder* aDecoder) MOZ_OVERRIDE;
   // Set statistics to be recorded to the object passed in. If not called,
   // |ChannelMediaResource| will create it's own statistics objects in |Open|.
   void RecordStatisticsTo(MediaChannelStatistics *aStatistics) MOZ_OVERRIDE {
     NS_ASSERTION(aStatistics, "Statistics param cannot be null!");
     MutexAutoLock lock(mLock);
     if (!mChannelStatistics) {
       mChannelStatistics = aStatistics;
     }
   }
-  virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount);
-  virtual void     EnsureCacheUpToDate();
+  virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) MOZ_OVERRIDE;
+  virtual void     EnsureCacheUpToDate() MOZ_OVERRIDE;
 
   // Other thread
-  virtual void     SetReadMode(MediaCacheStream::ReadMode aMode);
-  virtual void     SetPlaybackRate(uint32_t aBytesPerSecond);
-  virtual nsresult Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes);
+  virtual void     SetReadMode(MediaCacheStream::ReadMode aMode) MOZ_OVERRIDE;
+  virtual void     SetPlaybackRate(uint32_t aBytesPerSecond) MOZ_OVERRIDE;
+  virtual nsresult Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes) MOZ_OVERRIDE;
   virtual nsresult ReadAt(int64_t offset, char* aBuffer,
-                          uint32_t aCount, uint32_t* aBytes);
-  virtual nsresult Seek(int32_t aWhence, int64_t aOffset);
-  virtual int64_t  Tell();
+                          uint32_t aCount, uint32_t* aBytes) MOZ_OVERRIDE;
+  virtual nsresult Seek(int32_t aWhence, int64_t aOffset) MOZ_OVERRIDE;
+  virtual int64_t  Tell() MOZ_OVERRIDE;
 
   // Any thread
-  virtual void    Pin();
-  virtual void    Unpin();
-  virtual double  GetDownloadRate(bool* aIsReliable);
-  virtual int64_t GetLength();
-  virtual int64_t GetNextCachedData(int64_t aOffset);
-  virtual int64_t GetCachedDataEnd(int64_t aOffset);
-  virtual bool    IsDataCachedToEndOfResource(int64_t aOffset);
-  virtual bool    IsSuspendedByCache();
-  virtual bool    IsSuspended();
+  virtual void    Pin() MOZ_OVERRIDE;
+  virtual void    Unpin() MOZ_OVERRIDE;
+  virtual double  GetDownloadRate(bool* aIsReliable) MOZ_OVERRIDE;
+  virtual int64_t GetLength() MOZ_OVERRIDE;
+  virtual int64_t GetNextCachedData(int64_t aOffset) MOZ_OVERRIDE;
+  virtual int64_t GetCachedDataEnd(int64_t aOffset) MOZ_OVERRIDE;
+  virtual bool    IsDataCachedToEndOfResource(int64_t aOffset) MOZ_OVERRIDE;
+  virtual bool    IsSuspendedByCache() MOZ_OVERRIDE;
+  virtual bool    IsSuspended() MOZ_OVERRIDE;
   virtual bool    IsTransportSeekable() MOZ_OVERRIDE;
 
   virtual size_t SizeOfExcludingThis(
                       MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE {
     // Might be useful to track in the future:
     //   - mListener (seems minor)
     //   - mChannelStatistics (seems minor)
     //     owned if RecordStatisticsTo is not called
@@ -636,17 +636,17 @@ public:
 
     void Revoke() { mResource = nullptr; }
 
   private:
     nsRefPtr<ChannelMediaResource> mResource;
   };
   friend class Listener;
 
-  nsresult GetCachedRanges(nsTArray<MediaByteRange>& aRanges);
+  virtual nsresult GetCachedRanges(nsTArray<MediaByteRange>& aRanges) MOZ_OVERRIDE;
 
 protected:
   // These are called on the main thread by Listener.
   nsresult OnStartRequest(nsIRequest* aRequest);
   nsresult OnStopRequest(nsIRequest* aRequest, nsresult aStatus);
   nsresult OnDataAvailable(nsIRequest* aRequest,
                            nsIInputStream* aStream,
                            uint32_t aCount);
--- a/dom/media/MediaSegment.h
+++ b/dom/media/MediaSegment.h
@@ -138,44 +138,44 @@ protected:
 };
 
 /**
  * C is the implementation class subclassed from MediaSegmentBase.
  * C must contain a Chunk class.
  */
 template <class C, class Chunk> class MediaSegmentBase : public MediaSegment {
 public:
-  virtual MediaSegment* CreateEmptyClone() const
+  virtual MediaSegment* CreateEmptyClone() const MOZ_OVERRIDE
   {
     return new C();
   }
-  virtual void AppendFrom(MediaSegment* aSource)
+  virtual void AppendFrom(MediaSegment* aSource) MOZ_OVERRIDE
   {
     NS_ASSERTION(aSource->GetType() == C::StaticType(), "Wrong type");
     AppendFromInternal(static_cast<C*>(aSource));
   }
   void AppendFrom(C* aSource)
   {
     AppendFromInternal(aSource);
   }
   virtual void AppendSlice(const MediaSegment& aSource,
-                           StreamTime aStart, StreamTime aEnd)
+                           StreamTime aStart, StreamTime aEnd) MOZ_OVERRIDE
   {
     NS_ASSERTION(aSource.GetType() == C::StaticType(), "Wrong type");
     AppendSliceInternal(static_cast<const C&>(aSource), aStart, aEnd);
   }
   void AppendSlice(const C& aOther, StreamTime aStart, StreamTime aEnd)
   {
     AppendSliceInternal(aOther, aStart, aEnd);
   }
   /**
    * Replace the first aDuration ticks with null media data, because the data
    * will not be required again.
    */
-  virtual void ForgetUpTo(StreamTime aDuration)
+  virtual void ForgetUpTo(StreamTime aDuration) MOZ_OVERRIDE
   {
     if (mChunks.IsEmpty() || aDuration <= 0) {
       return;
     }
     if (mChunks[0].IsNull()) {
       StreamTime extraToForget = std::min(aDuration, mDuration) - mChunks[0].GetDuration();
       if (extraToForget > 0) {
         RemoveLeading(extraToForget, 1);
@@ -183,17 +183,17 @@ public:
         mDuration += extraToForget;
       }
       return;
     }
     RemoveLeading(aDuration, 0);
     mChunks.InsertElementAt(0)->SetNull(aDuration);
     mDuration += aDuration;
   }
-  virtual void FlushAfter(StreamTime aNewEnd)
+  virtual void FlushAfter(StreamTime aNewEnd) MOZ_OVERRIDE
   {
     if (mChunks.IsEmpty()) {
       return;
     }
 
     if (mChunks[0].IsNull()) {
       StreamTime extraToKeep = aNewEnd - mChunks[0].GetDuration();
       if (extraToKeep < 0) {
@@ -206,53 +206,53 @@ public:
       if (aNewEnd > mDuration) {
         NS_ASSERTION(aNewEnd <= mDuration, "can't add data in FlushAfter");
         return;
       }
       RemoveTrailing(aNewEnd, 0);
     }
     mDuration = aNewEnd;
   }
-  virtual void InsertNullDataAtStart(StreamTime aDuration)
+  virtual void InsertNullDataAtStart(StreamTime aDuration) MOZ_OVERRIDE
   {
     if (aDuration <= 0) {
       return;
     }
     if (!mChunks.IsEmpty() && mChunks[0].IsNull()) {
       mChunks[0].mDuration += aDuration;
     } else {
       mChunks.InsertElementAt(0)->SetNull(aDuration);
     }
 #ifdef MOZILLA_INTERNAL_API
     mChunks[0].mTimeStamp = mozilla::TimeStamp::Now();
 #endif
     mDuration += aDuration;
   }
-  virtual void AppendNullData(StreamTime aDuration)
+  virtual void AppendNullData(StreamTime aDuration) MOZ_OVERRIDE
   {
     if (aDuration <= 0) {
       return;
     }
     if (!mChunks.IsEmpty() && mChunks[mChunks.Length() - 1].IsNull()) {
       mChunks[mChunks.Length() - 1].mDuration += aDuration;
     } else {
       mChunks.AppendElement()->SetNull(aDuration);
     }
     mDuration += aDuration;
   }
-  virtual void ReplaceWithDisabled()
+  virtual void ReplaceWithDisabled() MOZ_OVERRIDE
   {
     if (GetType() != AUDIO) {
       MOZ_CRASH("Disabling unknown segment type");
     }
     StreamTime duration = GetDuration();
     Clear();
     AppendNullData(duration);
   }
-  virtual void Clear()
+  virtual void Clear() MOZ_OVERRIDE
   {
     mDuration = 0;
     mChunks.Clear();
   }
 
   class ChunkIterator {
   public:
     explicit ChunkIterator(MediaSegmentBase<C, Chunk>& aSegment)
--- a/dom/media/MediaStreamGraph.h
+++ b/dom/media/MediaStreamGraph.h
@@ -688,20 +688,20 @@ public:
     mLastConsumptionState(MediaStreamListener::NOT_CONSUMED),
     mMutex("mozilla::media::SourceMediaStream"),
     mUpdateKnownTracksTime(0),
     mPullEnabled(false),
     mUpdateFinished(false),
     mNeedsMixing(false)
   {}
 
-  virtual SourceMediaStream* AsSourceStream() { return this; }
+  virtual SourceMediaStream* AsSourceStream() MOZ_OVERRIDE { return this; }
 
   // Media graph thread only
-  virtual void DestroyImpl();
+  virtual void DestroyImpl() MOZ_OVERRIDE;
 
   // Call these on any thread.
   /**
    * Enable or disable pulling. When pulling is enabled, NotifyPull
    * gets called on MediaStreamListeners for this stream during the
    * MediaStreamGraph control loop. Pulling is initially disabled.
    * Due to unavoidable race conditions, after a call to SetPullEnabled(false)
    * it is still possible for a NotifyPull to occur.
@@ -1064,17 +1064,17 @@ public:
   void Finish();
   /**
    * Set the autofinish flag on this stream (defaults to false). When this flag
    * is set, and all input streams are in the finished state (including if there
    * are no input streams), this stream automatically enters the finished state.
    */
   void SetAutofinish(bool aAutofinish);
 
-  virtual ProcessedMediaStream* AsProcessedStream() { return this; }
+  virtual ProcessedMediaStream* AsProcessedStream() MOZ_OVERRIDE { return this; }
 
   friend class MediaStreamGraphImpl;
 
   // Do not call these from outside MediaStreamGraph.cpp!
   virtual void AddInput(MediaInputPort* aPort);
   virtual void RemoveInput(MediaInputPort* aPort)
   {
     mInputs.RemoveElement(aPort);
@@ -1082,17 +1082,17 @@ public:
   bool HasInputPort(MediaInputPort* aPort)
   {
     return mInputs.Contains(aPort);
   }
   uint32_t InputPortCount()
   {
     return mInputs.Length();
   }
-  virtual void DestroyImpl();
+  virtual void DestroyImpl() MOZ_OVERRIDE;
   /**
    * This gets called after we've computed the blocking states for all
    * streams (mBlocked is up to date up to mStateComputedTime).
    * Also, we've produced output for all streams up to this one. If this stream
    * is not in a cycle, then all its source streams have produced data.
    * Generate output from aFrom to aTo.
    * This will be called on streams that have finished. Most stream types should
    * just return immediately if IsFinishedOnGraphThread(), but some may wish to
--- a/dom/media/SharedThreadPool.h
+++ b/dom/media/SharedThreadPool.h
@@ -38,19 +38,19 @@ public:
   // Spins the event loop until all thread pools are shutdown.
   // *Must* be called on the main thread.
   static void SpinUntilShutdown();
 
   // We implement custom threadsafe AddRef/Release pair, that destroys the
   // the shared pool singleton when the refcount drops to 0. The addref/release
   // are implemented using locking, so it's not recommended that you use them
   // in a tight loop.
-  NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
-  NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
-  NS_IMETHOD_(MozExternalRefCountType) Release(void);
+  NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) MOZ_OVERRIDE;
+  NS_IMETHOD_(MozExternalRefCountType) AddRef(void) MOZ_OVERRIDE;
+  NS_IMETHOD_(MozExternalRefCountType) Release(void) MOZ_OVERRIDE;
 
   // Forward behaviour to wrapped thread pool implementation.
   NS_FORWARD_SAFE_NSITHREADPOOL(mPool);
   NS_FORWARD_SAFE_NSIEVENTTARGET(mEventTarget);
 
 private:
 
   // Creates necessary statics.
--- a/dom/media/VideoStreamTrack.h
+++ b/dom/media/VideoStreamTrack.h
@@ -14,18 +14,18 @@ namespace dom {
 
 class VideoStreamTrack : public MediaStreamTrack {
 public:
   VideoStreamTrack(DOMMediaStream* aStream, TrackID aTrackID)
     : MediaStreamTrack(aStream, aTrackID) {}
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
-  virtual VideoStreamTrack* AsVideoStreamTrack() { return this; }
+  virtual VideoStreamTrack* AsVideoStreamTrack() MOZ_OVERRIDE { return this; }
 
   // WebIDL
-  virtual void GetKind(nsAString& aKind) { aKind.AssignLiteral("video"); }
+  virtual void GetKind(nsAString& aKind) MOZ_OVERRIDE { aKind.AssignLiteral("video"); }
 };
 
 }
 }
 
 #endif /* VIDEOSTREAMTRACK_H_ */
--- a/dom/media/encoder/OpusTrackEncoder.h
+++ b/dom/media/encoder/OpusTrackEncoder.h
@@ -32,17 +32,17 @@ public:
   OpusTrackEncoder();
   virtual ~OpusTrackEncoder();
 
   already_AddRefed<TrackMetadataBase> GetMetadata() MOZ_OVERRIDE;
 
   nsresult GetEncodedTrack(EncodedFrameContainer& aData) MOZ_OVERRIDE;
 
 protected:
-  int GetPacketDuration();
+  int GetPacketDuration() MOZ_OVERRIDE;
 
   nsresult Init(int aChannels, int aSamplingRate) MOZ_OVERRIDE;
 
   /**
    * Get the samplerate of the data to be fed to the Opus encoder. This might be
    * different from the input samplerate if resampling occurs.
    */
   int GetOutputSampleRate();
--- a/dom/media/fmp4/MP4Decoder.h
+++ b/dom/media/fmp4/MP4Decoder.h
@@ -10,24 +10,24 @@
 
 namespace mozilla {
 
 // Decoder that uses a bundled MP4 demuxer and platform decoders to play MP4.
 class MP4Decoder : public MediaDecoder
 {
 public:
 
-  virtual MediaDecoder* Clone() {
+  virtual MediaDecoder* Clone() MOZ_OVERRIDE {
     if (!IsEnabled()) {
       return nullptr;
     }
     return new MP4Decoder();
   }
 
-  virtual MediaDecoderStateMachine* CreateStateMachine();
+  virtual MediaDecoderStateMachine* CreateStateMachine() MOZ_OVERRIDE;
 
 #ifdef MOZ_EME
   virtual nsresult SetCDMProxy(CDMProxy* aProxy) MOZ_OVERRIDE;
 #endif
 
   // Returns true if aMIMEType is a type that we think we can render with the
   // a MP4 platform decoder backend. If aCodecs is non emtpy, it is filled
   // with a comma-delimited list of codecs to check support for. Notes in
--- a/dom/media/gmp/GMPDecryptorChild.h
+++ b/dom/media/gmp/GMPDecryptorChild.h
@@ -104,17 +104,17 @@ private:
   virtual bool RecvCloseSession(const uint32_t& aPromiseId,
                                 const nsCString& aSessionId) MOZ_OVERRIDE;
 
   virtual bool RecvRemoveSession(const uint32_t& aPromiseId,
                                  const nsCString& aSessionId) MOZ_OVERRIDE;
 
   virtual bool RecvDecrypt(const uint32_t& aId,
                            const nsTArray<uint8_t>& aBuffer,
-                           const GMPDecryptionData& aMetadata);
+                           const GMPDecryptionData& aMetadata) MOZ_OVERRIDE;
 
   // Resolve/reject promise on completion.
   virtual bool RecvSetServerCertificate(const uint32_t& aPromiseId,
                                         const nsTArray<uint8_t>& aServerCert) MOZ_OVERRIDE;
 
   virtual bool RecvDecryptingComplete() MOZ_OVERRIDE;
 
   // GMP's GMPDecryptor implementation.
--- a/dom/media/mediasource/MediaSourceReader.h
+++ b/dom/media/mediasource/MediaSourceReader.h
@@ -83,17 +83,17 @@ public:
   virtual int64_t ComputeStartTime(const VideoData* aVideo, const AudioData* aAudio) MOZ_OVERRIDE { return 0; }
 
   // Buffering heuristics don't make sense for MSE, because the arrival of data
   // is at least partly controlled by javascript, and javascript does not expect
   // us to sit on unplayed data just because it may not be enough to play
   // through.
   bool UseBufferingHeuristics() MOZ_OVERRIDE { return false; }
 
-  bool IsMediaSeekable() { return true; }
+  bool IsMediaSeekable() MOZ_OVERRIDE { return true; }
 
   nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) MOZ_OVERRIDE;
   void ReadUpdatedMetadata(MediaInfo* aInfo) MOZ_OVERRIDE;
   nsRefPtr<SeekPromise>
   Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
        int64_t aCurrentTime) MOZ_OVERRIDE;
 
   // Acquires the decoder monitor, and is thus callable on any thread.
@@ -103,17 +103,17 @@ public:
                                                          int64_t aTimestampOffset /* microseconds */);
 
   void AddTrackBuffer(TrackBuffer* aTrackBuffer);
   void RemoveTrackBuffer(TrackBuffer* aTrackBuffer);
   void OnTrackBufferConfigured(TrackBuffer* aTrackBuffer, const MediaInfo& aInfo);
 
   nsRefPtr<ShutdownPromise> Shutdown() MOZ_OVERRIDE;
 
-  virtual void BreakCycles();
+  virtual void BreakCycles() MOZ_OVERRIDE;
 
   bool IsShutdown()
   {
     ReentrantMonitorAutoEnter decoderMon(mDecoder->GetReentrantMonitor());
     return mDecoder->IsShutdown();
   }
 
   // Return true if all of the active tracks contain data for the specified time.
--- a/dom/media/mediasource/SourceBufferDecoder.h
+++ b/dom/media/mediasource/SourceBufferDecoder.h
@@ -96,17 +96,17 @@ public:
     }
     mTaskQueue = nullptr;
 #ifdef MOZ_EME
     mCDMProxy = nullptr;
 #endif
   }
 
 #ifdef MOZ_EME
-  virtual nsresult SetCDMProxy(CDMProxy* aProxy)
+  virtual nsresult SetCDMProxy(CDMProxy* aProxy) MOZ_OVERRIDE
   {
     MOZ_ASSERT(NS_IsMainThread());
     ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
     mCDMProxy = aProxy;
     return NS_OK;
   }
 
   virtual CDMProxy* GetCDMProxy() MOZ_OVERRIDE
--- a/dom/media/ogg/OggReader.h
+++ b/dom/media/ogg/OggReader.h
@@ -49,43 +49,43 @@ class OggReader MOZ_FINAL : public Media
 {
 public:
   explicit OggReader(AbstractMediaDecoder* aDecoder);
 
 protected:
   ~OggReader();
 
 public:
-  virtual nsresult Init(MediaDecoderReader* aCloneDonor);
-  virtual nsresult ResetDecode();
-  virtual bool DecodeAudioData();
+  virtual nsresult Init(MediaDecoderReader* aCloneDonor) MOZ_OVERRIDE;
+  virtual nsresult ResetDecode() MOZ_OVERRIDE;
+  virtual bool DecodeAudioData() MOZ_OVERRIDE;
 
   // If the Theora granulepos has not been captured, it may read several packets
   // until one with a granulepos has been captured, to ensure that all packets
   // read have valid time info.
   virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
-                                  int64_t aTimeThreshold);
+                                  int64_t aTimeThreshold) MOZ_OVERRIDE;
 
-  virtual bool HasAudio() {
+  virtual bool HasAudio() MOZ_OVERRIDE {
     return (mVorbisState != 0 && mVorbisState->mActive)
 #ifdef MOZ_OPUS
       || (mOpusState != 0 && mOpusState->mActive)
 #endif /* MOZ_OPUS */
       ;
   }
 
-  virtual bool HasVideo() {
+  virtual bool HasVideo() MOZ_OVERRIDE {
     return mTheoraState != 0 && mTheoraState->mActive;
   }
 
   virtual nsresult ReadMetadata(MediaInfo* aInfo,
-                                MetadataTags** aTags);
+                                MetadataTags** aTags) MOZ_OVERRIDE;
   virtual nsRefPtr<SeekPromise>
   Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime) MOZ_OVERRIDE;
-  virtual nsresult GetBuffered(dom::TimeRanges* aBuffered);
+  virtual nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
 
   virtual bool IsMediaSeekable() MOZ_OVERRIDE;
 
 private:
   // TODO: DEPRECATED. This uses synchronous decoding.
   // Stores the presentation time of the first frame we'd be able to play if
   // we started playback at the current position. Returns the first video
   // frame, if we have video.
--- a/dom/media/raw/RawReader.h
+++ b/dom/media/raw/RawReader.h
@@ -15,39 +15,39 @@ class RawReader : public MediaDecoderRea
 {
 public:
   explicit RawReader(AbstractMediaDecoder* aDecoder);
 
 protected:
   ~RawReader();
 
 public:
-  virtual nsresult Init(MediaDecoderReader* aCloneDonor);
-  virtual nsresult ResetDecode();
-  virtual bool DecodeAudioData();
+  virtual nsresult Init(MediaDecoderReader* aCloneDonor) MOZ_OVERRIDE;
+  virtual nsresult ResetDecode() MOZ_OVERRIDE;
+  virtual bool DecodeAudioData() MOZ_OVERRIDE;
 
   virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
-                                  int64_t aTimeThreshold);
+                                  int64_t aTimeThreshold) MOZ_OVERRIDE;
 
-  virtual bool HasAudio()
+  virtual bool HasAudio() MOZ_OVERRIDE
   {
     return false;
   }
 
-  virtual bool HasVideo()
+  virtual bool HasVideo() MOZ_OVERRIDE
   {
     return true;
   }
 
   virtual nsresult ReadMetadata(MediaInfo* aInfo,
-                                MetadataTags** aTags);
+                                MetadataTags** aTags) MOZ_OVERRIDE;
   virtual nsRefPtr<SeekPromise>
   Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime) MOZ_OVERRIDE;
 
-  virtual nsresult GetBuffered(dom::TimeRanges* aBuffered);
+  virtual nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
 
   virtual bool IsMediaSeekable() MOZ_OVERRIDE;
 
 private:
   bool ReadFromResource(MediaResource *aResource, uint8_t *aBuf, uint32_t aLength);
 
   nsresult SeekInternal(int64_t aTime);
 
--- a/dom/media/wave/WaveReader.h
+++ b/dom/media/wave/WaveReader.h
@@ -21,42 +21,37 @@ class WaveReader : public MediaDecoderRe
 {
 public:
   explicit WaveReader(AbstractMediaDecoder* aDecoder);
 
 protected:
   ~WaveReader();
 
 public:
-  virtual nsresult Init(MediaDecoderReader* aCloneDonor);
-  virtual bool DecodeAudioData();
+  virtual nsresult Init(MediaDecoderReader* aCloneDonor) MOZ_OVERRIDE;
+  virtual bool DecodeAudioData() MOZ_OVERRIDE;
   virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
-                                  int64_t aTimeThreshold);
+                                  int64_t aTimeThreshold) MOZ_OVERRIDE;
 
-  virtual bool HasAudio()
+  virtual bool HasAudio() MOZ_OVERRIDE
   {
     return true;
   }
 
-  virtual bool HasVideo()
+  virtual bool HasVideo() MOZ_OVERRIDE
   {
     return false;
   }
 
   virtual nsresult ReadMetadata(MediaInfo* aInfo,
-                                MetadataTags** aTags);
+                                MetadataTags** aTags) MOZ_OVERRIDE;
   virtual nsRefPtr<SeekPromise>
   Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime) MOZ_OVERRIDE;
 
-  virtual nsresult GetBuffered(dom::TimeRanges* aBuffered);
-
-  // To seek in a buffered range, we just have to seek the stream.
-  virtual bool IsSeekableInBufferedRanges() {
-    return true;
-  }
+  virtual nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
 
   virtual bool IsMediaSeekable() MOZ_OVERRIDE;
 
 private:
   bool ReadAll(char* aBuf, int64_t aSize, int64_t* aBytesRead = nullptr);
   bool LoadRIFFChunk();
   bool GetNextChunk(uint32_t* aChunk, uint32_t* aChunkSize);
   bool LoadFormatChunk(uint32_t aChunkSize);
--- a/dom/media/webm/WebMReader.h
+++ b/dom/media/webm/WebMReader.h
@@ -131,44 +131,44 @@ class WebMReader : public MediaDecoderRe
 public:
   explicit WebMReader(AbstractMediaDecoder* aDecoder);
 
 protected:
   ~WebMReader();
 
 public:
   virtual nsRefPtr<ShutdownPromise> Shutdown() MOZ_OVERRIDE;
-  virtual nsresult Init(MediaDecoderReader* aCloneDonor);
-  virtual nsresult ResetDecode();
-  virtual bool DecodeAudioData();
+  virtual nsresult Init(MediaDecoderReader* aCloneDonor) MOZ_OVERRIDE;
+  virtual nsresult ResetDecode() MOZ_OVERRIDE;
+  virtual bool DecodeAudioData() MOZ_OVERRIDE;
 
   virtual bool DecodeVideoFrame(bool &aKeyframeSkip,
-                                int64_t aTimeThreshold);
+                                int64_t aTimeThreshold) MOZ_OVERRIDE;
 
-  virtual bool HasAudio()
+  virtual bool HasAudio() MOZ_OVERRIDE
   {
     NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
     return mHasAudio;
   }
 
-  virtual bool HasVideo()
+  virtual bool HasVideo() MOZ_OVERRIDE
   {
     NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
     return mHasVideo;
   }
 
   virtual nsresult ReadMetadata(MediaInfo* aInfo,
-                                MetadataTags** aTags);
+                                MetadataTags** aTags) MOZ_OVERRIDE;
   virtual nsRefPtr<SeekPromise>
   Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime) MOZ_OVERRIDE;
 
-  virtual nsresult GetBuffered(dom::TimeRanges* aBuffered);
+  virtual nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
   virtual void NotifyDataArrived(const char* aBuffer, uint32_t aLength,
-                                 int64_t aOffset);
-  virtual int64_t GetEvictionOffset(double aTime);
+                                 int64_t aOffset) MOZ_OVERRIDE;
+  virtual int64_t GetEvictionOffset(double aTime) MOZ_OVERRIDE;
 
   virtual bool IsMediaSeekable() MOZ_OVERRIDE;
 
   // Value passed to NextPacket to determine if we are reading a video or an
   // audio packet.
   enum TrackType {
     VIDEO = 0,
     AUDIO = 1
--- a/dom/media/webrtc/MediaEngineCameraVideoSource.h
+++ b/dom/media/webrtc/MediaEngineCameraVideoSource.h
@@ -44,17 +44,17 @@ public:
     return NS_OK;
   };
 
   virtual bool IsFake() MOZ_OVERRIDE
   {
     return false;
   }
 
-  virtual const MediaSourceType GetMediaSource() {
+  virtual const MediaSourceType GetMediaSource() MOZ_OVERRIDE {
       return MediaSourceType::Camera;
   }
 
   virtual nsresult TakePhoto(PhotoCallback* aCallback) MOZ_OVERRIDE
   {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
--- a/dom/media/webrtc/MediaEngineDefault.h
+++ b/dom/media/webrtc/MediaEngineDefault.h
@@ -32,48 +32,48 @@ class MediaEngineDefault;
  * The default implementation of the MediaEngine interface.
  */
 class MediaEngineDefaultVideoSource : public nsITimerCallback,
                                       public MediaEngineVideoSource
 {
 public:
   MediaEngineDefaultVideoSource();
 
-  virtual void GetName(nsAString&);
-  virtual void GetUUID(nsAString&);
+  virtual void GetName(nsAString&) MOZ_OVERRIDE;
+  virtual void GetUUID(nsAString&) MOZ_OVERRIDE;
 
   virtual nsresult Allocate(const VideoTrackConstraintsN &aConstraints,
-                            const MediaEnginePrefs &aPrefs);
-  virtual nsresult Deallocate();
-  virtual nsresult Start(SourceMediaStream*, TrackID);
-  virtual nsresult Stop(SourceMediaStream*, TrackID);
-  virtual void SetDirectListeners(bool aHasDirectListeners) {};
+                            const MediaEnginePrefs &aPrefs) MOZ_OVERRIDE;
+  virtual nsresult Deallocate() MOZ_OVERRIDE;
+  virtual nsresult Start(SourceMediaStream*, TrackID) MOZ_OVERRIDE;
+  virtual nsresult Stop(SourceMediaStream*, TrackID) MOZ_OVERRIDE;
+  virtual void SetDirectListeners(bool aHasDirectListeners) MOZ_OVERRIDE {};
   virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
                           bool aAgcOn, uint32_t aAGC,
                           bool aNoiseOn, uint32_t aNoise,
-                          int32_t aPlayoutDelay) { return NS_OK; };
+                          int32_t aPlayoutDelay) MOZ_OVERRIDE { return NS_OK; };
   virtual void NotifyPull(MediaStreamGraph* aGraph,
                           SourceMediaStream *aSource,
                           TrackID aId,
                           StreamTime aDesiredTime) MOZ_OVERRIDE;
   virtual bool SatisfiesConstraintSets(
-      const nsTArray<const dom::MediaTrackConstraintSet*>& aConstraintSets)
+      const nsTArray<const dom::MediaTrackConstraintSet*>& aConstraintSets) MOZ_OVERRIDE
   {
     return true;
   }
 
-  virtual bool IsFake() {
+  virtual bool IsFake() MOZ_OVERRIDE {
     return true;
   }
 
-  virtual const MediaSourceType GetMediaSource() {
+  virtual const MediaSourceType GetMediaSource() MOZ_OVERRIDE {
     return MediaSourceType::Camera;
   }
 
-  virtual nsresult TakePhoto(PhotoCallback* aCallback)
+  virtual nsresult TakePhoto(PhotoCallback* aCallback) MOZ_OVERRIDE
   {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
 
 protected:
@@ -100,43 +100,43 @@ protected:
 class SineWaveGenerator;
 
 class MediaEngineDefaultAudioSource : public nsITimerCallback,
                                       public MediaEngineAudioSource
 {
 public:
   MediaEngineDefaultAudioSource();
 
-  virtual void GetName(nsAString&);
-  virtual void GetUUID(nsAString&);
+  virtual void GetName(nsAString&) MOZ_OVERRIDE;
+  virtual void GetUUID(nsAString&) MOZ_OVERRIDE;
 
   virtual nsresult Allocate(const AudioTrackConstraintsN &aConstraints,
-                            const MediaEnginePrefs &aPrefs);
-  virtual nsresult Deallocate();
-  virtual nsresult Start(SourceMediaStream*, TrackID);
-  virtual nsresult Stop(SourceMediaStream*, TrackID);
-  virtual void SetDirectListeners(bool aHasDirectListeners) {};
+                            const MediaEnginePrefs &aPrefs) MOZ_OVERRIDE;
+  virtual nsresult Deallocate() MOZ_OVERRIDE;
+  virtual nsresult Start(SourceMediaStream*, TrackID) MOZ_OVERRIDE;
+  virtual nsresult Stop(SourceMediaStream*, TrackID) MOZ_OVERRIDE;
+  virtual void SetDirectListeners(bool aHasDirectListeners) MOZ_OVERRIDE {};
   virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
                           bool aAgcOn, uint32_t aAGC,
                           bool aNoiseOn, uint32_t aNoise,
-                          int32_t aPlayoutDelay) { return NS_OK; };
+                          int32_t aPlayoutDelay) MOZ_OVERRIDE { return NS_OK; };
   virtual void NotifyPull(MediaStreamGraph* aGraph,
                           SourceMediaStream *aSource,
                           TrackID aId,
                           StreamTime aDesiredTime) MOZ_OVERRIDE {}
 
-  virtual bool IsFake() {
+  virtual bool IsFake() MOZ_OVERRIDE {
     return true;
   }
 
-  virtual const MediaSourceType GetMediaSource() {
+  virtual const MediaSourceType GetMediaSource() MOZ_OVERRIDE {
     return MediaSourceType::Microphone;
   }
 
-  virtual nsresult TakePhoto(PhotoCallback* aCallback)
+  virtual nsresult TakePhoto(PhotoCallback* aCallback) MOZ_OVERRIDE
   {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
 
 protected:
--- a/dom/media/webrtc/MediaEngineWebRTC.h
+++ b/dom/media/webrtc/MediaEngineWebRTC.h
@@ -60,62 +60,62 @@ namespace mozilla {
  */
 class MediaEngineWebRTCVideoSource : public MediaEngineCameraVideoSource
                                    , public webrtc::ExternalRenderer
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
   // ViEExternalRenderer.
-  virtual int FrameSizeChange(unsigned int w, unsigned int h, unsigned int streams);
+  virtual int FrameSizeChange(unsigned int w, unsigned int h, unsigned int streams) MOZ_OVERRIDE;
   virtual int DeliverFrame(unsigned char* buffer,
                            int size,
                            uint32_t time_stamp,
                            int64_t render_time,
-                           void *handle);
+                           void *handle) MOZ_OVERRIDE;
   /**
    * Does DeliverFrame() support a null buffer and non-null handle
    * (video texture)?
    * XXX Investigate!  Especially for Android/B2G
    */
-  virtual bool IsTextureSupported() { return false; }
+  virtual bool IsTextureSupported() MOZ_OVERRIDE { return false; }
 
   MediaEngineWebRTCVideoSource(webrtc::VideoEngine* aVideoEnginePtr, int aIndex,
                                MediaSourceType aMediaSource = MediaSourceType::Camera)
     : MediaEngineCameraVideoSource(aIndex, "WebRTCCamera.Monitor")
     , mVideoEngine(aVideoEnginePtr)
     , mMinFps(-1)
     , mMediaSource(aMediaSource)
   {
     MOZ_ASSERT(aVideoEnginePtr);
     Init();
   }
 
   virtual nsresult Allocate(const VideoTrackConstraintsN& aConstraints,
-                            const MediaEnginePrefs& aPrefs);
-  virtual nsresult Deallocate();
-  virtual nsresult Start(SourceMediaStream*, TrackID);
-  virtual nsresult Stop(SourceMediaStream*, TrackID);
+                            const MediaEnginePrefs& aPrefs) MOZ_OVERRIDE;
+  virtual nsresult Deallocate() MOZ_OVERRIDE;
+  virtual nsresult Start(SourceMediaStream*, TrackID) MOZ_OVERRIDE;
+  virtual nsresult Stop(SourceMediaStream*, TrackID) MOZ_OVERRIDE;
   virtual void NotifyPull(MediaStreamGraph* aGraph,
                           SourceMediaStream* aSource,
                           TrackID aId,
                           StreamTime aDesiredTime) MOZ_OVERRIDE;
 
-  virtual const MediaSourceType GetMediaSource() {
+  virtual const MediaSourceType GetMediaSource() MOZ_OVERRIDE {
     return mMediaSource;
   }
-  virtual nsresult TakePhoto(PhotoCallback* aCallback)
+  virtual nsresult TakePhoto(PhotoCallback* aCallback) MOZ_OVERRIDE
   {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   void Refresh(int aIndex);
 
   bool SatisfiesConstraintSets(
-      const nsTArray<const dom::MediaTrackConstraintSet*>& aConstraintSets);
+      const nsTArray<const dom::MediaTrackConstraintSet*>& aConstraintSets) MOZ_OVERRIDE;
 
 protected:
   ~MediaEngineWebRTCVideoSource() { Shutdown(); }
 
 private:
   // Initialize the needed Video engine interfaces.
   void Init();
   void Shutdown();
@@ -157,52 +157,52 @@ public:
     , mPlayoutDelay(0)
     , mNullTransport(nullptr) {
     MOZ_ASSERT(aVoiceEnginePtr);
     mDeviceName.Assign(NS_ConvertUTF8toUTF16(name));
     mDeviceUUID.Assign(NS_ConvertUTF8toUTF16(uuid));
     Init();
   }
 
-  virtual void GetName(nsAString& aName);
-  virtual void GetUUID(nsAString& aUUID);
+  virtual void GetName(nsAString& aName) MOZ_OVERRIDE;
+  virtual void GetUUID(nsAString& aUUID) MOZ_OVERRIDE;
 
   virtual nsresult Allocate(const AudioTrackConstraintsN& aConstraints,
-                            const MediaEnginePrefs& aPrefs);
-  virtual nsresult Deallocate();
-  virtual nsresult Start(SourceMediaStream* aStream, TrackID aID);
-  virtual nsresult Stop(SourceMediaStream* aSource, TrackID aID);
-  virtual void SetDirectListeners(bool aHasDirectListeners) {};
+                            const MediaEnginePrefs& aPrefs) MOZ_OVERRIDE;
+  virtual nsresult Deallocate() MOZ_OVERRIDE;
+  virtual nsresult Start(SourceMediaStream* aStream, TrackID aID) MOZ_OVERRIDE;
+  virtual nsresult Stop(SourceMediaStream* aSource, TrackID aID) MOZ_OVERRIDE;
+  virtual void SetDirectListeners(bool aHasDirectListeners) MOZ_OVERRIDE {};
   virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
                           bool aAgcOn, uint32_t aAGC,
                           bool aNoiseOn, uint32_t aNoise,
-                          int32_t aPlayoutDelay);
+                          int32_t aPlayoutDelay) MOZ_OVERRIDE;
 
   virtual void NotifyPull(MediaStreamGraph* aGraph,
                           SourceMediaStream* aSource,
                           TrackID aId,
                           StreamTime aDesiredTime) MOZ_OVERRIDE;
 
-  virtual bool IsFake() {
+  virtual bool IsFake() MOZ_OVERRIDE {
     return false;
   }
 
-  virtual const MediaSourceType GetMediaSource() {
+  virtual const MediaSourceType GetMediaSource() MOZ_OVERRIDE {
     return MediaSourceType::Microphone;
   }
 
-  virtual nsresult TakePhoto(PhotoCallback* aCallback)
+  virtual nsresult TakePhoto(PhotoCallback* aCallback) MOZ_OVERRIDE
   {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   // VoEMediaProcess.
   void Process(int channel, webrtc::ProcessingTypes type,
                int16_t audio10ms[], int length,
-               int samplingFreq, bool isStereo);
+               int samplingFreq, bool isStereo) MOZ_OVERRIDE;
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
 protected:
   ~MediaEngineWebRTCAudioSource() { Shutdown(); }
 
   // mSamples is an int to avoid conversions when comparing/etc to
   // samplingFreq & length. Making mSamples protected instead of private is a