diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-30 18:35:49 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-30 18:35:49 +0000 |
commit | 8db89020f48b2cba994f7ee48176250dad6e91c7 (patch) | |
tree | 374fb6f5d5960bc7c9d5f4550d7b5d4af3beebc6 | |
parent | 149fd6df098f406fcb8bcabc12c9a8fefda49058 (diff) | |
download | chromium_src-8db89020f48b2cba994f7ee48176250dad6e91c7.zip chromium_src-8db89020f48b2cba994f7ee48176250dad6e91c7.tar.gz chromium_src-8db89020f48b2cba994f7ee48176250dad6e91c7.tar.bz2 |
Added command line argument --enable-webgl to facilitate turning on
ENABLE_3D_CANVAS in development builds. Currently this argument also
requires disabling the sandbox.
BUG=http://crbug.com/21852
TEST=none (runs preexisting WebGL layout tests; more coming)
Review URL: http://codereview.chromium.org/246042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27637 0039d316-1c4b-4281-b951-d872f2087c98
-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 | 2 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 4 | ||||
-rw-r--r-- | webkit/api/public/WebSettings.h | 1 | ||||
-rw-r--r-- | webkit/api/src/WebSettingsImpl.cpp | 5 | ||||
-rw-r--r-- | webkit/api/src/WebSettingsImpl.h | 1 | ||||
-rw-r--r-- | webkit/glue/webpreferences.cc | 4 | ||||
-rw-r--r-- | webkit/glue/webpreferences.h | 5 |
9 files changed, 25 insertions, 2 deletions
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 fad0540..1e0feb4 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -184,6 +184,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs( command_line.HasSwitch(switches::kEnableDatabases); web_prefs.session_storage_enabled = command_line.HasSwitch(switches::kEnableSessionStorage); + web_prefs.experimental_webgl_enabled = + command_line.HasSwitch(switches::kEnableExperimentalWebGL); } web_prefs.uses_universal_detector = diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 72d6a5f..b619517 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -615,4 +615,7 @@ const wchar_t kExplicitlyAllowedPorts[] = L"explicitly-allowed-ports"; // is launched on the command line (e.g. by Selenium). Only needed on Mac. const wchar_t kActivateOnLaunch[] = L"activate-on-launch"; +// Enable experimental WebGL support. +const wchar_t kEnableExperimentalWebGL[] = L"enable-webgl"; + } // namespace switches diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 79b185e..f6cb10d 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -248,6 +248,8 @@ extern const wchar_t kExplicitlyAllowedPorts[]; extern const wchar_t kActivateOnLaunch[]; +extern const wchar_t kEnableExperimentalWebGL[]; + } // namespace switches #endif // CHROME_COMMON_CHROME_SWITCHES_H_ diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 99a4a68..90fd465 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -1650,6 +1650,7 @@ struct ParamTraits<WebPreferences> { WriteParam(m, p.databases_enabled); WriteParam(m, p.session_storage_enabled); WriteParam(m, p.application_cache_enabled); + WriteParam(m, p.experimental_webgl_enabled); } static bool Read(const Message* m, void** iter, param_type* p) { return @@ -1684,7 +1685,8 @@ struct ParamTraits<WebPreferences> { ReadParam(m, iter, &p->local_storage_enabled) && ReadParam(m, iter, &p->databases_enabled) && ReadParam(m, iter, &p->session_storage_enabled) && - ReadParam(m, iter, &p->application_cache_enabled); + ReadParam(m, iter, &p->application_cache_enabled) && + ReadParam(m, iter, &p->experimental_webgl_enabled); } static void Log(const param_type& p, std::wstring* l) { l->append(L"<WebPreferences>"); diff --git a/webkit/api/public/WebSettings.h b/webkit/api/public/WebSettings.h index 166b396..40e10f6 100644 --- a/webkit/api/public/WebSettings.h +++ b/webkit/api/public/WebSettings.h @@ -79,6 +79,7 @@ namespace WebKit { virtual void setAllowUniversalAccessFromFileURLs(bool) = 0; virtual void setTextDirectionSubmenuInclusionBehaviorNeverIncluded() = 0; virtual void setOfflineWebApplicationCacheEnabled(bool) = 0; + virtual void setExperimentalWebGLEnabled(bool) = 0; protected: ~WebSettings() { } diff --git a/webkit/api/src/WebSettingsImpl.cpp b/webkit/api/src/WebSettingsImpl.cpp index 1edda49..dc577e8 100644 --- a/webkit/api/src/WebSettingsImpl.cpp +++ b/webkit/api/src/WebSettingsImpl.cpp @@ -244,4 +244,9 @@ void WebSettingsImpl::setOfflineWebApplicationCacheEnabled(bool enabled) m_settings->setOfflineWebApplicationCacheEnabled(enabled); } +void WebSettingsImpl::setExperimentalWebGLEnabled(bool enabled) +{ + m_settings->setExperimentalWebGLEnabled(enabled); +} + } // namespace WebKit diff --git a/webkit/api/src/WebSettingsImpl.h b/webkit/api/src/WebSettingsImpl.h index b39568e..62eae9c 100644 --- a/webkit/api/src/WebSettingsImpl.h +++ b/webkit/api/src/WebSettingsImpl.h @@ -81,6 +81,7 @@ namespace WebKit { virtual void setAllowUniversalAccessFromFileURLs(bool); virtual void setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); virtual void setOfflineWebApplicationCacheEnabled(bool); + virtual void setExperimentalWebGLEnabled(bool); private: WebCore::Settings* m_settings; diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc index d2d3e4b..eccee6f 100644 --- a/webkit/glue/webpreferences.cc +++ b/webkit/glue/webpreferences.cc @@ -75,6 +75,10 @@ void WebPreferences::Apply(WebView* web_view) const { // but also because it cause a possible crash in Editor::hasBidiSelection(). settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); + // Enable experimental WebGL support if requested on command line + // and support is compiled in. + settings->setExperimentalWebGLEnabled(experimental_webgl_enabled); + // Web inspector settings need to be passed in differently. web_view->SetInspectorSettings(inspector_settings); diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index 1b14dc8..c626e27 100644 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -57,6 +57,8 @@ struct WebPreferences { bool allow_universal_access_from_file_urls; + bool experimental_webgl_enabled; + // We try to keep the default values the same as the default values in // chrome, except for the cases where it would require lots of extra work for // the embedder to use the same default value. @@ -94,7 +96,8 @@ struct WebPreferences { application_cache_enabled(false), tabs_to_links(true), user_style_sheet_enabled(false), - allow_universal_access_from_file_urls(false) { + allow_universal_access_from_file_urls(false), + experimental_webgl_enabled(false) { } void Apply(WebView* web_view) const; |