| Index: third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisUtterance.h
|
| diff --git a/third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisUtterance.h b/third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisUtterance.h
|
| index 50554444103f30168d538a326019fa5603a0b213..f59321dadf51f51a9f07f0005ef6429cacba6626 100644
|
| --- a/third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisUtterance.h
|
| +++ b/third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisUtterance.h
|
| @@ -29,6 +29,7 @@
|
| #include "platform/PlatformExport.h"
|
| #include "platform/heap/Handle.h"
|
| #include "platform/speech/PlatformSpeechSynthesisVoice.h"
|
| +#include "wtf/MathExtras.h"
|
| #include "wtf/text/WTFString.h"
|
|
|
| namespace blink {
|
| @@ -55,15 +56,15 @@ public:
|
|
|
| // Range = [0, 1] where 1 is the default.
|
| float volume() const { return m_volume; }
|
| - void setVolume(float volume) { m_volume = std::max(std::min(1.0f, volume), 0.0f); }
|
| + void setVolume(float volume) { m_volume = clampTo(volume, 0.0f, 1.0f); }
|
|
|
| // Range = [0.1, 10] where 1 is the default.
|
| float rate() const { return m_rate; }
|
| - void setRate(float rate) { m_rate = std::max(std::min(10.0f, rate), 0.1f); }
|
| + void setRate(float rate) { m_rate = clampTo(rate, 0.1f, 10.0f); }
|
|
|
| // Range = [0, 2] where 1 is the default.
|
| float pitch() const { return m_pitch; }
|
| - void setPitch(float pitch) { m_pitch = std::max(std::min(2.0f, pitch), 0.0f); }
|
| + void setPitch(float pitch) { m_pitch = clampTo(pitch, 0.0f, 2.0f); }
|
|
|
| double startTime() const { return m_startTime; }
|
| void setStartTime(double startTime) { m_startTime = startTime; }
|
|
|