Commit 634a3bd9 authored by james.wei@intel.com's avatar james.wei@intel.com

disable web audio by default on android and add switches to enable it


BUG=
TEST=


Review URL: https://chromiumcodereview.appspot.com/10810034

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148516 0039d316-1c4b-4281-b951-d872f2087c98
parent 729eb631
......@@ -748,7 +748,11 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kDisableSpeechInput,
switches::kEnableScriptedSpeech,
switches::kDisableThreadedAnimation,
#if defined(OS_ANDROID)
switches::kEnableWebAudio,
#else
switches::kDisableWebAudio,
#endif
switches::kDisableWebSockets,
switches::kDomAutomationController,
switches::kEnableAccessibilityLogging,
......
......@@ -428,8 +428,13 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
!command_line.HasSwitch(switches::kDisableLocalStorage);
prefs.databases_enabled =
!command_line.HasSwitch(switches::kDisableDatabases);
#if defined(OS_ANDROID)
prefs.webaudio_enabled =
command_line.HasSwitch(switches::kEnableWebAudio);
#else
prefs.webaudio_enabled =
!command_line.HasSwitch(switches::kDisableWebAudio);
#endif
prefs.experimental_webgl_enabled =
GpuProcessHost::gpu_enabled() &&
......
......@@ -212,8 +212,13 @@ const char kSpeechRecognitionWebserviceKey[] = "speech-service-key";
// Disables animation on the compositor thread.
const char kDisableThreadedAnimation[] = "disable-threaded-animation";
#if defined(OS_ANDROID)
// Enable web audio API.
const char kEnableWebAudio[] = "enable-webaudio";
#else
// Disable web audio API.
const char kDisableWebAudio[] = "disable-webaudio";
#endif
// Don't enforce the same-origin policy. (Used by people testing their sites.)
const char kDisableWebSecurity[] = "disable-web-security";
......
......@@ -79,7 +79,11 @@ CONTENT_EXPORT extern const char kEnableScriptedSpeech[];
extern const char kSpeechRecognitionWebserviceURL[];
extern const char kSpeechRecognitionWebserviceKey[];
CONTENT_EXPORT extern const char kDisableThreadedAnimation[];
#if defined(OS_ANDROID)
CONTENT_EXPORT extern const char kEnableWebAudio[];
#else
CONTENT_EXPORT extern const char kDisableWebAudio[];
#endif
extern const char kDisableWebSecurity[];
extern const char kDisableWebSockets[];
extern const char kDisableXSSAuditor[];
......
......@@ -586,9 +586,15 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
WebKit::WebRuntimeFeatures::enableEncryptedMedia(
command_line.HasSwitch(switches::kEnableEncryptedMedia));
#if defined(OS_ANDROID)
WebRuntimeFeatures::enableWebAudio(
command_line.HasSwitch(switches::kEnableWebAudio) &&
media::IsMediaLibraryInitialized());
#else
WebRuntimeFeatures::enableWebAudio(
!command_line.HasSwitch(switches::kDisableWebAudio) &&
media::IsMediaLibraryInitialized());
#endif
WebRuntimeFeatures::enablePushState(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment