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

Unified Diff: webkit/media/android/webmediaplayer_android.cc

Issue 10469003: Prepare WebMediaPlayerAndroid for bytesLoaded() -> didLoadingProgress() transition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/android/webmediaplayer_android.cc
diff --git a/webkit/media/android/webmediaplayer_android.cc b/webkit/media/android/webmediaplayer_android.cc
index b4184dadadf9ce8f67da5840da276baabb343e96..1b99ebb6dfb8e1bb9131311a342c1b8536d17f7e 100644
--- a/webkit/media/android/webmediaplayer_android.cc
+++ b/webkit/media/android/webmediaplayer_android.cc
@@ -60,6 +60,7 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid(
seeking_(false),
playback_completed_(false),
buffered_bytes_(0),
+ did_loading_progress_(false),
cookie_jar_(cookie_jar),
pending_play_event_(false),
network_state_(WebMediaPlayer::NetworkStateEmpty),
@@ -264,6 +265,12 @@ float WebMediaPlayerAndroid::maxTimeSeekable() const {
return duration();
}
+bool WebMediaPlayerAndroid::didLoadingProgress() const {
+ bool ret = did_loading_progress_;
+ did_loading_progress_ = false;
+ return ret;
+}
+
unsigned long long WebMediaPlayerAndroid::bytesLoaded() const {
return buffered_bytes_;
}
@@ -371,6 +378,7 @@ void WebMediaPlayerAndroid::OnPlaybackComplete() {
void WebMediaPlayerAndroid::OnBufferingUpdate(int percentage) {
buffered_[0].end = duration() * percentage / 100;
+ did_loading_progress_ = true;
// Implement a trick here to fake progress event, as WebKit checks
// consecutive bytesLoaded() to see if any progress made.
// See HTMLMediaElement::progressEventTimerFired.
« no previous file with comments | « webkit/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698