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); |