diff options
author | james.wei@intel.com <james.wei@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-26 04:49:01 +0000 |
---|---|---|
committer | james.wei@intel.com <james.wei@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-26 04:49:01 +0000 |
commit | 634a3bd9cdaee5a340570444e0c4ee4e2961d54f (patch) | |
tree | 01fb8be14d7859f37db97246d355ae0cfa5b255d | |
parent | 729eb631a8da3bc48cc2637e90d06b1c1da624f5 (diff) | |
download | chromium_src-634a3bd9cdaee5a340570444e0c4ee4e2961d54f.zip chromium_src-634a3bd9cdaee5a340570444e0c4ee4e2961d54f.tar.gz chromium_src-634a3bd9cdaee5a340570444e0c4ee4e2961d54f.tar.bz2 |
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
-rw-r--r-- | content/browser/renderer_host/render_process_host_impl.cc | 4 | ||||
-rw-r--r-- | content/browser/web_contents/web_contents_impl.cc | 5 | ||||
-rw-r--r-- | content/public/common/content_switches.cc | 5 | ||||
-rw-r--r-- | content/public/common/content_switches.h | 4 | ||||
-rw-r--r-- | content/renderer/render_thread_impl.cc | 6 |
5 files changed, 24 insertions, 0 deletions
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 0d2c53d..ce1c0c4 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -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, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index edb3fb0..7fd4768 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -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() && diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 6c487b9..039f359 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -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"; diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index f285a7d..aa3aa02 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -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[]; diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 9b5f3d9..a624453 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -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); |