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

Unified Diff: media/base/media_switches.cc

Issue 2837023002: Create autoplay policy flag and merge cross-origin autoplay blocking into it. (Closed)
Patch Set: fix tests Created 3 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
« no previous file with comments | « media/base/media_switches.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_switches.cc
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
index 03b4c7685e31a19cc1f8df94f6e719030fa783ec..571974cd77a5f13cc5d4085dac1d5f3cb2210c89 100644
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -11,6 +11,9 @@ namespace switches {
// Allow users to specify a custom buffer size for debugging purpose.
const char kAudioBufferSize[] = "audio-buffer-size";
+// Command line flag name to set the autoplay policy.
+const char kAutoplayPolicy[] = "autoplay-policy";
+
// Set number of threads to use for video decoding.
const char kVideoThreads[] = "video-threads";
@@ -135,20 +138,24 @@ const char kForceVideoOverlays[] = "force-video-overlays";
const char kMSEAudioBufferSizeLimit[] = "mse-audio-buffer-size-limit";
const char kMSEVideoBufferSizeLimit[] = "mse-video-buffer-size-limit";
-} // namespace switches
+namespace autoplay {
-namespace media {
+// Autoplay policy to require a user gesture in ordor to play for cross origin
+// iframes.
+const char kCrossOriginUserGestureRequiredPolicy[] =
+ "cross-origin-user-gesture-required";
-#if defined(OS_WIN)
-// Enables video decode acceleration using the D3D11 video decoder api.
-// This is completely insecure - DO NOT USE except for testing.
-const base::Feature kD3D11VideoDecoding{"D3D11VideoDecoding",
- base::FEATURE_DISABLED_BY_DEFAULT};
+// Autoplay policy that does not require any user gesture.
+const char kNoUserGestureRequiredPolicy[] = "no-user-gesture-required";
-// Enables H264 HW encode acceleration using Media Foundation for Windows.
-const base::Feature kMediaFoundationH264Encoding{
- "MediaFoundationH264Encoding", base::FEATURE_ENABLED_BY_DEFAULT};
-#endif // defined(OS_WIN)
+// Autoplay policy to require a user gesture in order to play.
+const char kUserGestureRequiredPolicy[] = "user-gesture-required";
+
+} // namespace autoplay
+
+} // namespace switches
+
+namespace media {
// Use new audio rendering mixer.
const base::Feature kNewAudioRenderingMixingStrategy{
@@ -214,4 +221,15 @@ const base::Feature kMediaDrmPersistentLicense{
#endif
+#if defined(OS_WIN)
+// Enables video decode acceleration using the D3D11 video decoder api.
+// This is completely insecure - DO NOT USE except for testing.
+const base::Feature kD3D11VideoDecoding{"D3D11VideoDecoding",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
+// Enables H264 HW encode acceleration using Media Foundation for Windows.
+const base::Feature kMediaFoundationH264Encoding{
+ "MediaFoundationH264Encoding", base::FEATURE_ENABLED_BY_DEFAULT};
+#endif // defined(OS_WIN)
+
} // namespace media
« no previous file with comments | « media/base/media_switches.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698