Chromium Code Reviews| Index: Source/modules/webaudio/WaveShaperNode.cpp |
| diff --git a/Source/modules/webaudio/WaveShaperNode.cpp b/Source/modules/webaudio/WaveShaperNode.cpp |
| index c4d4c9bb1d2f3763a94c77a8217ca54dbb718994..621690bc1036439fc21866bb8a73e7c52bca924c 100644 |
| --- a/Source/modules/webaudio/WaveShaperNode.cpp |
| +++ b/Source/modules/webaudio/WaveShaperNode.cpp |
| @@ -28,6 +28,7 @@ |
| #include "modules/webaudio/WaveShaperNode.h" |
| +#include "bindings/v8/ExceptionMessages.h" |
| #include "bindings/v8/ExceptionState.h" |
| #include "core/dom/ExceptionCode.h" |
| #include "wtf/MainThread.h" |
| @@ -64,14 +65,20 @@ void WaveShaperNode::setOversample(const String& type, ExceptionState& es) |
| // initialize() and uninitialize(). |
| AudioContext::AutoLocker contextLocker(context()); |
| - if (type == "none") |
| + if (type == "none") { |
| waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSampleNone); |
| - else if (type == "2x") |
| + } else if (type == "2x") { |
| waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample2x); |
| - else if (type == "4x") |
| + } else if (type == "4x") { |
| waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample4x); |
| - else |
| - es.throwUninformativeAndGenericDOMException(InvalidStateError); |
| + } else { |
| + es.throwDOMException( |
| + InvalidStateError, |
| + ExceptionMessages::failedToSet( |
| + "oversample", |
| + "WaveShaperNode", |
| + "must be one of: \"none\", \"2x\", \"4x\".")); |
|
Mike West
2013/09/27 06:44:39
Same as above.
|
| + } |
| } |
| String WaveShaperNode::oversample() const |