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

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.h

Issue 2425463002: Improve HTMLMediaElement::currentTime() (Closed)
Patch Set: Feedback Created 4 years, 2 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/HTMLMediaElement.h
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.h b/third_party/WebKit/Source/core/html/HTMLMediaElement.h
index 8050c4050f996bd8d70c4ea07ff7f4da8690ce60..177f3d69646fee9f3f6160b48882a078ce720853 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h
@@ -465,8 +465,12 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement,
bool endedPlayback(LoopCondition = LoopCondition::Included) const;
void setShouldDelayLoadEvent(bool);
- void invalidateCachedTime();
- void refreshCachedTime() const;
+
+ double earliestPossiblePosition() const;
+ double currentPlaybackPosition() const;
+ double officialPlaybackPosition() const;
+ void setOfficialPlaybackPosition(double) const;
+ void requireOfficialPlaybackPositionUpdate() const;
void ensureMediaControls();
void configureMediaControls();
@@ -567,7 +571,7 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement,
double m_lastTimeUpdateEventWallTime;
// The last time a timeupdate event was sent in movie time.
- double m_lastTimeUpdateEventMovieTime;
+ double m_lastTimeUpdateEventMediaTime;
// The default playback start position.
double m_defaultPlaybackStartPosition;
@@ -606,9 +610,11 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement,
Member<HTMLMediaSource> m_mediaSource;
- // Cached time value. Only valid when ready state is kHaveMetadata or
- // higher, otherwise the current time is assumed to be zero.
- mutable double m_cachedTime;
+ // Stores "official playback position", updated periodically from "current
+ // playback position". Official playback position should not change while
+ // scripts are running. See setOfficialPlaybackPosition().
+ mutable double m_officialPlaybackPosition;
+ mutable bool m_officialPlaybackPositionNeedsUpdate;
double m_fragmentEndTime;

Powered by Google App Engine
This is Rietveld 408576698