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

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

Issue 2276973002: Revert CL 2242573002 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
index 85ad0ae8a4b0840eef0509dd0e2193023c3590e2..33a6e0b05d0ed0a7dddc343c8f70b4462711cce9 100644
--- a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
@@ -72,8 +72,8 @@ PannerHandler::PannerHandler(
// Node-specific default mixing rules.
m_channelCount = 2;
- setInternalChannelCountMode(ClampedMax);
- setInternalChannelInterpretation(AudioBus::Speakers);
+ m_channelCountMode = ClampedMax;
+ m_channelInterpretation = AudioBus::Speakers;
// Explicitly set the default panning model here so that the histograms
// include the default value.
@@ -565,7 +565,7 @@ void PannerHandler::setChannelCount(unsigned long channelCount, ExceptionState&
if (channelCount > 0 && channelCount <= 2) {
if (m_channelCount != channelCount) {
m_channelCount = channelCount;
- if (internalChannelCountMode() != Max)
+ if (m_channelCountMode != Max)
updateChannelsForInputs();
}
} else {
@@ -586,16 +586,25 @@ void PannerHandler::setChannelCountMode(const String& mode, ExceptionState& exce
DCHECK(isMainThread());
BaseAudioContext::AutoLocker locker(context());
+ ChannelCountMode oldMode = m_channelCountMode;
+
if (mode == "clamped-max") {
- setInternalChannelCountMode(ClampedMax);
+ m_newChannelCountMode = ClampedMax;
} else if (mode == "explicit") {
- setInternalChannelCountMode(Explicit);
+ m_newChannelCountMode = Explicit;
} else if (mode == "max") {
// This is not supported for a PannerNode, which can only handle 1 or 2 channels.
exceptionState.throwDOMException(
NotSupportedError,
"Panner: '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);
}
bool PannerHandler::hasSampleAccurateValues() const

Powered by Google App Engine
This is Rietveld 408576698