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

Side by Side Diff: media/base/media_switches.cc

Issue 2846623003: Make autoplay policies no longer platform dependant. (Closed)
Patch Set: fix webview Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/media_switches.h"
6 #include "base/command_line.h"
5 #include "build/build_config.h" 7 #include "build/build_config.h"
6 #include "media/base/media_switches.h"
7 #include "ppapi/features/features.h" 8 #include "ppapi/features/features.h"
8 9
9 namespace switches { 10 namespace switches {
10 11
11 // Allow users to specify a custom buffer size for debugging purpose. 12 // Allow users to specify a custom buffer size for debugging purpose.
12 const char kAudioBufferSize[] = "audio-buffer-size"; 13 const char kAudioBufferSize[] = "audio-buffer-size";
13 14
14 // Command line flag name to set the autoplay policy. 15 // Command line flag name to set the autoplay policy.
15 const char kAutoplayPolicy[] = "autoplay-policy"; 16 const char kAutoplayPolicy[] = "autoplay-policy";
16 17
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // Enables video decode acceleration using the D3D11 video decoder api. 244 // Enables video decode acceleration using the D3D11 video decoder api.
244 // This is completely insecure - DO NOT USE except for testing. 245 // This is completely insecure - DO NOT USE except for testing.
245 const base::Feature kD3D11VideoDecoding{"D3D11VideoDecoding", 246 const base::Feature kD3D11VideoDecoding{"D3D11VideoDecoding",
246 base::FEATURE_DISABLED_BY_DEFAULT}; 247 base::FEATURE_DISABLED_BY_DEFAULT};
247 248
248 // Enables H264 HW encode acceleration using Media Foundation for Windows. 249 // Enables H264 HW encode acceleration using Media Foundation for Windows.
249 const base::Feature kMediaFoundationH264Encoding{ 250 const base::Feature kMediaFoundationH264Encoding{
250 "MediaFoundationH264Encoding", base::FEATURE_ENABLED_BY_DEFAULT}; 251 "MediaFoundationH264Encoding", base::FEATURE_ENABLED_BY_DEFAULT};
251 #endif // defined(OS_WIN) 252 #endif // defined(OS_WIN)
252 253
254 std::string GetEffectiveAutoplayPolicy(const base::CommandLine& command_line) {
255 if (command_line.HasSwitch(switches::kIgnoreAutoplayRestrictionsForTests))
256 return switches::autoplay::kNoUserGestureRequiredPolicy;
257
258 // Return the default policy if none is specified in the command line.
259 if (!command_line.HasSwitch(switches::kAutoplayPolicy)) {
Bernhard Bauer 2017/05/09 12:47:17 Nit: I would probably flip this condition around,
mlamouri (slow - plz ping) 2017/05/09 17:24:35 Done.
260 #if defined(OS_ANDROID)
261 return switches::autoplay::kUserGestureRequiredPolicy;
262 #else
263 return switches::autoplay::kNoUserGestureRequiredPolicy;
264 #endif
265 }
266
267 return command_line.GetSwitchValueASCII(switches::kAutoplayPolicy);
268 }
269
253 } // namespace media 270 } // namespace media
OLDNEW
« content/public/common/web_preferences.h ('K') | « media/base/media_switches.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698