Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Unified Diff: third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp

Issue 2242573002: Don't delay setting of channelInterpretation and channelCountMode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix grammar in comment. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp
index 4962c839ee93f6266296db931d4578406fc2ada9..5872319e2ad0b80cbb44488e750f4461b752a624 100644
--- a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp
@@ -26,8 +26,8 @@ StereoPannerHandler::StereoPannerHandler(AudioNode& node, float sampleRate, Audi
// The node-specific default mixing rules declare that StereoPannerNode
// can handle mono to stereo and stereo to stereo conversion.
m_channelCount = 2;
- m_channelCountMode = ClampedMax;
- m_channelInterpretation = AudioBus::Speakers;
+ setInternalChannelCountMode(ClampedMax);
+ setInternalChannelInterpretation(AudioBus::Speakers);
initialize();
}
@@ -89,7 +89,7 @@ void StereoPannerHandler::setChannelCount(unsigned long channelCount, ExceptionS
if (channelCount > 0 && channelCount <= 2) {
if (m_channelCount != channelCount) {
m_channelCount = channelCount;
- if (m_channelCountMode != Max)
+ if (internalChannelCountMode() != Max)
updateChannelsForInputs();
}
} else {
@@ -110,26 +110,17 @@ void StereoPannerHandler::setChannelCountMode(const String& mode, ExceptionState
ASSERT(isMainThread());
BaseAudioContext::AutoLocker locker(context());
- ChannelCountMode oldMode = m_channelCountMode;
-
if (mode == "clamped-max") {
- m_newChannelCountMode = ClampedMax;
+ setInternalChannelCountMode(ClampedMax);
} else if (mode == "explicit") {
- m_newChannelCountMode = Explicit;
+ setInternalChannelCountMode(Explicit);
} else if (mode == "max") {
// This is not supported for a StereoPannerNode, which can only handle
// 1 or 2 channels.
exceptionState.throwDOMException(
NotSupportedError,
"StereoPanner: 'max' is not allowed");
- m_newChannelCountMode = oldMode;
- } else {
- // Do nothing for other invalid values.
- m_newChannelCountMode = oldMode;
}
-
- if (m_newChannelCountMode != oldMode)
- context()->deferredTaskHandler().addChangedChannelCountMode(this);
}
// ----------------------------------------------------------------
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698