Bug 1159290 - "Add final/override to WebAudio classes". r=padenot

This commit is contained in:
Andrea Marchesini 2015-04-28 08:42:00 +02:00
parent e829149556
commit 1441642f1a
48 changed files with 135 additions and 102 deletions

View File

@ -16,9 +16,9 @@ namespace dom {
NS_IMPL_ISUPPORTS_INHERITED0(AnalyserNode, AudioNode)
class AnalyserNodeEngine : public AudioNodeEngine
class AnalyserNodeEngine final : public AudioNodeEngine
{
class TransferBuffer : public nsRunnable
class TransferBuffer final : public nsRunnable
{
public:
TransferBuffer(AudioNodeStream* aStream,

View File

@ -15,7 +15,7 @@ namespace dom {
class AudioContext;
class AnalyserNode : public AudioNode
class AnalyserNode final : public AudioNode
{
public:
explicit AnalyserNode(AudioContext* aContext);

View File

@ -53,11 +53,11 @@ NS_IMPL_RELEASE_INHERITED(AudioBufferSourceNode, AudioNode)
* AudioNodeStream::SetBuffer) and a non-zero mBufferEnd has been set (via
* AudioNodeStream::SetInt32Parameter).
*/
class AudioBufferSourceNodeEngine : public AudioNodeEngine
class AudioBufferSourceNodeEngine final : public AudioNodeEngine
{
public:
explicit AudioBufferSourceNodeEngine(AudioNode* aNode,
AudioDestinationNode* aDestination) :
AudioBufferSourceNodeEngine(AudioNode* aNode,
AudioDestinationNode* aDestination) :
AudioNodeEngine(aNode),
mStart(0.0), mBeginProcessing(0),
mStop(STREAM_TIME_MAX),
@ -713,12 +713,12 @@ void
AudioBufferSourceNode::NotifyMainThreadStateChanged()
{
if (mStream->IsFinished()) {
class EndedEventDispatcher : public nsRunnable
class EndedEventDispatcher final : public nsRunnable
{
public:
explicit EndedEventDispatcher(AudioBufferSourceNode* aNode)
: mNode(aNode) {}
NS_IMETHODIMP Run()
NS_IMETHODIMP Run() override
{
// If it's not safe to run scripts right now, schedule this to run later
if (!nsContentUtils::IsSafeToRunScript()) {

View File

@ -15,8 +15,8 @@ namespace dom {
class AudioParam;
class AudioBufferSourceNode : public AudioNode,
public MainThreadMediaStreamListener
class AudioBufferSourceNode final : public AudioNode,
public MainThreadMediaStreamListener
{
public:
explicit AudioBufferSourceNode(AudioContext* aContext);

View File

@ -30,7 +30,7 @@ namespace dom {
static uint8_t gWebAudioOutputKey;
class OfflineDestinationNodeEngine : public AudioNodeEngine
class OfflineDestinationNodeEngine final : public AudioNodeEngine
{
public:
typedef AutoFallibleTArray<nsAutoArrayPtr<float>, 2> InputChannels;
@ -135,7 +135,7 @@ public:
, mRenderedBuffer(aRenderedBuffer)
{}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsRefPtr<OfflineAudioCompletionEvent> event =
new OfflineAudioCompletionEvent(mAudioContext, nullptr, nullptr);
@ -210,7 +210,7 @@ private:
bool mBufferAllocated;
};
class InputMutedRunnable : public nsRunnable
class InputMutedRunnable final : public nsRunnable
{
public:
InputMutedRunnable(AudioNodeStream* aStream,
@ -220,7 +220,7 @@ public:
{
}
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
MOZ_ASSERT(NS_IsMainThread());
nsRefPtr<AudioNode> node = mStream->Engine()->NodeMainThread();
@ -238,7 +238,7 @@ private:
bool mInputMuted;
};
class DestinationNodeEngine : public AudioNodeEngine
class DestinationNodeEngine final : public AudioNodeEngine
{
public:
explicit DestinationNodeEngine(AudioDestinationNode* aNode)

View File

@ -21,8 +21,10 @@ namespace mozilla {
namespace dom {
// This is an internal helper class and should not be used outside of this header.
struct AudioTimelineEvent {
enum Type : uint32_t {
struct AudioTimelineEvent final
{
enum Type : uint32_t
{
SetValue,
LinearRamp,
ExponentialRamp,

View File

@ -325,7 +325,8 @@ AudioNode::Disconnect(uint32_t aOutput, ErrorResult& aRv)
// ADDREF message to this (main) thread. Wait for a round trip before
// releasing nodes, to give engines receiving sound now time to keep their
// nodes alive.
class RunnableRelease : public nsRunnable {
class RunnableRelease final : public nsRunnable
{
public:
explicit RunnableRelease(already_AddRefed<AudioNode> aNode)
: mNode(aNode) {}

View File

@ -74,7 +74,8 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioNode,
DOMEventTargetHelper)
virtual AudioBufferSourceNode* AsAudioBufferSourceNode() {
virtual AudioBufferSourceNode* AsAudioBufferSourceNode()
{
return nullptr;
}
@ -137,7 +138,8 @@ public:
SendChannelMixingParametersToStream();
}
struct InputNode {
struct InputNode final
{
~InputNode()
{
if (mStreamPort) {

View File

@ -27,7 +27,8 @@ class AudioNodeStream;
* pointers can be different (e.g. if the buffers are contained inside
* some malloced object).
*/
class ThreadSharedFloatArrayBufferList : public ThreadSharedObject {
class ThreadSharedFloatArrayBufferList final : public ThreadSharedObject
{
public:
/**
* Construct with null data.
@ -37,7 +38,8 @@ public:
mContents.SetLength(aCount);
}
struct Storage {
struct Storage final
{
Storage() :
mDataToFree(nullptr),
mFree(nullptr),
@ -234,7 +236,8 @@ AudioBufferSumOfSquares(const float* aInput, uint32_t aLength);
* All methods of this class and its subclasses are called on the
* MediaStreamGraph thread.
*/
class AudioNodeEngine {
class AudioNodeEngine
{
public:
// This should be compatible with AudioNodeStream::OutputChunks.
typedef nsAutoTArray<AudioChunk, 1> OutputChunks;

View File

@ -18,14 +18,17 @@ namespace mozilla {
* input --- handling any number of audio tracks and handling blocking of
* the input MediaStream.
*/
class AudioNodeExternalInputStream : public AudioNodeStream {
class AudioNodeExternalInputStream final : public AudioNodeStream
{
public:
AudioNodeExternalInputStream(AudioNodeEngine* aEngine, TrackRate aSampleRate, uint32_t aContextId);
AudioNodeExternalInputStream(AudioNodeEngine* aEngine, TrackRate aSampleRate,
uint32_t aContextId);
protected:
~AudioNodeExternalInputStream();
public:
virtual void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override;
virtual void ProcessInput(GraphTime aFrom, GraphTime aTo,
uint32_t aFlags) override;
private:
/**

View File

@ -95,13 +95,15 @@ void
AudioNodeStream::SetStreamTimeParameter(uint32_t aIndex, AudioContext* aContext,
double aStreamTime)
{
class Message : public ControlMessage {
class Message final : public ControlMessage
{
public:
Message(AudioNodeStream* aStream, uint32_t aIndex, MediaStream* aRelativeToStream,
double aStreamTime)
: ControlMessage(aStream), mStreamTime(aStreamTime),
mRelativeToStream(aRelativeToStream), mIndex(aIndex) {}
virtual void Run()
mRelativeToStream(aRelativeToStream), mIndex(aIndex)
{}
virtual void Run() override
{
static_cast<AudioNodeStream*>(mStream)->
SetStreamTimeParameterImpl(mIndex, mRelativeToStream, mStreamTime);
@ -127,11 +129,13 @@ AudioNodeStream::SetStreamTimeParameterImpl(uint32_t aIndex, MediaStream* aRelat
void
AudioNodeStream::SetDoubleParameter(uint32_t aIndex, double aValue)
{
class Message : public ControlMessage {
class Message final : public ControlMessage
{
public:
Message(AudioNodeStream* aStream, uint32_t aIndex, double aValue)
: ControlMessage(aStream), mValue(aValue), mIndex(aIndex) {}
virtual void Run()
: ControlMessage(aStream), mValue(aValue), mIndex(aIndex)
{}
virtual void Run() override
{
static_cast<AudioNodeStream*>(mStream)->Engine()->
SetDoubleParameter(mIndex, mValue);
@ -146,11 +150,13 @@ AudioNodeStream::SetDoubleParameter(uint32_t aIndex, double aValue)
void
AudioNodeStream::SetInt32Parameter(uint32_t aIndex, int32_t aValue)
{
class Message : public ControlMessage {
class Message final : public ControlMessage
{
public:
Message(AudioNodeStream* aStream, uint32_t aIndex, int32_t aValue)
: ControlMessage(aStream), mValue(aValue), mIndex(aIndex) {}
virtual void Run()
: ControlMessage(aStream), mValue(aValue), mIndex(aIndex)
{}
virtual void Run() override
{
static_cast<AudioNodeStream*>(mStream)->Engine()->
SetInt32Parameter(mIndex, mValue);
@ -166,15 +172,17 @@ void
AudioNodeStream::SetTimelineParameter(uint32_t aIndex,
const AudioParamTimeline& aValue)
{
class Message : public ControlMessage {
class Message final : public ControlMessage
{
public:
Message(AudioNodeStream* aStream, uint32_t aIndex,
const AudioParamTimeline& aValue)
: ControlMessage(aStream),
mValue(aValue),
mSampleRate(aStream->SampleRate()),
mIndex(aIndex) {}
virtual void Run()
mIndex(aIndex)
{}
virtual void Run() override
{
static_cast<AudioNodeStream*>(mStream)->Engine()->
SetTimelineParameter(mIndex, mValue, mSampleRate);
@ -189,11 +197,13 @@ AudioNodeStream::SetTimelineParameter(uint32_t aIndex,
void
AudioNodeStream::SetThreeDPointParameter(uint32_t aIndex, const ThreeDPoint& aValue)
{
class Message : public ControlMessage {
class Message final : public ControlMessage
{
public:
Message(AudioNodeStream* aStream, uint32_t aIndex, const ThreeDPoint& aValue)
: ControlMessage(aStream), mValue(aValue), mIndex(aIndex) {}
virtual void Run()
: ControlMessage(aStream), mValue(aValue), mIndex(aIndex)
{}
virtual void Run() override
{
static_cast<AudioNodeStream*>(mStream)->Engine()->
SetThreeDPointParameter(mIndex, mValue);
@ -208,12 +218,14 @@ AudioNodeStream::SetThreeDPointParameter(uint32_t aIndex, const ThreeDPoint& aVa
void
AudioNodeStream::SetBuffer(already_AddRefed<ThreadSharedFloatArrayBufferList>&& aBuffer)
{
class Message : public ControlMessage {
class Message final : public ControlMessage
{
public:
Message(AudioNodeStream* aStream,
already_AddRefed<ThreadSharedFloatArrayBufferList>& aBuffer)
: ControlMessage(aStream), mBuffer(aBuffer) {}
virtual void Run()
: ControlMessage(aStream), mBuffer(aBuffer)
{}
virtual void Run() override
{
static_cast<AudioNodeStream*>(mStream)->Engine()->
SetBuffer(mBuffer.forget());
@ -227,7 +239,8 @@ AudioNodeStream::SetBuffer(already_AddRefed<ThreadSharedFloatArrayBufferList>&&
void
AudioNodeStream::SetRawArrayData(nsTArray<float>& aData)
{
class Message : public ControlMessage {
class Message final : public ControlMessage
{
public:
Message(AudioNodeStream* aStream,
nsTArray<float>& aData)
@ -235,7 +248,7 @@ AudioNodeStream::SetRawArrayData(nsTArray<float>& aData)
{
mData.SwapElements(aData);
}
virtual void Run()
virtual void Run() override
{
static_cast<AudioNodeStream*>(mStream)->Engine()->SetRawArrayData(mData);
}
@ -250,7 +263,8 @@ AudioNodeStream::SetChannelMixingParameters(uint32_t aNumberOfChannels,
ChannelCountMode aChannelCountMode,
ChannelInterpretation aChannelInterpretation)
{
class Message : public ControlMessage {
class Message final : public ControlMessage
{
public:
Message(AudioNodeStream* aStream,
uint32_t aNumberOfChannels,
@ -261,7 +275,7 @@ AudioNodeStream::SetChannelMixingParameters(uint32_t aNumberOfChannels,
mChannelCountMode(aChannelCountMode),
mChannelInterpretation(aChannelInterpretation)
{}
virtual void Run()
virtual void Run() override
{
static_cast<AudioNodeStream*>(mStream)->
SetChannelMixingParametersImpl(mNumberOfChannels, mChannelCountMode,
@ -280,11 +294,13 @@ AudioNodeStream::SetChannelMixingParameters(uint32_t aNumberOfChannels,
void
AudioNodeStream::SetPassThrough(bool aPassThrough)
{
class Message : public ControlMessage {
class Message final : public ControlMessage
{
public:
Message(AudioNodeStream* aStream, bool aPassThrough)
: ControlMessage(aStream), mPassThrough(aPassThrough) {}
virtual void Run()
: ControlMessage(aStream), mPassThrough(aPassThrough)
{}
virtual void Run() override
{
static_cast<AudioNodeStream*>(mStream)->mPassThrough = mPassThrough;
}

View File

@ -31,7 +31,8 @@ class AudioNodeEngine;
* actual audio processing. AudioNodeStream contains the glue code that
* integrates audio processing with the MediaStreamGraph.
*/
class AudioNodeStream : public ProcessedMediaStream {
class AudioNodeStream : public ProcessedMediaStream
{
typedef dom::ChannelCountMode ChannelCountMode;
typedef dom::ChannelInterpretation ChannelInterpretation;

View File

@ -14,7 +14,7 @@
namespace mozilla {
namespace dom {
class AudioProcessingEvent : public Event
class AudioProcessingEvent final : public Event
{
public:
AudioProcessingEvent(ScriptProcessorNode* aOwner,

View File

@ -73,7 +73,7 @@ SetParamsOnBiquad(WebCore::Biquad& aBiquad,
}
}
class BiquadFilterNodeEngine : public AudioNodeEngine
class BiquadFilterNodeEngine final : public AudioNodeEngine
{
public:
BiquadFilterNodeEngine(AudioNode* aNode, AudioDestinationNode* aDestination)

View File

@ -16,7 +16,7 @@ namespace dom {
class AudioContext;
class BiquadFilterNode : public AudioNode
class BiquadFilterNode final : public AudioNode
{
public:
explicit BiquadFilterNode(AudioContext* aContext);

View File

@ -18,7 +18,7 @@ namespace mozilla {
* This class provides a decoder object which decodes a media file that lives in
* a memory buffer.
*/
class BufferDecoder : public AbstractMediaDecoder
class BufferDecoder final : public AbstractMediaDecoder
{
public:
// This class holds a weak pointer to MediaResource. It's the responsibility

View File

@ -14,7 +14,7 @@ namespace dom {
NS_IMPL_ISUPPORTS_INHERITED0(ChannelMergerNode, AudioNode)
class ChannelMergerNodeEngine : public AudioNodeEngine
class ChannelMergerNodeEngine final : public AudioNodeEngine
{
public:
explicit ChannelMergerNodeEngine(ChannelMergerNode* aNode)

View File

@ -14,7 +14,7 @@ namespace dom {
class AudioContext;
class ChannelMergerNode : public AudioNode
class ChannelMergerNode final : public AudioNode
{
public:
ChannelMergerNode(AudioContext* aContext,

View File

@ -14,7 +14,7 @@ namespace dom {
NS_IMPL_ISUPPORTS_INHERITED0(ChannelSplitterNode, AudioNode)
class ChannelSplitterNodeEngine : public AudioNodeEngine
class ChannelSplitterNodeEngine final : public AudioNodeEngine
{
public:
explicit ChannelSplitterNodeEngine(ChannelSplitterNode* aNode)

View File

@ -14,7 +14,7 @@ namespace dom {
class AudioContext;
class ChannelSplitterNode : public AudioNode
class ChannelSplitterNode final : public AudioNode
{
public:
ChannelSplitterNode(AudioContext* aContext,

View File

@ -22,7 +22,7 @@ NS_INTERFACE_MAP_END_INHERITING(AudioNode)
NS_IMPL_ADDREF_INHERITED(ConvolverNode, AudioNode)
NS_IMPL_RELEASE_INHERITED(ConvolverNode, AudioNode)
class ConvolverNodeEngine : public AudioNodeEngine
class ConvolverNodeEngine final : public AudioNodeEngine
{
typedef PlayingRefChangeHandler PlayingRefChanged;
public:

View File

@ -13,7 +13,7 @@
namespace mozilla {
namespace dom {
class ConvolverNode : public AudioNode
class ConvolverNode final : public AudioNode
{
public:
explicit ConvolverNode(AudioContext* aContext);

View File

@ -13,7 +13,8 @@
namespace mozilla {
class DelayBuffer {
class DelayBuffer final
{
typedef dom::ChannelInterpretation ChannelInterpretation;
public:

View File

@ -25,7 +25,7 @@ NS_INTERFACE_MAP_END_INHERITING(AudioNode)
NS_IMPL_ADDREF_INHERITED(DelayNode, AudioNode)
NS_IMPL_RELEASE_INHERITED(DelayNode, AudioNode)
class DelayNodeEngine : public AudioNodeEngine
class DelayNodeEngine final : public AudioNodeEngine
{
typedef PlayingRefChangeHandler PlayingRefChanged;
public:

View File

@ -15,7 +15,7 @@ namespace dom {
class AudioContext;
class DelayNode : public AudioNode
class DelayNode final : public AudioNode
{
public:
DelayNode(AudioContext* aContext, double aMaxDelay);

View File

@ -30,7 +30,7 @@ NS_INTERFACE_MAP_END_INHERITING(AudioNode)
NS_IMPL_ADDREF_INHERITED(DynamicsCompressorNode, AudioNode)
NS_IMPL_RELEASE_INHERITED(DynamicsCompressorNode, AudioNode)
class DynamicsCompressorNodeEngine : public AudioNodeEngine
class DynamicsCompressorNodeEngine final : public AudioNodeEngine
{
public:
explicit DynamicsCompressorNodeEngine(AudioNode* aNode,
@ -151,7 +151,7 @@ private:
{
MOZ_ASSERT(!NS_IsMainThread());
class Command : public nsRunnable
class Command final : public nsRunnable
{
public:
Command(AudioNodeStream* aStream, float aReduction)
@ -160,7 +160,7 @@ private:
{
}
NS_IMETHODIMP Run()
NS_IMETHOD Run() override
{
nsRefPtr<DynamicsCompressorNode> node;
{

View File

@ -15,7 +15,7 @@ namespace dom {
class AudioContext;
class DynamicsCompressorNode : public AudioNode
class DynamicsCompressorNode final : public AudioNode
{
public:
explicit DynamicsCompressorNode(AudioContext* aContext);

View File

@ -16,7 +16,8 @@ namespace mozilla {
// This class defines an FFT block, loosely modeled after Blink's FFTFrame
// class to make sharing code with Blink easy.
// Currently it's implemented on top of KissFFT on all platforms.
class FFTBlock {
class FFTBlock final
{
public:
explicit FFTBlock(uint32_t aFFTSize)
: mFFT(nullptr)

View File

@ -23,7 +23,7 @@ NS_INTERFACE_MAP_END_INHERITING(AudioNode)
NS_IMPL_ADDREF_INHERITED(GainNode, AudioNode)
NS_IMPL_RELEASE_INHERITED(GainNode, AudioNode)
class GainNodeEngine : public AudioNodeEngine
class GainNodeEngine final : public AudioNodeEngine
{
public:
GainNodeEngine(AudioNode* aNode, AudioDestinationNode* aDestination)

View File

@ -15,7 +15,7 @@ namespace dom {
class AudioContext;
class GainNode : public AudioNode
class GainNode final : public AudioNode
{
public:
explicit GainNode(AudioContext* aContext);

View File

@ -50,7 +50,7 @@ NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebAudioDecodeJob, Release)
using namespace dom;
class ReportResultTask : public nsRunnable
class ReportResultTask final : public nsRunnable
{
public:
ReportResultTask(WebAudioDecodeJob& aDecodeJob,
@ -82,13 +82,14 @@ private:
WebAudioDecodeJob::ErrorCode mErrorCode;
};
enum class PhaseEnum : int {
enum class PhaseEnum : int
{
Decode,
AllocateBuffer,
Done
};
class MediaDecodeTask : public nsRunnable
class MediaDecodeTask final : public nsRunnable
{
public:
MediaDecodeTask(const char* aContentType, uint8_t* aBuffer,
@ -214,7 +215,8 @@ MediaDecodeTask::CreateReader()
return true;
}
class AutoResampler {
class AutoResampler final
{
public:
AutoResampler()
: mResampler(nullptr)

View File

@ -12,7 +12,7 @@
namespace mozilla {
namespace dom {
class MediaElementAudioSourceNode : public MediaStreamAudioSourceNode
class MediaElementAudioSourceNode final : public MediaStreamAudioSourceNode
{
public:
MediaElementAudioSourceNode(AudioContext* aContext,

View File

@ -12,7 +12,7 @@
namespace mozilla {
namespace dom {
class MediaStreamAudioDestinationNode : public AudioNode
class MediaStreamAudioDestinationNode final : public AudioNode
{
public:
explicit MediaStreamAudioDestinationNode(AudioContext* aContext);

View File

@ -15,7 +15,7 @@ namespace mozilla {
namespace dom {
class MediaStreamAudioSourceNodeEngine : public AudioNodeEngine
class MediaStreamAudioSourceNodeEngine final : public AudioNodeEngine
{
public:
explicit MediaStreamAudioSourceNodeEngine(AudioNode* aNode)

View File

@ -15,7 +15,7 @@ namespace dom {
class AudioContext;
class OfflineAudioCompletionEvent : public Event
class OfflineAudioCompletionEvent final : public Event
{
public:
OfflineAudioCompletionEvent(AudioContext* aOwner,

View File

@ -23,7 +23,7 @@ NS_INTERFACE_MAP_END_INHERITING(AudioNode)
NS_IMPL_ADDREF_INHERITED(OscillatorNode, AudioNode)
NS_IMPL_RELEASE_INHERITED(OscillatorNode, AudioNode)
class OscillatorNodeEngine : public AudioNodeEngine
class OscillatorNodeEngine final : public AudioNodeEngine
{
public:
OscillatorNodeEngine(AudioNode* aNode, AudioDestinationNode* aDestination)
@ -515,12 +515,12 @@ void
OscillatorNode::NotifyMainThreadStateChanged()
{
if (mStream->IsFinished()) {
class EndedEventDispatcher : public nsRunnable
class EndedEventDispatcher final : public nsRunnable
{
public:
explicit EndedEventDispatcher(OscillatorNode* aNode)
: mNode(aNode) {}
NS_IMETHODIMP Run()
NS_IMETHOD Run() override
{
// If it's not safe to run scripts right now, schedule this to run later
if (!nsContentUtils::IsSafeToRunScript()) {

View File

@ -18,8 +18,8 @@ namespace dom {
class AudioContext;
class OscillatorNode : public AudioNode,
public MainThreadMediaStreamListener
class OscillatorNode final : public AudioNode,
public MainThreadMediaStreamListener
{
public:
explicit OscillatorNode(AudioContext* aContext);

View File

@ -39,7 +39,7 @@ NS_INTERFACE_MAP_END_INHERITING(AudioNode)
NS_IMPL_ADDREF_INHERITED(PannerNode, AudioNode)
NS_IMPL_RELEASE_INHERITED(PannerNode, AudioNode)
class PannerNodeEngine : public AudioNodeEngine
class PannerNodeEngine final : public AudioNodeEngine
{
public:
explicit PannerNodeEngine(AudioNode* aNode)

View File

@ -21,8 +21,8 @@ namespace dom {
class AudioContext;
class AudioBufferSourceNode;
class PannerNode : public AudioNode,
public SupportsWeakPtr<PannerNode>
class PannerNode final : public AudioNode,
public SupportsWeakPtr<PannerNode>
{
public:
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(PannerNode)

View File

@ -13,7 +13,7 @@
namespace mozilla {
namespace dom {
class PlayingRefChangeHandler : public nsRunnable
class PlayingRefChangeHandler final : public nsRunnable
{
public:
enum ChangeType { ADDREF, RELEASE };

View File

@ -12,7 +12,7 @@
namespace mozilla {
class ReportDecodeResultTask : public nsRunnable
class ReportDecodeResultTask final : public nsRunnable
{
public:
ReportDecodeResultTask(DecodeJob& aDecodeJob,

View File

@ -28,10 +28,10 @@ NS_IMPL_ISUPPORTS_INHERITED0(ScriptProcessorNode, AudioNode)
// This class manages a queue of output buffers shared between
// the main thread and the Media Stream Graph thread.
class SharedBuffers
class SharedBuffers final
{
private:
class OutputQueue
class OutputQueue final
{
public:
explicit OutputQueue(const char* aName)
@ -237,7 +237,7 @@ private:
bool mDroppingBuffers;
};
class ScriptProcessorNodeEngine : public AudioNodeEngine
class ScriptProcessorNodeEngine final : public AudioNodeEngine
{
public:
typedef nsAutoTArray<nsAutoArrayPtr<float>, 2> InputChannels;
@ -361,7 +361,7 @@ private:
double playbackTime =
mSource->DestinationTimeFromTicks(mDestination, playbackTick);
class Command : public nsRunnable
class Command final : public nsRunnable
{
public:
Command(AudioNodeStream* aStream,
@ -380,7 +380,7 @@ private:
}
}
NS_IMETHODIMP Run()
NS_IMETHOD Run() override
{
nsRefPtr<ScriptProcessorNode> node = static_cast<ScriptProcessorNode*>
(mStream->Engine()->NodeMainThread());

View File

@ -16,7 +16,7 @@ namespace dom {
class AudioContext;
class SharedBuffers;
class ScriptProcessorNode : public AudioNode
class ScriptProcessorNode final : public AudioNode
{
public:
ScriptProcessorNode(AudioContext* aContext,

View File

@ -27,7 +27,7 @@ NS_INTERFACE_MAP_END_INHERITING(AudioNode)
NS_IMPL_ADDREF_INHERITED(StereoPannerNode, AudioNode)
NS_IMPL_RELEASE_INHERITED(StereoPannerNode, AudioNode)
class StereoPannerNodeEngine : public AudioNodeEngine
class StereoPannerNodeEngine final : public AudioNodeEngine
{
public:
StereoPannerNodeEngine(AudioNode* aNode,

View File

@ -15,7 +15,7 @@ namespace dom {
class AudioContext;
class StereoPannerNode : public AudioNode
class StereoPannerNode final : public AudioNode
{
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(StereoPannerNode)

View File

@ -14,7 +14,8 @@ namespace mozilla {
namespace dom {
struct ThreeDPoint {
struct ThreeDPoint final
{
ThreeDPoint()
: x(0.)
, y(0.)

View File

@ -48,7 +48,7 @@ static uint32_t ValueOf(OverSampleType aType)
}
}
class Resampler
class Resampler final
{
public:
Resampler()
@ -161,7 +161,7 @@ private:
nsTArray<float> mBuffer;
};
class WaveShaperNodeEngine : public AudioNodeEngine
class WaveShaperNodeEngine final : public AudioNodeEngine
{
public:
explicit WaveShaperNodeEngine(AudioNode* aNode)

View File

@ -16,7 +16,7 @@ namespace dom {
class AudioContext;
class WaveShaperNode : public AudioNode
class WaveShaperNode final : public AudioNode
{
public:
explicit WaveShaperNode(AudioContext *aContext);