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

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

Issue 262753004: Replace all remaining IDL finitude type checks with [TypeChecking=Unrestricted] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased 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/HTMLInputElement.idl ('k') | Source/core/html/HTMLMeterElement.h » ('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 a0ea47d85c787d1ed150be0b0a33b14728137df5..d5095be123ec94c9de987eebce36db2928a6ed73 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -1926,10 +1926,11 @@ double HTMLMediaElement::defaultPlaybackRate() const
void HTMLMediaElement::setDefaultPlaybackRate(double rate)
{
- if (m_defaultPlaybackRate != rate) {
- m_defaultPlaybackRate = rate;
- scheduleEvent(EventTypeNames::ratechange);
- }
+ if (m_defaultPlaybackRate == rate)
+ return;
+
+ m_defaultPlaybackRate = rate;
+ scheduleEvent(EventTypeNames::ratechange);
}
double HTMLMediaElement::playbackRate() const
@@ -2105,16 +2106,17 @@ void HTMLMediaElement::setVolume(double vol, ExceptionState& exceptionState)
{
WTF_LOG(Media, "HTMLMediaElement::setVolume(%f)", vol);
+ if (m_volume == 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;
}
- if (m_volume != vol) {
- m_volume = vol;
- updateVolume();
- scheduleEvent(EventTypeNames::volumechange);
- }
+ m_volume = vol;
+ updateVolume();
+ scheduleEvent(EventTypeNames::volumechange);
}
bool HTMLMediaElement::muted() const
« no previous file with comments | « Source/core/html/HTMLInputElement.idl ('k') | Source/core/html/HTMLMeterElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698