diff options
-rw-r--r-- | chrome/app/generated_resources.grd | 6 | ||||
-rw-r--r-- | chrome/browser/about_flags.cc | 7 | ||||
-rw-r--r-- | chrome/browser/tab_contents/render_view_host_delegate_helper.cc | 2 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/common/render_messages.cc | 2 | ||||
-rw-r--r-- | chrome/renderer/render_thread.cc | 5 | ||||
-rw-r--r-- | webkit/glue/webpreferences.cc | 6 | ||||
-rw-r--r-- | webkit/glue/webpreferences.h | 1 |
9 files changed, 33 insertions, 0 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 2d266fc..77974ee 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -4009,6 +4009,12 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_FLAGS_ACCELERATED_CANVAS_2D_DESCRIPTION" desc="Description of the 'GPU Accelerated Canvas 2D' lab."> Enables higher performance of canvas tags with a 2D context by rendering using Graphics Processor Unit (GPU) hardware. </message> + <message name="IDS_FLAGS_WEBAUDIO_NAME" desc="Name of the 'Web Audio' lab."> + Web Audio + </message> + <message name="IDS_FLAGS_WEBAUDIO_DESCRIPTION" desc="Description of the 'Web Audio' lab."> + Enables the Web Audio API. + </message> <message name="IDS_FLAGS_WEBGL_NAME" desc="Name of the 'WebGL' lab."> WebGL </message> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index c48dbe4..02ce05d 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -272,6 +272,13 @@ const Experiment kExperiments[] = { SINGLE_VALUE_TYPE(switches::kBlockReadingThirdPartyCookies) }, { + "webaudio", + IDS_FLAGS_WEBAUDIO_NAME, + IDS_FLAGS_WEBAUDIO_DESCRIPTION, + kOsMac, // TODO(crogers): add windows and linux when FFT is ready. + SINGLE_VALUE_TYPE(switches::kEnableWebAudio) + }, + { "disable-interactive-form-validation", IDS_FLAGS_DISABLE_INTERACTIVE_FORM_VALIDATION_NAME, IDS_FLAGS_DISABLE_INTERACTIVE_FORM_VALIDATION_DESCRIPTION, diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc index 606afa7..1b95254 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -273,6 +273,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs( !command_line.HasSwitch(switches::kDisableLocalStorage); web_prefs.databases_enabled = !command_line.HasSwitch(switches::kDisableDatabases); + web_prefs.webaudio_enabled = + command_line.HasSwitch(switches::kEnableWebAudio); web_prefs.experimental_webgl_enabled = gpu_enabled() && !command_line.HasSwitch(switches::kDisable3DAPIs) && diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index f781baf..5f8fbfd 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -613,6 +613,9 @@ const char kEnableVideoLogging[] = "enable-video-logging"; // Order of the listed sub-arguments does not matter. const char kEnableWatchdog[] = "enable-watchdog"; +// Enable web audio API. +const char kEnableWebAudio[] = "enable-webaudio"; + // Disable WebKit's XSSAuditor. The XSSAuditor mitigates reflective XSS. const char kEnableXSSAuditor[] = "enable-xss-auditor"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index aa9c42d..983a8a7 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -182,6 +182,7 @@ extern const char kEnableVerticalTabs[]; extern const char kEnableVideoFullscreen[]; extern const char kEnableVideoLogging[]; extern const char kEnableWatchdog[]; +extern const char kEnableWebAudio[]; extern const char kEnableXSSAuditor[]; // Experimental features. extern const char kExperimentalLocationFeatures[]; diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc index eaf1504..a49ea2e 100644 --- a/chrome/common/render_messages.cc +++ b/chrome/common/render_messages.cc @@ -723,6 +723,7 @@ void ParamTraits<WebPreferences>::Write(Message* m, const param_type& p) { WriteParam(m, p.frame_flattening_enabled); WriteParam(m, p.allow_universal_access_from_file_urls); WriteParam(m, p.allow_file_access_from_file_urls); + WriteParam(m, p.webaudio_enabled); WriteParam(m, p.experimental_webgl_enabled); WriteParam(m, p.show_composited_layer_borders); WriteParam(m, p.accelerated_compositing_enabled); @@ -777,6 +778,7 @@ bool ParamTraits<WebPreferences>::Read(const Message* m, void** iter, ReadParam(m, iter, &p->frame_flattening_enabled) && ReadParam(m, iter, &p->allow_universal_access_from_file_urls) && ReadParam(m, iter, &p->allow_file_access_from_file_urls) && + ReadParam(m, iter, &p->webaudio_enabled) && ReadParam(m, iter, &p->experimental_webgl_enabled) && ReadParam(m, iter, &p->show_composited_layer_borders) && ReadParam(m, iter, &p->accelerated_compositing_enabled) && diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index 92110a5..cb78d4f 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -937,6 +937,11 @@ void RenderThread::EnsureWebKitInitialized() { WebRuntimeFeatures::enableGeolocation( !command_line.HasSwitch(switches::kDisableGeolocation)); +#ifdef HAS_WEBAUDIO_RUNTIMEFEATURES + WebRuntimeFeatures::enableWebAudio( + command_line.HasSwitch(switches::kEnableWebAudio)); +#endif + WebRuntimeFeatures::enableWebGL( !command_line.HasSwitch(switches::kDisable3DAPIs) && !command_line.HasSwitch(switches::kDisableExperimentalWebGL)); diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc index de2fc07..cc4efef 100644 --- a/webkit/glue/webpreferences.cc +++ b/webkit/glue/webpreferences.cc @@ -60,6 +60,7 @@ WebPreferences::WebPreferences() frame_flattening_enabled(false), allow_universal_access_from_file_urls(false), allow_file_access_from_file_urls(false), + webaudio_enabled(false), experimental_webgl_enabled(false), show_composited_layer_borders(false), accelerated_compositing_enabled(false), @@ -142,6 +143,11 @@ void WebPreferences::Apply(WebView* web_view) const { // but also because it cause a possible crash in Editor::hasBidiSelection(). settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); +#ifdef HAS_WEBAUDIO_FEATURE_ENABLE + // Enable the web audio API if requested on the command line. + settings->setWebAudioEnabled(webaudio_enabled); +#endif // HAS_WEBAUDIO_FEATURE_ENABLE + // Enable experimental WebGL support if requested on command line // and support is compiled in. bool enable_webgl = diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index 63c95c8..3943af1 100644 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -66,6 +66,7 @@ struct WebPreferences { bool frame_flattening_enabled; bool allow_universal_access_from_file_urls; bool allow_file_access_from_file_urls; + bool webaudio_enabled; bool experimental_webgl_enabled; bool show_composited_layer_borders; bool accelerated_compositing_enabled; |