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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControls.h

Issue 2280123002: Fix under-invalidation of media buffered ranges (Closed)
Patch Set: Synchronize buffered ranges when the current play time changes Created 4 years, 4 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: third_party/WebKit/Source/core/html/shadow/MediaControls.h
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControls.h b/third_party/WebKit/Source/core/html/shadow/MediaControls.h
index 8b5892229a9919dc173917c16384231f1a0d6e78..d660f5c93f53f2c7bc2da682c10685c5d65e5821 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.h
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.h
@@ -34,6 +34,7 @@ namespace blink {
class Event;
class TextTrackContainer;
+class TimeRanges;
class CORE_EXPORT MediaControls final : public HTMLDivElement {
public:
@@ -86,6 +87,10 @@ public:
// Notify us that the media element's network state has changed.
void networkStateChanged();
+ // Returns the cached buffered ranges for painting updated by the m_bufferedRangesPaintInvalidationTimer
+ // periodically while the media is loading. It can be null.
+ TimeRanges* bufferedRangesForPainting() const { return m_bufferedRangesForPainting.get(); }
+
DECLARE_VIRTUAL_TRACE();
private:
@@ -127,6 +132,10 @@ private:
void defaultEventHandler(Event*) override;
bool containsRelatedTarget(Event*);
+ void updateTimelinePosition();
+ void updateBufferedRanges();
+ void bufferedRangesPaintInvalidationTimerFired(TimerBase*);
+
Member<HTMLMediaElement> m_mediaElement;
// Media control elements.
@@ -155,6 +164,9 @@ private:
int m_panelWidth;
bool m_allowHiddenVolumeControls : 1;
+
+ Timer<MediaControls> m_bufferedRangesPaintInvalidationTimer;
+ Member<TimeRanges> m_bufferedRangesForPainting;
};
DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls());

Powered by Google App Engine
This is Rietveld 408576698