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

Side by Side 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, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLInputElement.idl ('k') | Source/core/html/HTMLMeterElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after
1919 return m_paused; 1919 return m_paused;
1920 } 1920 }
1921 1921
1922 double HTMLMediaElement::defaultPlaybackRate() const 1922 double HTMLMediaElement::defaultPlaybackRate() const
1923 { 1923 {
1924 return m_defaultPlaybackRate; 1924 return m_defaultPlaybackRate;
1925 } 1925 }
1926 1926
1927 void HTMLMediaElement::setDefaultPlaybackRate(double rate) 1927 void HTMLMediaElement::setDefaultPlaybackRate(double rate)
1928 { 1928 {
1929 if (m_defaultPlaybackRate != rate) { 1929 if (m_defaultPlaybackRate == rate)
1930 m_defaultPlaybackRate = rate; 1930 return;
1931 scheduleEvent(EventTypeNames::ratechange); 1931
1932 } 1932 m_defaultPlaybackRate = rate;
1933 scheduleEvent(EventTypeNames::ratechange);
1933 } 1934 }
1934 1935
1935 double HTMLMediaElement::playbackRate() const 1936 double HTMLMediaElement::playbackRate() const
1936 { 1937 {
1937 return m_playbackRate; 1938 return m_playbackRate;
1938 } 1939 }
1939 1940
1940 void HTMLMediaElement::setPlaybackRate(double rate) 1941 void HTMLMediaElement::setPlaybackRate(double rate)
1941 { 1942 {
1942 WTF_LOG(Media, "HTMLMediaElement::setPlaybackRate(%f)", rate); 1943 WTF_LOG(Media, "HTMLMediaElement::setPlaybackRate(%f)", rate);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2098 2099
2099 double HTMLMediaElement::volume() const 2100 double HTMLMediaElement::volume() const
2100 { 2101 {
2101 return m_volume; 2102 return m_volume;
2102 } 2103 }
2103 2104
2104 void HTMLMediaElement::setVolume(double vol, ExceptionState& exceptionState) 2105 void HTMLMediaElement::setVolume(double vol, ExceptionState& exceptionState)
2105 { 2106 {
2106 WTF_LOG(Media, "HTMLMediaElement::setVolume(%f)", vol); 2107 WTF_LOG(Media, "HTMLMediaElement::setVolume(%f)", vol);
2107 2108
2109 if (m_volume == vol)
2110 return;
2111
2108 if (vol < 0.0f || vol > 1.0f) { 2112 if (vol < 0.0f || vol > 1.0f) {
2109 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xOutsideRange("volume", vol, 0.0, ExceptionMessages::InclusiveBound, 1.0, Except ionMessages::InclusiveBound)); 2113 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xOutsideRange("volume", vol, 0.0, ExceptionMessages::InclusiveBound, 1.0, Except ionMessages::InclusiveBound));
2110 return; 2114 return;
2111 } 2115 }
2112 2116
2113 if (m_volume != vol) { 2117 m_volume = vol;
2114 m_volume = vol; 2118 updateVolume();
2115 updateVolume(); 2119 scheduleEvent(EventTypeNames::volumechange);
2116 scheduleEvent(EventTypeNames::volumechange);
2117 }
2118 } 2120 }
2119 2121
2120 bool HTMLMediaElement::muted() const 2122 bool HTMLMediaElement::muted() const
2121 { 2123 {
2122 return m_muted; 2124 return m_muted;
2123 } 2125 }
2124 2126
2125 void HTMLMediaElement::setMuted(bool muted) 2127 void HTMLMediaElement::setMuted(bool muted)
2126 { 2128 {
2127 WTF_LOG(Media, "HTMLMediaElement::setMuted(%s)", boolString(muted)); 2129 WTF_LOG(Media, "HTMLMediaElement::setMuted(%s)", boolString(muted));
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
3610 3612
3611 void HTMLMediaElement::trace(Visitor* visitor) 3613 void HTMLMediaElement::trace(Visitor* visitor)
3612 { 3614 {
3613 visitor->trace(m_textTracks); 3615 visitor->trace(m_textTracks);
3614 visitor->trace(m_textTracksWhenResourceSelectionBegan); 3616 visitor->trace(m_textTracksWhenResourceSelectionBegan);
3615 Supplementable<HTMLMediaElement>::trace(visitor); 3617 Supplementable<HTMLMediaElement>::trace(visitor);
3616 HTMLElement::trace(visitor); 3618 HTMLElement::trace(visitor);
3617 } 3619 }
3618 3620
3619 } 3621 }
OLDNEW
« 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