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

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

Issue 18548003: Rename ExceptionCode constants to use the names in the spec (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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.cpp ('k') | Source/core/html/HTMLOptionsCollection.cpp » ('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 202f0c8d8e0713312f72f96285aef87288c16316..78100a5a144ff3b444457dd02cc70e44285a5520 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -160,13 +160,13 @@ static ExceptionCode exceptionCodeForMediaKeyException(MediaPlayer::MediaKeyExce
case MediaPlayer::NoError:
return 0;
case MediaPlayer::InvalidPlayerState:
- return INVALID_STATE_ERR;
+ return InvalidStateError;
case MediaPlayer::KeySystemNotSupported:
return NotSupportedError;
}
ASSERT_NOT_REACHED();
- return INVALID_STATE_ERR;
+ return InvalidStateError;
}
class TrackDisplayUpdateScope {
@@ -1826,9 +1826,9 @@ void HTMLMediaElement::seek(double time, ExceptionCode& ec)
// 4.8.9.9 Seeking
- // 1 - If the media element's readyState is HAVE_NOTHING, then raise an INVALID_STATE_ERR exception.
+ // 1 - If the media element's readyState is HAVE_NOTHING, then raise an InvalidStateError exception.
if (m_readyState == HAVE_NOTHING || !m_player) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
@@ -1993,7 +1993,7 @@ double HTMLMediaElement::currentTime() const
void HTMLMediaElement::setCurrentTime(double time, ExceptionCode& ec)
{
if (m_mediaController) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
seek(time, ec);
@@ -2217,12 +2217,12 @@ void HTMLMediaElement::closeMediaSource()
void HTMLMediaElement::webkitGenerateKeyRequest(const String& keySystem, PassRefPtr<Uint8Array> initData, ExceptionCode& ec)
{
if (keySystem.isEmpty()) {
- ec = SYNTAX_ERR;
+ ec = SyntaxError;
return;
}
if (!m_player) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
@@ -2245,22 +2245,22 @@ void HTMLMediaElement::webkitGenerateKeyRequest(const String& keySystem, Excepti
void HTMLMediaElement::webkitAddKey(const String& keySystem, PassRefPtr<Uint8Array> key, PassRefPtr<Uint8Array> initData, const String& sessionId, ExceptionCode& ec)
{
if (keySystem.isEmpty()) {
- ec = SYNTAX_ERR;
+ ec = SyntaxError;
return;
}
if (!key) {
- ec = SYNTAX_ERR;
+ ec = SyntaxError;
return;
}
if (!key->length()) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
if (!m_player) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
@@ -2283,12 +2283,12 @@ void HTMLMediaElement::webkitAddKey(const String& keySystem, PassRefPtr<Uint8Arr
void HTMLMediaElement::webkitCancelKeyRequest(const String& keySystem, const String& sessionId, ExceptionCode& ec)
{
if (keySystem.isEmpty()) {
- ec = SYNTAX_ERR;
+ ec = SyntaxError;
return;
}
if (!m_player) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
@@ -2589,7 +2589,7 @@ PassRefPtr<TextTrack> HTMLMediaElement::addTextTrack(const String& kind, const S
// 1. If kind is not one of the following strings, then throw a SyntaxError exception and abort these steps
if (!TextTrack::isValidKindKeyword(kind)) {
- ec = SYNTAX_ERR;
+ ec = SyntaxError;
return 0;
}
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | Source/core/html/HTMLOptionsCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698