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

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

Issue 1850903002: Enable user gesture requirement for autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased. 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..9f72e5c3dffa547767a12f82b1495612b6b64488 100644
--- a/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp
+++ b/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp
@@ -39,7 +39,7 @@ AutoplayExperimentHelper::AutoplayExperimentHelper(Client* client)
{
m_mode = fromString(this->client().autoplayExperimentMode());
- if (m_mode != Mode::ExperimentOff) {
+ if (isExperimentEnabled()) {
WTF_LOG(Media, "HTMLMediaElement: autoplay experiment set to %d",
m_mode);
}
@@ -496,4 +496,9 @@ bool AutoplayExperimentHelper::requiresViewportVisibility() const
return enabled(IfViewport) || enabled(IfPartialViewport);
}
+bool AutoplayExperimentHelper::isExperimentEnabled()
+{
+ return m_mode != Mode::ExperimentOff;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698