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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 599103003: Switch from WebMediaPlayer::maxTimeSeekable() to seekable() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: early return Created 6 years, 3 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 | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/webmediaplayer_ms.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 155eea86d912b4783858385ae90d1a8b95bb0d3f..654bd5978ceb830defe973b3be33d652676ccf90 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -520,13 +520,21 @@ WebTimeRanges WebMediaPlayerAndroid::buffered() const {
return buffered_;
}
-double WebMediaPlayerAndroid::maxTimeSeekable() const {
- // If we haven't even gotten to ReadyStateHaveMetadata yet then just
- // return 0 so that the seekable range is empty.
+WebTimeRanges WebMediaPlayerAndroid::seekable() const {
+ // If we haven't even gotten to ReadyStateHaveMetadata yet then there
+ // are no seekable ranges.
if (ready_state_ < WebMediaPlayer::ReadyStateHaveMetadata)
- return 0.0;
+ return WebTimeRanges();
- return duration();
+ // If we have a duration then use [0, duration] as the seekable range.
+ const double duration = this->duration();
DaleCurtis 2014/09/29 16:52:43 Avoid this-> with current_duration or something? I
philipj_slow 2014/09/29 19:51:46 I don't like this style either, I was just going w
philipj_slow 2014/09/30 08:09:28 seekable_end it is.
+ if (!duration)
+ return WebTimeRanges();
+
+ WebTimeRanges ranges(static_cast<size_t>(1));
DaleCurtis 2014/09/29 16:52:43 Does 1 hit a compiler error somewhere? 1u should w
philipj_slow 2014/09/29 19:51:46 Yes, it's ambiguous because WebVector has so many
philipj_slow 2014/09/30 08:09:28 I went with the WebVector(const U* values, size_t
+ ranges[0].start = 0.0;
+ ranges[0].end = duration;
+ return ranges;
}
bool WebMediaPlayerAndroid::didLoadingProgress() {
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/webmediaplayer_ms.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698