bug 1205558 remove unused AudioNodeStream* aSource parameter r=padenot

--HG--
extra : rebase_source : 23fb5cfaa0fa3bc117183bb122bbdf032957637b
This commit is contained in:
Karl Tomlinson 2015-09-22 17:11:52 +12:00
Родитель 24b8c43a95
Коммит 56758d35f3
9 изменённых файлов: 9 добавлений и 58 удалений

Просмотреть файл

@ -69,9 +69,8 @@ public:
virtual void RecvTimelineEvent(uint32_t aIndex,
dom::AudioTimelineEvent& aEvent) override
{
MOZ_ASSERT(mSource && mDestination);
MOZ_ASSERT(mDestination);
WebAudioUtils::ConvertAudioTimelineEventToTicks(aEvent,
mSource,
mDestination);
switch (aIndex) {

Просмотреть файл

@ -78,7 +78,6 @@ class BiquadFilterNodeEngine final : public AudioNodeEngine
public:
BiquadFilterNodeEngine(AudioNode* aNode, AudioDestinationNode* aDestination)
: AudioNodeEngine(aNode)
, mSource(nullptr)
, mDestination(aDestination->Stream())
// Keep the default values in sync with the default values in
// BiquadFilterNode::BiquadFilterNode
@ -90,11 +89,6 @@ public:
{
}
void SetSourceStream(AudioNodeStream* aSource)
{
mSource = aSource;
}
enum Parameteres {
TYPE,
FREQUENCY,
@ -113,10 +107,9 @@ public:
void RecvTimelineEvent(uint32_t aIndex,
AudioTimelineEvent& aEvent) override
{
MOZ_ASSERT(mSource && mDestination);
MOZ_ASSERT(mDestination);
WebAudioUtils::ConvertAudioTimelineEventToTicks(aEvent,
mSource,
mDestination);
switch (aIndex) {
@ -221,7 +214,6 @@ public:
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
// Not owned:
// - mSource - probably not owned
// - mDestination - probably not owned
// - AudioParamTimelines - counted in the AudioNode
size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
@ -235,7 +227,6 @@ public:
}
private:
AudioNodeStream* mSource;
AudioNodeStream* mDestination;
BiquadFilterType mType;
AudioParamTimeline mFrequency;
@ -259,7 +250,6 @@ BiquadFilterNode::BiquadFilterNode(AudioContext* aContext)
BiquadFilterNodeEngine* engine = new BiquadFilterNodeEngine(this, aContext->Destination());
mStream = AudioNodeStream::Create(aContext, engine,
AudioNodeStream::NO_STREAM_FLAGS);
engine->SetSourceStream(mStream);
}
BiquadFilterNode::~BiquadFilterNode()

Просмотреть файл

@ -63,9 +63,8 @@ public:
void RecvTimelineEvent(uint32_t aIndex,
AudioTimelineEvent& aEvent) override
{
MOZ_ASSERT(mSource && mDestination);
MOZ_ASSERT(mDestination);
WebAudioUtils::ConvertAudioTimelineEventToTicks(aEvent,
mSource,
mDestination);
switch (aIndex) {

Просмотреть файл

@ -36,7 +36,6 @@ public:
explicit DynamicsCompressorNodeEngine(AudioNode* aNode,
AudioDestinationNode* aDestination)
: AudioNodeEngine(aNode)
, mSource(nullptr)
, mDestination(aDestination->Stream())
// Keep the default value in sync with the default value in
// DynamicsCompressorNode::DynamicsCompressorNode.
@ -49,11 +48,6 @@ public:
{
}
void SetSourceStream(AudioNodeStream* aSource)
{
mSource = aSource;
}
enum Parameters {
THRESHOLD,
KNEE,
@ -64,10 +58,9 @@ public:
void RecvTimelineEvent(uint32_t aIndex,
AudioTimelineEvent& aEvent) override
{
MOZ_ASSERT(mSource && mDestination);
MOZ_ASSERT(mDestination);
WebAudioUtils::ConvertAudioTimelineEventToTicks(aEvent,
mSource,
mDestination);
switch (aIndex) {
@ -132,7 +125,6 @@ public:
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
// Not owned:
// - mSource (probably)
// - mDestination (probably)
// - Don't count the AudioParamTimelines, their inner refs are owned by the
// AudioNode.
@ -180,7 +172,6 @@ private:
}
private:
AudioNodeStream* mSource;
AudioNodeStream* mDestination;
AudioParamTimeline mThreshold;
AudioParamTimeline mKnee;
@ -205,7 +196,6 @@ DynamicsCompressorNode::DynamicsCompressorNode(AudioContext* aContext)
DynamicsCompressorNodeEngine* engine = new DynamicsCompressorNodeEngine(this, aContext->Destination());
mStream = AudioNodeStream::Create(aContext, engine,
AudioNodeStream::NO_STREAM_FLAGS);
engine->SetSourceStream(mStream);
}
DynamicsCompressorNode::~DynamicsCompressorNode()

Просмотреть файл

@ -28,27 +28,20 @@ class GainNodeEngine final : public AudioNodeEngine
public:
GainNodeEngine(AudioNode* aNode, AudioDestinationNode* aDestination)
: AudioNodeEngine(aNode)
, mSource(nullptr)
, mDestination(aDestination->Stream())
// Keep the default value in sync with the default value in GainNode::GainNode.
, mGain(1.f)
{
}
void SetSourceStream(AudioNodeStream* aSource)
{
mSource = aSource;
}
enum Parameters {
GAIN
};
void RecvTimelineEvent(uint32_t aIndex,
AudioTimelineEvent& aEvent) override
{
MOZ_ASSERT(mSource && mDestination);
MOZ_ASSERT(mDestination);
WebAudioUtils::ConvertAudioTimelineEventToTicks(aEvent,
mSource,
mDestination);
switch (aIndex) {
@ -66,8 +59,6 @@ public:
AudioBlock* aOutput,
bool* aFinished) override
{
MOZ_ASSERT(mSource == aStream, "Invalid source stream");
if (aInput.IsNull()) {
// If input is silent, so is the output
aOutput->SetNull(WEBAUDIO_BLOCK_SIZE);
@ -107,7 +98,6 @@ public:
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
// Not owned:
// - mSource (probably)
// - mDestination (probably)
// - mGain - Internal ref owned by AudioNode
return AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
@ -118,7 +108,6 @@ public:
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}
AudioNodeStream* mSource;
AudioNodeStream* mDestination;
AudioParamTimeline mGain;
};
@ -133,7 +122,6 @@ GainNode::GainNode(AudioContext* aContext)
GainNodeEngine* engine = new GainNodeEngine(this, aContext->Destination());
mStream = AudioNodeStream::Create(aContext, engine,
AudioNodeStream::NO_STREAM_FLAGS);
engine->SetSourceStream(mStream);
}
GainNode::~GainNode()

Просмотреть файл

@ -62,10 +62,9 @@ public:
{
mRecomputeParameters = true;
MOZ_ASSERT(mSource && mDestination);
MOZ_ASSERT(mDestination);
WebAudioUtils::ConvertAudioTimelineEventToTicks(aEvent,
mSource,
mDestination);
switch (aIndex) {

Просмотреть файл

@ -33,7 +33,6 @@ public:
StereoPannerNodeEngine(AudioNode* aNode,
AudioDestinationNode* aDestination)
: AudioNodeEngine(aNode)
, mSource(nullptr)
, mDestination(aDestination->Stream())
// Keep the default value in sync with the default value in
// StereoPannerNode::StereoPannerNode.
@ -41,20 +40,14 @@ public:
{
}
void SetSourceStream(AudioNodeStream* aSource)
{
mSource = aSource;
}
enum Parameters {
PAN
};
void RecvTimelineEvent(uint32_t aIndex,
AudioTimelineEvent& aEvent) override
{
MOZ_ASSERT(mSource && mDestination);
MOZ_ASSERT(mDestination);
WebAudioUtils::ConvertAudioTimelineEventToTicks(aEvent,
mSource,
mDestination);
switch (aIndex) {
@ -116,8 +109,6 @@ public:
AudioBlock* aOutput,
bool *aFinished) override
{
MOZ_ASSERT(mSource == aStream, "Invalid source stream");
// The output of this node is always stereo, no matter what the inputs are.
MOZ_ASSERT(aInput.ChannelCount() <= 2);
aOutput->AllocateChannels(2);
@ -171,7 +162,6 @@ public:
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}
AudioNodeStream* mSource;
AudioNodeStream* mDestination;
AudioParamTimeline mPan;
};
@ -186,7 +176,6 @@ StereoPannerNode::StereoPannerNode(AudioContext* aContext)
StereoPannerNodeEngine* engine = new StereoPannerNodeEngine(this, aContext->Destination());
mStream = AudioNodeStream::Create(aContext, engine,
AudioNodeStream::NO_STREAM_FLAGS);
engine->SetSourceStream(mStream);
}
StereoPannerNode::~StereoPannerNode()

Просмотреть файл

@ -13,14 +13,12 @@ namespace mozilla {
namespace dom {
void WebAudioUtils::ConvertAudioTimelineEventToTicks(AudioTimelineEvent& aEvent,
AudioNodeStream* aSource,
AudioNodeStream* aDest)
{
MOZ_ASSERT(!aSource || aSource->SampleRate() == aDest->SampleRate());
aEvent.SetTimeInTicks(
aDest->SecondsToNearestStreamTime(aEvent.Time<double>()));
aEvent.mTimeConstant *= aSource->SampleRate();
aEvent.mDuration *= aSource->SampleRate();
aEvent.mTimeConstant *= aDest->SampleRate();
aEvent.mDuration *= aDest->SampleRate();
}
void

Просмотреть файл

@ -64,7 +64,6 @@ namespace WebAudioUtils {
* destination streams as well.
*/
void ConvertAudioTimelineEventToTicks(AudioTimelineEvent& aEvent,
AudioNodeStream* aSource,
AudioNodeStream* aDest);
/**