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

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 261783009: Use [TypeChecking=Unrestricted] for HTMLMediaElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/HTMLMediaElement.h ('k') | Source/core/html/HTMLMediaElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 917eaef80118a6b162d987269435bb06d7a6b84d..a0ea47d85c787d1ed150be0b0a33b14728137df5 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -684,7 +684,7 @@ void HTMLMediaElement::prepareForLoad()
}
// 5 - Set the playbackRate attribute to the value of the defaultPlaybackRate attribute.
- setPlaybackRate(defaultPlaybackRate(), IGNORE_EXCEPTION);
+ setPlaybackRate(defaultPlaybackRate());
// 6 - Set the error attribute to null and the autoplaying flag to true.
m_error = nullptr;
@@ -1886,11 +1886,6 @@ double HTMLMediaElement::currentTime() const
void HTMLMediaElement::setCurrentTime(double time, ExceptionState& exceptionState)
{
- // FIXME: generated bindings should check isfinite: http://crbug.com/354298
- if (!std::isfinite(time)) {
- exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(time));
- return;
- }
if (m_mediaController) {
exceptionState.throwDOMException(InvalidStateError, "The element is slaved to a MediaController.");
return;
@@ -1929,13 +1924,8 @@ double HTMLMediaElement::defaultPlaybackRate() const
return m_defaultPlaybackRate;
}
-void HTMLMediaElement::setDefaultPlaybackRate(double rate, ExceptionState& exceptionState)
+void HTMLMediaElement::setDefaultPlaybackRate(double rate)
{
- // FIXME: generated bindings should check isfinite: http://crbug.com/354298
- if (!std::isfinite(rate)) {
- exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(rate));
- return;
- }
if (m_defaultPlaybackRate != rate) {
m_defaultPlaybackRate = rate;
scheduleEvent(EventTypeNames::ratechange);
@@ -1947,16 +1937,10 @@ double HTMLMediaElement::playbackRate() const
return m_playbackRate;
}
-void HTMLMediaElement::setPlaybackRate(double rate, ExceptionState& exceptionState)
+void HTMLMediaElement::setPlaybackRate(double rate)
{
WTF_LOG(Media, "HTMLMediaElement::setPlaybackRate(%f)", rate);
- // FIXME: generated bindings should check isfinite: http://crbug.com/354298
- if (!std::isfinite(rate)) {
- exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(rate));
- return;
- }
-
if (m_playbackRate != rate) {
m_playbackRate = rate;
invalidateCachedTime();
@@ -2121,12 +2105,6 @@ void HTMLMediaElement::setVolume(double vol, ExceptionState& exceptionState)
{
WTF_LOG(Media, "HTMLMediaElement::setVolume(%f)", vol);
- // FIXME: generated bindings should check isfinite: http://crbug.com/354298
- if (!std::isfinite(vol)) {
- exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(vol));
- return;
- }
-
if (vol < 0.0f || vol > 1.0f) {
exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexOutsideRange("volume", vol, 0.0, ExceptionMessages::InclusiveBound, 1.0, ExceptionMessages::InclusiveBound));
return;
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/HTMLMediaElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698