Bug 1413098 - Part 4 - Rename variable and reorder argument to remove default argument value. r=pehrsons

MozReview-Commit-ID: CGrHExujtZ1

--HG--
extra : rebase_source : 94c17bd548bb61948c9d017b292d8a8f998be9f0
extra : histedit_source : dea7c9462c4962f0d3a42bb7de074549fe1c6761
This commit is contained in:
Paul Adenot 2018-02-26 15:02:45 +01:00
parent e8940443d7
commit e20920c3f7
3 changed files with 11 additions and 10 deletions

View File

@ -153,12 +153,13 @@ AudioContext::AudioContext(nsPIDOMWindowInner* aWindow,
// Note: AudioDestinationNode needs an AudioContext that must already be
// bound to the window.
bool allowToStart = AutoplayPolicy::IsAudioContextAllowedToPlay(WrapNotNull(this));
mDestination = new AudioDestinationNode(this, aIsOffline,
bool allowedToStart = AutoplayPolicy::IsAudioContextAllowedToPlay(WrapNotNull(this));
mDestination = new AudioDestinationNode(this,
aIsOffline,
allowedToStart,
aNumberOfChannels,
aLength,
aSampleRate,
allowToStart);
aSampleRate);
// The context can't be muted until it has a destination.
if (mute) {
@ -167,7 +168,7 @@ AudioContext::AudioContext(nsPIDOMWindowInner* aWindow,
// If we won't allow audio context to start, we need to suspend all its stream
// in order to delay the state changing from 'suspend' to 'start'.
if (!allowToStart) {
if (!allowedToStart) {
ErrorResult rv;
RefPtr<Promise> dummy = Suspend(rv);
MOZ_ASSERT(!rv.Failed(), "can't create promise");

View File

@ -323,10 +323,10 @@ NS_IMPL_RELEASE_INHERITED(AudioDestinationNode, AudioNode)
AudioDestinationNode::AudioDestinationNode(AudioContext* aContext,
bool aIsOffline,
bool aAllowedToStart,
uint32_t aNumberOfChannels,
uint32_t aLength,
float aSampleRate,
bool aAllowToStart)
float aSampleRate)
: AudioNode(aContext, aNumberOfChannels,
ChannelCountMode::Explicit, ChannelInterpretation::Speakers)
, mFramesToProduce(aLength)
@ -354,7 +354,7 @@ AudioDestinationNode::AudioDestinationNode(AudioContext* aContext,
mStream->AddMainThreadListener(this);
mStream->AddAudioOutput(&gWebAudioOutputKey);
if (!aIsOffline && aAllowToStart) {
if (!aIsOffline && aAllowedToStart) {
graph->NotifyWhenGraphStarted(mStream);
}
}

View File

@ -25,10 +25,10 @@ public:
// whether it's in offline mode.
AudioDestinationNode(AudioContext* aContext,
bool aIsOffline,
bool aAllowedToStart,
uint32_t aNumberOfChannels = 0,
uint32_t aLength = 0,
float aSampleRate = 0.0f,
bool aAllowToStart = true);
float aSampleRate = 0.0f);
void DestroyMediaStream() override;