diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/Modules/webaudio/AnalyserNode.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/Modules/webaudio/AnalyserNode.cpp')
-rw-r--r-- | Source/WebCore/Modules/webaudio/AnalyserNode.cpp | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/Source/WebCore/Modules/webaudio/AnalyserNode.cpp b/Source/WebCore/Modules/webaudio/AnalyserNode.cpp index b54d3ae28..6aff9a63d 100644 --- a/Source/WebCore/Modules/webaudio/AnalyserNode.cpp +++ b/Source/WebCore/Modules/webaudio/AnalyserNode.cpp @@ -30,11 +30,10 @@ #include "AudioNodeInput.h" #include "AudioNodeOutput.h" -#include "ExceptionCode.h" namespace WebCore { -AnalyserNode::AnalyserNode(AudioContext* context, float sampleRate) +AnalyserNode::AnalyserNode(AudioContext& context, float sampleRate) : AudioBasicInspectorNode(context, sampleRate, 2) { setNodeType(NodeTypeAnalyser); @@ -72,40 +71,38 @@ void AnalyserNode::reset() m_analyser.reset(); } -void AnalyserNode::setFftSize(unsigned size, ExceptionCode& ec) +ExceptionOr<void> AnalyserNode::setFftSize(unsigned size) { if (!m_analyser.setFftSize(size)) - ec = INDEX_SIZE_ERR; + return Exception { INDEX_SIZE_ERR }; + return { }; } -void AnalyserNode::setMinDecibels(double k, ExceptionCode& ec) +ExceptionOr<void> AnalyserNode::setMinDecibels(double k) { - if (k > maxDecibels()) { - ec = INDEX_SIZE_ERR; - return; - } + if (k > maxDecibels()) + return Exception { INDEX_SIZE_ERR }; m_analyser.setMinDecibels(k); + return { }; } -void AnalyserNode::setMaxDecibels(double k, ExceptionCode& ec) +ExceptionOr<void> AnalyserNode::setMaxDecibels(double k) { - if (k < minDecibels()) { - ec = INDEX_SIZE_ERR; - return; - } + if (k < minDecibels()) + return Exception { INDEX_SIZE_ERR }; m_analyser.setMaxDecibels(k); + return { }; } -void AnalyserNode::setSmoothingTimeConstant(double k, ExceptionCode& ec) +ExceptionOr<void> AnalyserNode::setSmoothingTimeConstant(double k) { - if (k < 0 || k > 1) { - ec = INDEX_SIZE_ERR; - return; - } + if (k < 0 || k > 1) + return Exception { INDEX_SIZE_ERR }; m_analyser.setSmoothingTimeConstant(k); + return { }; } } // namespace WebCore |