Chromium Code Reviews| Index: Source/modules/webaudio/AnalyserNode.cpp |
| diff --git a/Source/modules/webaudio/AnalyserNode.cpp b/Source/modules/webaudio/AnalyserNode.cpp |
| index 46e061cdb937401fe8ed9bb92c05e331782269b1..62d7fe29868686b74520ba6a51546d921d81eab9 100644 |
| --- a/Source/modules/webaudio/AnalyserNode.cpp |
| +++ b/Source/modules/webaudio/AnalyserNode.cpp |
| @@ -74,13 +74,9 @@ void AnalyserNode::setFftSize(unsigned size, ExceptionState& exceptionState) |
| if (!m_analyser.setFftSize(size)) { |
| exceptionState.throwDOMException( |
| IndexSizeError, |
| - ExceptionMessages::failedToSet( |
| - "fftSize", |
| - "AnalyserNode", |
| - "FFT size (" + String::number(size) |
| - + ") must be a power of two between " |
| - + String::number(RealtimeAnalyser::MinFFTSize) + " and " |
| - + String::number(RealtimeAnalyser::MaxFFTSize) + ", inclusive")); |
| + (size < RealtimeAnalyser::MinFFTSize || size > RealtimeAnalyser::MaxFFTSize) ? |
| + ExceptionMessages::indexOutsideRange("FTT size", size, RealtimeAnalyser::MinFFTSize, ExceptionMessages::InclusiveBound, RealtimeAnalyser::MaxFFTSize, ExceptionMessages::InclusiveBound) |
|
aandrey
2014/02/25 10:14:51
FTT -> FFT
|
| + : ("The value provided (" + String::number(size) + " is not a power of two.")); |
|
aandrey
2014/02/25 10:14:51
" is -> ") is
|
| } |
| } |
| @@ -91,12 +87,7 @@ void AnalyserNode::setMinDecibels(float k, ExceptionState& exceptionState) |
| } else { |
| exceptionState.throwDOMException( |
| IndexSizeError, |
| - ExceptionMessages::failedToSet( |
| - "minDecibels", |
| - "AnalyserNode", |
| - "minDecibels (" + String::number(k) |
| - + ") must be less than or equal maxDecibels (" + String::number(maxDecibels()) |
| - + ").")); |
| + ExceptionMessages::indexExceedsMaximumBound("minDecibels", k, maxDecibels())); |
| } |
| } |
| @@ -107,12 +98,7 @@ void AnalyserNode::setMaxDecibels(float k, ExceptionState& exceptionState) |
| } else { |
| exceptionState.throwDOMException( |
| IndexSizeError, |
| - ExceptionMessages::failedToSet( |
| - "maxDecibels", |
| - "AnalyserNode", |
| - "maxDecibels (" + String::number(k) |
| - + ") must be greater than or equal minDecibels (" + String::number(minDecibels()) |
| - + ").")); |
| + ExceptionMessages::indexExceedsMinimumBound("maxDecibels", k, minDecibels())); |
| } |
| } |
| @@ -123,11 +109,7 @@ void AnalyserNode::setSmoothingTimeConstant(float k, ExceptionState& exceptionSt |
| } else { |
| exceptionState.throwDOMException( |
| IndexSizeError, |
| - ExceptionMessages::failedToSet( |
| - "smoothingTimeConstant", |
| - "AnalyserNode", |
| - "smoothing value (" + String::number(k) |
| - + ") must be between 0 and 1, inclusive.")); |
| + ExceptionMessages::indexOutsideRange("smoothing value", k, 0.0f, ExceptionMessages::InclusiveBound, 1.0f, ExceptionMessages::InclusiveBound)); |
| } |
| } |