Chromium Code Reviews| Index: Source/core/html/MediaController.cpp |
| diff --git a/Source/core/html/MediaController.cpp b/Source/core/html/MediaController.cpp |
| index e887df31c4cd44f4394dc47658dcc31265ae5169..9528749d2a541c70e56dc1f664fed97feb43d5a0 100644 |
| --- a/Source/core/html/MediaController.cpp |
| +++ b/Source/core/html/MediaController.cpp |
| @@ -160,6 +160,11 @@ double MediaController::currentTime() const |
| void MediaController::setCurrentTime(double time, ExceptionState& exceptionState) |
| { |
| + if (!std::isfinite(time)) { |
|
acolwell GONE FROM CHROMIUM
2014/03/31 21:58:29
nit: You should probably add FIXME's to above this
|
| + exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(time)); |
| + return; |
| + } |
| + |
| // When the user agent is to seek the media controller to a particular new playback position, |
| // it must follow these steps: |
| // If the new playback position is less than zero, then set it to zero. |
| @@ -218,8 +223,13 @@ void MediaController::pause() |
| reportControllerState(); |
| } |
| -void MediaController::setDefaultPlaybackRate(double rate) |
| +void MediaController::setDefaultPlaybackRate(double rate, ExceptionState& exceptionState) |
| { |
| + if (!std::isfinite(rate)) { |
| + exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(rate)); |
| + return; |
| + } |
| + |
| if (m_defaultPlaybackRate == rate) |
| return; |
| @@ -236,8 +246,13 @@ double MediaController::playbackRate() const |
| return m_clock->playRate(); |
| } |
| -void MediaController::setPlaybackRate(double rate) |
| +void MediaController::setPlaybackRate(double rate, ExceptionState& exceptionState) |
| { |
| + if (!std::isfinite(rate)) { |
| + exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(rate)); |
| + return; |
| + } |
| + |
| if (m_clock->playRate() == rate) |
| return; |
| @@ -254,6 +269,11 @@ void MediaController::setPlaybackRate(double rate) |
| void MediaController::setVolume(double level, ExceptionState& exceptionState) |
| { |
| + if (!std::isfinite(level)) { |
| + exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(level)); |
| + return; |
| + } |
| + |
| if (m_volume == level) |
| return; |