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

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

Issue 154283004: Move ReadyState enum from MediaControllerInterface to HTMLMediaElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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
Index: Source/core/html/MediaController.cpp
diff --git a/Source/core/html/MediaController.cpp b/Source/core/html/MediaController.cpp
index e93bbc1df30e8181ab3313874535b5e6699ad526..f6bdbf7a464864e5c82e3b32b0e91a92b79f6ee8 100644
--- a/Source/core/html/MediaController.cpp
+++ b/Source/core/html/MediaController.cpp
@@ -51,7 +51,7 @@ MediaController::MediaController(ExecutionContext* context)
, m_volume(1)
, m_position(MediaPlayer::invalidTime())
, m_muted(false)
- , m_readyState(HAVE_NOTHING)
+ , m_readyState(HTMLMediaElement::HAVE_NOTHING)
, m_playbackState(WAITING)
, m_asyncEventTimer(this, &MediaController::asyncEventTimerFired)
, m_clearPositionTimer(this, &MediaController::clearPositionTimerFired)
@@ -331,18 +331,18 @@ void MediaController::reportControllerState()
updatePlaybackState();
}
-static AtomicString eventNameForReadyState(MediaControllerInterface::ReadyState state)
+static AtomicString eventNameForReadyState(HTMLMediaElement::ReadyState state)
acolwell GONE FROM CHROMIUM 2014/02/07 21:52:40 nit: If you make this a method, you shouldn't have
philipj_slow 2014/02/08 03:52:03 The enum constants themselves still need to be pre
{
switch (state) {
- case MediaControllerInterface::HAVE_NOTHING:
+ case HTMLMediaElement::HAVE_NOTHING:
return EventTypeNames::emptied;
- case MediaControllerInterface::HAVE_METADATA:
+ case HTMLMediaElement::HAVE_METADATA:
return EventTypeNames::loadedmetadata;
- case MediaControllerInterface::HAVE_CURRENT_DATA:
+ case HTMLMediaElement::HAVE_CURRENT_DATA:
return EventTypeNames::loadeddata;
- case MediaControllerInterface::HAVE_FUTURE_DATA:
+ case HTMLMediaElement::HAVE_FUTURE_DATA:
return EventTypeNames::canplay;
- case MediaControllerInterface::HAVE_ENOUGH_DATA:
+ case HTMLMediaElement::HAVE_ENOUGH_DATA:
return EventTypeNames::canplaythrough;
default:
ASSERT_NOT_REACHED();
@@ -352,12 +352,12 @@ static AtomicString eventNameForReadyState(MediaControllerInterface::ReadyState
void MediaController::updateReadyState()
{
- ReadyState oldReadyState = m_readyState;
- ReadyState newReadyState;
+ HTMLMediaElement::ReadyState oldReadyState = m_readyState;
+ HTMLMediaElement::ReadyState newReadyState;
if (m_mediaElements.isEmpty()) {
// If the MediaController has no slaved media elements, let new readiness state be 0.
- newReadyState = HAVE_NOTHING;
+ newReadyState = HTMLMediaElement::HAVE_NOTHING;
} else {
// Otherwise, let it have the lowest value of the readyState IDL attributes of all of its
// slaved media elements.
@@ -380,10 +380,10 @@ void MediaController::updateReadyState()
// If the MediaController's most recently reported readiness state is less than the new readiness
// state, then run these substeps:
// 1. Let next state be the MediaController's most recently reported readiness state.
- ReadyState nextState = oldReadyState;
+ HTMLMediaElement::ReadyState nextState = oldReadyState;
do {
// 2. Loop: Increment next state by one.
- nextState = static_cast<ReadyState>(nextState + 1);
+ nextState = static_cast<HTMLMediaElement::ReadyState>(nextState + 1);
// 3. Queue a task to fire a simple event at the MediaController object, whose name is the
// event name corresponding to the value of next state given in the table below. [omitted]
scheduleEvent(eventNameForReadyState(nextState));

Powered by Google App Engine
This is Rietveld 408576698