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

Unified Diff: third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp

Issue 1920863005: Disable autoplay experiments if the autoplay content settings is set to block. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autoplay-ifsameorigin-ormuted
Patch Set: split autoplay experiment tests Created 4 years, 8 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/AutoplayExperimentHelper.cpp
diff --git a/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp b/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp
index 80ead256c3e68e9c3b13db9a8171fbf7799cfa95..0d917bcbf0214b84ca07d2989bad1c3fcd21dfc8 100644
--- a/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp
+++ b/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp
@@ -301,6 +301,10 @@ bool AutoplayExperimentHelper::isEligible() const
if (m_mode == Mode::ExperimentOff)
return false;
+ // If autoplay is disabled, no one is eligible.
+ if (!client().isAutoplayAllowedPerSettings())
+ return false;
+
// If no user gesture is required, then the experiment doesn't apply.
// This is what prevents us from starting playback more than once.
// Since this flag is never set to true once it's cleared, it will block

Powered by Google App Engine
This is Rietveld 408576698