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

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 197213012: Improve media-related exception messages (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove redundant TimeRanges test Created 6 years, 9 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 | « LayoutTests/media/video-volume-expected.txt ('k') | Source/core/html/TimeRanges.cpp » ('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 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 } 1840 }
1841 1841
1842 refreshCachedTime(); 1842 refreshCachedTime();
1843 1843
1844 return m_cachedTime; 1844 return m_cachedTime;
1845 } 1845 }
1846 1846
1847 void HTMLMediaElement::setCurrentTime(double time, ExceptionState& exceptionStat e) 1847 void HTMLMediaElement::setCurrentTime(double time, ExceptionState& exceptionStat e)
1848 { 1848 {
1849 if (m_mediaController) { 1849 if (m_mediaController) {
1850 exceptionState.throwDOMException(InvalidStateError, "No media controller is available."); 1850 exceptionState.throwDOMException(InvalidStateError, "The element is slav ed to a MediaController.");
1851 return; 1851 return;
1852 } 1852 }
1853 seek(time, exceptionState); 1853 seek(time, exceptionState);
1854 } 1854 }
1855 1855
1856 double HTMLMediaElement::duration() const 1856 double HTMLMediaElement::duration() const
1857 { 1857 {
1858 if (!m_player || m_readyState < HAVE_METADATA) 1858 if (!m_player || m_readyState < HAVE_METADATA)
1859 return numeric_limits<double>::quiet_NaN(); 1859 return numeric_limits<double>::quiet_NaN();
1860 1860
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 double HTMLMediaElement::volume() const 2059 double HTMLMediaElement::volume() const
2060 { 2060 {
2061 return m_volume; 2061 return m_volume;
2062 } 2062 }
2063 2063
2064 void HTMLMediaElement::setVolume(double vol, ExceptionState& exceptionState) 2064 void HTMLMediaElement::setVolume(double vol, ExceptionState& exceptionState)
2065 { 2065 {
2066 WTF_LOG(Media, "HTMLMediaElement::setVolume(%f)", vol); 2066 WTF_LOG(Media, "HTMLMediaElement::setVolume(%f)", vol);
2067 2067
2068 if (vol < 0.0f || vol > 1.0f) { 2068 if (vol < 0.0f || vol > 1.0f) {
2069 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xOutsideRange("volume", vol, 0.0, ExceptionMessages::ExclusiveBound, 1.0, Except ionMessages::ExclusiveBound)); 2069 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xOutsideRange("volume", vol, 0.0, ExceptionMessages::InclusiveBound, 1.0, Except ionMessages::InclusiveBound));
2070 return; 2070 return;
2071 } 2071 }
2072 2072
2073 if (m_volume != vol) { 2073 if (m_volume != vol) {
2074 m_volume = vol; 2074 m_volume = vol;
2075 updateVolume(); 2075 updateVolume();
2076 scheduleEvent(EventTypeNames::volumechange); 2076 scheduleEvent(EventTypeNames::volumechange);
2077 } 2077 }
2078 } 2078 }
2079 2079
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after
3618 { 3618 {
3619 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); 3619 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource));
3620 } 3620 }
3621 3621
3622 bool HTMLMediaElement::isInteractiveContent() const 3622 bool HTMLMediaElement::isInteractiveContent() const
3623 { 3623 {
3624 return fastHasAttribute(controlsAttr); 3624 return fastHasAttribute(controlsAttr);
3625 } 3625 }
3626 3626
3627 } 3627 }
OLDNEW
« no previous file with comments | « LayoutTests/media/video-volume-expected.txt ('k') | Source/core/html/TimeRanges.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698