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

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

Issue 1949633002: Don't remove the gesture requirement in the autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed test expectations. Created 4 years, 7 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 81bda861d7fa13958c63371153ec38a5bda8ce70..282856a1a9aa90f4c1351e6acedb07c2585ec119 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h
@@ -450,14 +450,22 @@ private:
// transition to HAVE_METADATA.
void selectInitialTracksIfNecessary();
- // Return true if and only if we require a user gesture before letting
- // the media play.
- bool isUserGestureRequiredForPlay() const;
+ // Return true if and only if a user gesture is required to unlock this
+ // media element for unrestricted autoplay / script control. Don't confuse
+ // this with isGestureNeededForPlayback(). The latter is usually what one
+ // should use, if checking to see if an action is allowed.
+ bool isLockedPendingUserGesture() const;
// If the user gesture is required, then this will remove it. Note that
// one should not generally call this method directly; use the one on
// m_helper and give it a reason.
- void removeUserGestureRequirement();
+ void unlockUserGesture();
+
+ // Return true if and only if a user gesture is requried for playback. Even
+ // if isLockedPendingUserGesture() return true, this might return false if
+ // the requirement is currently overridden. This does not check if a user
+ // gesture is currently being processed.
+ bool isGestureNeededForPlayback() const;
void setNetworkState(NetworkState);
@@ -549,7 +557,7 @@ private:
PendingActionFlags m_pendingActionFlags;
// FIXME: HTMLMediaElement has way too many state bits.
- bool m_userGestureRequiredForPlay : 1;
+ bool m_lockedPendingUserGesture : 1;
bool m_playing : 1;
bool m_shouldDelayLoadEvent : 1;
bool m_haveFiredLoadedData : 1;

Powered by Google App Engine
This is Rietveld 408576698