Bug 1117261 - Mark virtual overridden functions as MOZ_OVERRIDE in DOM media code; r=rillian

This commit is contained in:
Ehsan Akhgari 2015-01-02 21:08:06 -05:00
parent 02203cdfb4
commit 31a966ecd6
25 changed files with 196 additions and 203 deletions

View File

@ -19,10 +19,10 @@ public:
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"); }
};
}

View File

@ -40,26 +40,26 @@ protected:
}
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);
@ -68,13 +68,13 @@ private:
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) {
@ -100,22 +100,20 @@ private:
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;
@ -126,12 +124,12 @@ private:
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;

View File

@ -266,7 +266,7 @@ public:
*/
void RunThread();
friend class MediaStreamGraphInitThreadRunnable;
uint32_t IterationDuration() {
virtual uint32_t IterationDuration() MOZ_OVERRIDE {
return MEDIA_GRAPH_TARGET_PERIOD_MS;
}
@ -312,7 +312,7 @@ public:
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;
}
@ -378,7 +378,7 @@ public:
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. */
@ -388,7 +388,7 @@ public:
uint32_t aFrames,
uint32_t aSampleRate) MOZ_OVERRIDE;
virtual AudioCallbackDriver* AsAudioCallbackDriver() {
virtual AudioCallbackDriver* AsAudioCallbackDriver() MOZ_OVERRIDE {
return this;
}

View File

@ -616,7 +616,7 @@ public:
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);
@ -749,7 +749,7 @@ public:
// 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(); }
@ -775,11 +775,11 @@ public:
// 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.

View File

@ -597,7 +597,7 @@ public:
}
}
virtual void Stop()
virtual void Stop() MOZ_OVERRIDE
{
if (mSourceStream) {
mSourceStream->EndAllTrackAndFinish();
@ -608,7 +608,7 @@ public:
// 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);
@ -681,12 +681,12 @@ public:
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.

View File

@ -220,12 +220,12 @@ protected:
}
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);
}

View File

@ -73,7 +73,7 @@ public:
NS_METHOD
CollectReports(nsIHandleReportCallback* aHandleReport,
nsISupports* aData, bool aAnonymize)
nsISupports* aData, bool aAnonymize) MOZ_OVERRIDE
{
int64_t amount = 0;
RecordersArray& recorders = GetRecorders();
@ -651,7 +651,7 @@ private:
}
}
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));

View File

@ -1199,60 +1199,60 @@ public:
}
// 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

View File

@ -430,7 +430,7 @@ private:
class BaseMediaResource : public MediaResource {
public:
virtual nsIURI* URI() const { return mURI; }
virtual nsIURI* URI() const MOZ_OVERRIDE { return mURI; }
virtual void SetLoadInBackground(bool aLoadInBackground) MOZ_OVERRIDE;
virtual size_t SizeOfExcludingThis(
@ -564,15 +564,15 @@ public:
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 {
@ -582,28 +582,28 @@ public:
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(
@ -645,7 +645,7 @@ public:
};
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.

View File

@ -143,11 +143,11 @@ protected:
*/
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));
@ -157,7 +157,7 @@ public:
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);
@ -170,7 +170,7 @@ public:
* 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;
@ -188,7 +188,7 @@ public:
mChunks.InsertElementAt(0)->SetNull(aDuration);
mDuration += aDuration;
}
virtual void FlushAfter(StreamTime aNewEnd)
virtual void FlushAfter(StreamTime aNewEnd) MOZ_OVERRIDE
{
if (mChunks.IsEmpty()) {
return;
@ -211,7 +211,7 @@ public:
}
mDuration = aNewEnd;
}
virtual void InsertNullDataAtStart(StreamTime aDuration)
virtual void InsertNullDataAtStart(StreamTime aDuration) MOZ_OVERRIDE
{
if (aDuration <= 0) {
return;
@ -226,7 +226,7 @@ public:
#endif
mDuration += aDuration;
}
virtual void AppendNullData(StreamTime aDuration)
virtual void AppendNullData(StreamTime aDuration) MOZ_OVERRIDE
{
if (aDuration <= 0) {
return;
@ -238,7 +238,7 @@ public:
}
mDuration += aDuration;
}
virtual void ReplaceWithDisabled()
virtual void ReplaceWithDisabled() MOZ_OVERRIDE
{
if (GetType() != AUDIO) {
MOZ_CRASH("Disabling unknown segment type");
@ -247,7 +247,7 @@ public:
Clear();
AppendNullData(duration);
}
virtual void Clear()
virtual void Clear() MOZ_OVERRIDE
{
mDuration = 0;
mChunks.Clear();

View File

@ -693,10 +693,10 @@ public:
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.
/**
@ -1069,7 +1069,7 @@ public:
*/
void SetAutofinish(bool aAutofinish);
virtual ProcessedMediaStream* AsProcessedStream() { return this; }
virtual ProcessedMediaStream* AsProcessedStream() MOZ_OVERRIDE { return this; }
friend class MediaStreamGraphImpl;
@ -1087,7 +1087,7 @@ public:
{
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).

View File

@ -43,9 +43,9 @@ public:
// 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);

View File

@ -19,10 +19,10 @@ public:
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"); }
};
}

View File

@ -37,7 +37,7 @@ public:
nsresult GetEncodedTrack(EncodedFrameContainer& aData) MOZ_OVERRIDE;
protected:
int GetPacketDuration();
int GetPacketDuration() MOZ_OVERRIDE;
nsresult Init(int aChannels, int aSamplingRate) MOZ_OVERRIDE;

View File

@ -15,14 +15,14 @@ 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;

View File

@ -111,7 +111,7 @@ private:
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,

View File

@ -88,7 +88,7 @@ public:
// 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;
@ -108,7 +108,7 @@ public:
nsRefPtr<ShutdownPromise> Shutdown() MOZ_OVERRIDE;
virtual void BreakCycles();
virtual void BreakCycles() MOZ_OVERRIDE;
bool IsShutdown()
{

View File

@ -101,7 +101,7 @@ public:
}
#ifdef MOZ_EME
virtual nsresult SetCDMProxy(CDMProxy* aProxy)
virtual nsresult SetCDMProxy(CDMProxy* aProxy) MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());

View File

@ -54,30 +54,30 @@ 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) ||
(mOpusState != 0 && mOpusState->mActive);
}
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;

View File

@ -20,29 +20,29 @@ 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;

View File

@ -26,32 +26,27 @@ 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;

View File

@ -134,34 +134,34 @@ protected:
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;

View File

@ -49,7 +49,7 @@ public:
return false;
}
virtual const MediaSourceType GetMediaSource() {
virtual const MediaSourceType GetMediaSource() MOZ_OVERRIDE {
return MediaSourceType::Camera;
}

View File

@ -37,38 +37,38 @@ class MediaEngineDefaultVideoSource : public nsITimerCallback,
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;
}
@ -105,33 +105,33 @@ class MediaEngineDefaultAudioSource : public nsITimerCallback,
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;
}

View File

@ -65,18 +65,18 @@ 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)
@ -90,19 +90,19 @@ public:
}
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;
}
@ -110,7 +110,7 @@ public:
void Refresh(int aIndex);
bool SatisfiesConstraintSets(
const nsTArray<const dom::MediaTrackConstraintSet*>& aConstraintSets);
const nsTArray<const dom::MediaTrackConstraintSet*>& aConstraintSets) MOZ_OVERRIDE;
protected:
~MediaEngineWebRTCVideoSource() { Shutdown(); }
@ -162,34 +162,34 @@ public:
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;
}
@ -197,7 +197,7 @@ public:
// 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