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

Unified Diff: content/child/runtime_features.cc

Issue 79193003: Enable WebAudio support on Android/x86. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years 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 | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/runtime_features.cc
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index 6900959fb5cbab258f04ca453e1453d8c6cdce63..94e5c1a9e1633ee9e0f86694cad9da77f6be9f9f 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -27,12 +27,11 @@ static void SetRuntimeFeatureDefaultsForPlatform() {
WebRuntimeFeatures::enablePrefixedEncryptedMedia(false);
}
#endif // !defined(GOOGLE_TV)
- bool enable_webaudio = false;
-#if defined(ARCH_CPU_ARMEL)
- // WebAudio needs Android MediaCodec API
- enable_webaudio = media::MediaCodecBridge::IsAvailable();
-#endif // defined(ARCH_CPU_ARMEL)
- WebRuntimeFeatures::enableWebAudio(enable_webaudio);
+ // WebAudio is enabled by default only on ARM and only when the
+ // MediaCodec API is available.
+ WebRuntimeFeatures::enableWebAudio(
+ media::MediaCodecBridge::IsAvailable() &&
+ (android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM));
// Android does not support the Gamepad API.
WebRuntimeFeatures::enableGamepad(false);
// Android does not have support for PagePopup
@@ -93,8 +92,25 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (command_line.HasSwitch(switches::kEnableServiceWorker))
WebRuntimeFeatures::enableServiceWorker(true);
+#if defined(OS_ANDROID)
+ // WebAudio requires the MediaCodec API.
+#if defined(ARCH_CPU_X86)
+ // WebAudio is disabled by default on x86.
+ WebRuntimeFeatures::enableWebAudio(
+ command_line.HasSwitch(switches::kEnableWebAudio) &&
+ media::MediaCodecBridge::IsAvailable());
+#elif defined(ARCH_CPU_ARMEL)
+ // WebAudio is enabled by default on ARM.
+ WebRuntimeFeatures::enableWebAudio(
+ !command_line.HasSwitch(switches::kDisableWebAudio) &&
+ media::MediaCodecBridge::IsAvailable());
+#else
+ WebRuntimeFeatures::enableWebAudio(false);
+#endif
+#else
if (command_line.HasSwitch(switches::kDisableWebAudio))
WebRuntimeFeatures::enableWebAudio(false);
+#endif
if (command_line.HasSwitch(switches::kDisableFullScreen))
WebRuntimeFeatures::enableFullscreen(false);
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698