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

Unified Diff: Source/modules/webaudio/AnalyserNode.cpp

Issue 173753002: Drop redundant 'ExceptionMessages::failedToXXX' calls. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaseline. Created 6 years, 10 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 | « Source/core/html/track/vtt/VTTCue.cpp ('k') | Source/modules/webaudio/DefaultAudioDestinationNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
}
« no previous file with comments | « Source/core/html/track/vtt/VTTCue.cpp ('k') | Source/modules/webaudio/DefaultAudioDestinationNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698