Commit a4f4692c authored by crogers@google.com's avatar crogers@google.com

Add run-time enable support for the web audio API

BUG=none
TEST=none
(tested locally on Mac OS X to verify about:flags shows the web audio feature and that it can be enabled/disabled)
Review URL: http://codereview.chromium.org/6339004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72261 0039d316-1c4b-4281-b951-d872f2087c98
parent 972131b4
...@@ -4009,6 +4009,12 @@ Keep your key file in a safe place. You will need it to create new versions of y ...@@ -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."> <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. Enables higher performance of canvas tags with a 2D context by rendering using Graphics Processor Unit (GPU) hardware.
</message> </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."> <message name="IDS_FLAGS_WEBGL_NAME" desc="Name of the 'WebGL' lab.">
WebGL WebGL
</message> </message>
......
...@@ -271,6 +271,13 @@ const Experiment kExperiments[] = { ...@@ -271,6 +271,13 @@ const Experiment kExperiments[] = {
kOsAll, kOsAll,
SINGLE_VALUE_TYPE(switches::kBlockReadingThirdPartyCookies) 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", "disable-interactive-form-validation",
IDS_FLAGS_DISABLE_INTERACTIVE_FORM_VALIDATION_NAME, IDS_FLAGS_DISABLE_INTERACTIVE_FORM_VALIDATION_NAME,
......
...@@ -273,6 +273,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs( ...@@ -273,6 +273,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
!command_line.HasSwitch(switches::kDisableLocalStorage); !command_line.HasSwitch(switches::kDisableLocalStorage);
web_prefs.databases_enabled = web_prefs.databases_enabled =
!command_line.HasSwitch(switches::kDisableDatabases); !command_line.HasSwitch(switches::kDisableDatabases);
web_prefs.webaudio_enabled =
command_line.HasSwitch(switches::kEnableWebAudio);
web_prefs.experimental_webgl_enabled = web_prefs.experimental_webgl_enabled =
gpu_enabled() && gpu_enabled() &&
!command_line.HasSwitch(switches::kDisable3DAPIs) && !command_line.HasSwitch(switches::kDisable3DAPIs) &&
......
...@@ -613,6 +613,9 @@ const char kEnableVideoLogging[] = "enable-video-logging"; ...@@ -613,6 +613,9 @@ const char kEnableVideoLogging[] = "enable-video-logging";
// Order of the listed sub-arguments does not matter. // Order of the listed sub-arguments does not matter.
const char kEnableWatchdog[] = "enable-watchdog"; const char kEnableWatchdog[] = "enable-watchdog";
// Enable web audio API.
const char kEnableWebAudio[] = "enable-webaudio";
// Disable WebKit's XSSAuditor. The XSSAuditor mitigates reflective XSS. // Disable WebKit's XSSAuditor. The XSSAuditor mitigates reflective XSS.
const char kEnableXSSAuditor[] = "enable-xss-auditor"; const char kEnableXSSAuditor[] = "enable-xss-auditor";
......
...@@ -182,6 +182,7 @@ extern const char kEnableVerticalTabs[]; ...@@ -182,6 +182,7 @@ extern const char kEnableVerticalTabs[];
extern const char kEnableVideoFullscreen[]; extern const char kEnableVideoFullscreen[];
extern const char kEnableVideoLogging[]; extern const char kEnableVideoLogging[];
extern const char kEnableWatchdog[]; extern const char kEnableWatchdog[];
extern const char kEnableWebAudio[];
extern const char kEnableXSSAuditor[]; extern const char kEnableXSSAuditor[];
// Experimental features. // Experimental features.
extern const char kExperimentalLocationFeatures[]; extern const char kExperimentalLocationFeatures[];
......
...@@ -723,6 +723,7 @@ void ParamTraits<WebPreferences>::Write(Message* m, const param_type& p) { ...@@ -723,6 +723,7 @@ void ParamTraits<WebPreferences>::Write(Message* m, const param_type& p) {
WriteParam(m, p.frame_flattening_enabled); WriteParam(m, p.frame_flattening_enabled);
WriteParam(m, p.allow_universal_access_from_file_urls); WriteParam(m, p.allow_universal_access_from_file_urls);
WriteParam(m, p.allow_file_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.experimental_webgl_enabled);
WriteParam(m, p.show_composited_layer_borders); WriteParam(m, p.show_composited_layer_borders);
WriteParam(m, p.accelerated_compositing_enabled); WriteParam(m, p.accelerated_compositing_enabled);
...@@ -777,6 +778,7 @@ bool ParamTraits<WebPreferences>::Read(const Message* m, void** iter, ...@@ -777,6 +778,7 @@ bool ParamTraits<WebPreferences>::Read(const Message* m, void** iter,
ReadParam(m, iter, &p->frame_flattening_enabled) && ReadParam(m, iter, &p->frame_flattening_enabled) &&
ReadParam(m, iter, &p->allow_universal_access_from_file_urls) && ReadParam(m, iter, &p->allow_universal_access_from_file_urls) &&
ReadParam(m, iter, &p->allow_file_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->experimental_webgl_enabled) &&
ReadParam(m, iter, &p->show_composited_layer_borders) && ReadParam(m, iter, &p->show_composited_layer_borders) &&
ReadParam(m, iter, &p->accelerated_compositing_enabled) && ReadParam(m, iter, &p->accelerated_compositing_enabled) &&
......
...@@ -937,6 +937,11 @@ void RenderThread::EnsureWebKitInitialized() { ...@@ -937,6 +937,11 @@ void RenderThread::EnsureWebKitInitialized() {
WebRuntimeFeatures::enableGeolocation( WebRuntimeFeatures::enableGeolocation(
!command_line.HasSwitch(switches::kDisableGeolocation)); !command_line.HasSwitch(switches::kDisableGeolocation));
#ifdef HAS_WEBAUDIO_RUNTIMEFEATURES
WebRuntimeFeatures::enableWebAudio(
command_line.HasSwitch(switches::kEnableWebAudio));
#endif
WebRuntimeFeatures::enableWebGL( WebRuntimeFeatures::enableWebGL(
!command_line.HasSwitch(switches::kDisable3DAPIs) && !command_line.HasSwitch(switches::kDisable3DAPIs) &&
!command_line.HasSwitch(switches::kDisableExperimentalWebGL)); !command_line.HasSwitch(switches::kDisableExperimentalWebGL));
......
...@@ -60,6 +60,7 @@ WebPreferences::WebPreferences() ...@@ -60,6 +60,7 @@ WebPreferences::WebPreferences()
frame_flattening_enabled(false), frame_flattening_enabled(false),
allow_universal_access_from_file_urls(false), allow_universal_access_from_file_urls(false),
allow_file_access_from_file_urls(false), allow_file_access_from_file_urls(false),
webaudio_enabled(false),
experimental_webgl_enabled(false), experimental_webgl_enabled(false),
show_composited_layer_borders(false), show_composited_layer_borders(false),
accelerated_compositing_enabled(false), accelerated_compositing_enabled(false),
...@@ -142,6 +143,11 @@ void WebPreferences::Apply(WebView* web_view) const { ...@@ -142,6 +143,11 @@ void WebPreferences::Apply(WebView* web_view) const {
// but also because it cause a possible crash in Editor::hasBidiSelection(). // but also because it cause a possible crash in Editor::hasBidiSelection().
settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); 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 // Enable experimental WebGL support if requested on command line
// and support is compiled in. // and support is compiled in.
bool enable_webgl = bool enable_webgl =
......
...@@ -66,6 +66,7 @@ struct WebPreferences { ...@@ -66,6 +66,7 @@ struct WebPreferences {
bool frame_flattening_enabled; bool frame_flattening_enabled;
bool allow_universal_access_from_file_urls; bool allow_universal_access_from_file_urls;
bool allow_file_access_from_file_urls; bool allow_file_access_from_file_urls;
bool webaudio_enabled;
bool experimental_webgl_enabled; bool experimental_webgl_enabled;
bool show_composited_layer_borders; bool show_composited_layer_borders;
bool accelerated_compositing_enabled; bool accelerated_compositing_enabled;
......
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