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

Unified Diff: media/blink/webmediaplayer_impl.h

Issue 2796193002: fix canplaythrough (Closed)
Patch Set: merged Created 3 years, 8 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: media/blink/webmediaplayer_impl.h
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
index de05e0946ce18f6974448dea3207343c157eba94..709a15d45c4e2fd4249e5582b01ac500e4bca538 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -457,9 +457,20 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// handling a src= or MSE based playback.
void RecordUnderflowDuration(base::TimeDelta duration);
+ // Called by the data source when loading progresses.
+ // Can be called quite often.
+ void OnProgress();
+
+ // Returns true when we estimate that we can play the rest of the media
+ // without buffering.
+ bool CanPlayThrough();
+
// Records |natural_size| to MediaLog and video height to UMA.
void RecordVideoNaturalSize(const gfx::Size& natural_size);
+ // Takes ownership of |tick_clock|
+ void SetTickClockForTest(base::TickClock* tick_clock);
+
blink::WebLocalFrame* frame_;
// The playback state last reported to |delegate_|, to avoid setting duplicate
@@ -584,6 +595,8 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
+ std::unique_ptr<base::TickClock> tick_clock_;
+
BufferedDataSourceHostImpl buffered_data_source_host_;
linked_ptr<UrlIndex> url_index_;
@@ -684,8 +697,6 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
bool preroll_attempt_pending_;
base::TimeTicks preroll_attempt_start_time_;
- std::unique_ptr<base::TickClock> tick_clock_;
-
// Monitors the player events.
base::WeakPtr<MediaObserver> observer_;

Powered by Google App Engine
This is Rietveld 408576698