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

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

Issue 2524443002: Adding Rappor metrics for disabling cross-origin autoplay with sound experiment (Closed)
Patch Set: new implementation Created 4 years, 1 month 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 065df76d595f6f79be56f569e963d7f11a333501..f3116b3d5079e5bb4560493c50a01577ea3c5356 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h
@@ -289,6 +289,9 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement,
// specified origin.
bool isMediaDataCORSSameOrigin(SecurityOrigin*) const;
+ // Returns this media element is in a cross-origin frame.
+ bool isCrossOrigin() const;
whywhat 2016/11/29 21:42:04 nit: add frame to the name? it could be cross-orig
Zhiqiang Zhang (Slow) 2016/11/30 17:30:52 s/isCrossOrigin/isInCrossOriginFrame
+
void scheduleEvent(Event*);
void scheduleTimeupdateEvent(bool periodicEvent);
@@ -518,6 +521,8 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement,
// should use, if checking to see if an action is allowed.
bool isLockedPendingUserGesture() const;
+ bool isLockedPendingUserGestureIfCrossOriginExperimentEnabled() const;
whywhat 2016/11/29 21:42:05 can't this be part of the method above instead? it
Zhiqiang Zhang (Slow) 2016/11/30 17:30:52 Please see the other reply.
+
// 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.
@@ -529,6 +534,8 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement,
// gesture is currently being processed.
bool isGestureNeededForPlayback() const;
+ bool isGestureNeededForPlaybackIfCrossOriginExperimentEnabled() const;
whywhat 2016/11/29 21:42:05 ditto
+
// Return true if and only if the settings allow autoplay of media on this
// frame.
bool isAutoplayAllowedPerSettings() const;
@@ -633,6 +640,7 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement,
// FIXME: HTMLMediaElement has way too many state bits.
bool m_lockedPendingUserGesture : 1;
+ bool m_lockedPendingUserGestureIfCrossOriginExperimentEnabled : 1;
bool m_playing : 1;
bool m_shouldDelayLoadEvent : 1;
bool m_haveFiredLoadedData : 1;

Powered by Google App Engine
This is Rietveld 408576698