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

Unified Diff: third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp

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/paint/MediaControlsPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp b/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp
index 827389b4b94b143b7d0724e0a2ba353bf814f0e6..6c6ae44f59a241eb5e0ab5479b27c24650474c64 100644
--- a/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp
@@ -31,6 +31,7 @@
#include "core/html/HTMLMediaElement.h"
#include "core/html/TimeRanges.h"
#include "core/html/shadow/MediaControlElementTypes.h"
+#include "core/html/shadow/MediaControls.h"
#include "core/paint/PaintInfo.h"
#include "core/style/ComputedStyle.h"
#include "platform/graphics/Gradient.h"
@@ -325,9 +326,12 @@ void MediaControlsPainter::paintMediaSliderInternal(const LayoutObject& object,
paintRoundedSliderBackground(rect, style, context, sliderBackgroundColor);
+ TimeRanges* bufferedTimeRanges = mediaElement->mediaControls()->bufferedRangesForPainting();
liberato (no reviews please) 2016/08/29 15:25:34 could one use mediaElement->buffered() here as wel
Xianzhu 2016/08/29 18:04:14 This is required in the under-invalidation checkin
+ if (!bufferedTimeRanges)
+ return;
+
// Draw the buffered range. Since the element may have multiple buffered ranges and it'd be
// distracting/'busy' to show all of them, show only the buffered range containing the current play head.
- TimeRanges* bufferedTimeRanges = mediaElement->buffered();
float duration = mediaElement->duration();
float currentTime = mediaElement->currentTime();
if (std::isnan(duration) || std::isinf(duration) || !duration || std::isnan(currentTime))

Powered by Google App Engine
This is Rietveld 408576698