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

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 1184953006: Record autoplay disabled by sandbox flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix typo Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index e1c3961c68b756d4b96bf7d23f996e93d3a0049f..e8f5bbd509a337e6c37fe56069c87f48fc0a8e86 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -261,6 +261,8 @@ enum AutoplayMetrics {
AutoplayManualStart = 3,
// Autoplay was (re)enabled through a user-gesture triggered load()
AutoplayEnabledThroughLoad = 4,
+ // Autoplay disabled by sandbox flags.
+ AutoplayDisabledBySandbox = 5,
// This enum value must be last.
NumberOfAutoplayMetrics,
};
@@ -1536,9 +1538,12 @@ void HTMLMediaElement::setReadyState(ReadyState state)
scheduleEvent(EventTypeNames::playing);
}
- if (m_autoplaying && m_paused && autoplay() && !document().isSandboxed(SandboxAutomaticFeatures)) {
+ if (m_autoplaying && m_paused && autoplay()) {
autoplayMediaEncountered();
- if (!m_userGestureRequiredForPlay) {
+
+ if (document().isSandboxed(SandboxAutomaticFeatures)) {
+ recordAutoplayMetric(AutoplayDisabledBySandbox);
+ } else if (!m_userGestureRequiredForPlay) {
m_paused = false;
invalidateCachedTime();
scheduleEvent(EventTypeNames::play);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698