diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 01:24:43 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 01:24:43 +0000 |
commit | 8073e13e15825a137b7b6593364019dbf5edde42 (patch) | |
tree | 4dda49d4cb1632aa40c026b18a29d3fc79338a63 /webkit | |
parent | 81eb08ea33f10e2704b45834c3a5799c5ab31933 (diff) | |
download | chromium_src-8073e13e15825a137b7b6593364019dbf5edde42.zip chromium_src-8073e13e15825a137b7b6593364019dbf5edde42.tar.gz chromium_src-8073e13e15825a137b7b6593364019dbf5edde42.tar.bz2 |
Switch over to the new way of enabling/disabling session/local storage.
BUG=none
TEST=|'localStorage' in window| should only be true iff --enable-local-storage
is specified
Review URL: http://codereview.chromium.org/293032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29747 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/api/public/WebKit.h | 4 | ||||
-rw-r--r-- | webkit/api/public/WebSettings.h | 1 | ||||
-rw-r--r-- | webkit/api/src/WebKit.cpp | 15 | ||||
-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 | 1 | ||||
-rw-r--r-- | webkit/glue/webpreferences.h | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 1 |
8 files changed, 19 insertions, 11 deletions
diff --git a/webkit/api/public/WebKit.h b/webkit/api/public/WebKit.h index cf2cea1..445e2a5 100644 --- a/webkit/api/public/WebKit.h +++ b/webkit/api/public/WebKit.h @@ -87,6 +87,10 @@ namespace WebKit { WEBKIT_API void enableWebSockets(); WEBKIT_API bool webSocketsEnabled(); + // Enables HTML5 DOM Storage support. + WEBKIT_API void setLocalStorageEnabled(bool enabled); + WEBKIT_API void setSessionStorageEnabled(bool enabled); + } // namespace WebKit #endif diff --git a/webkit/api/public/WebSettings.h b/webkit/api/public/WebSettings.h index ab6dbd2..ecbeda6 100644 --- a/webkit/api/public/WebSettings.h +++ b/webkit/api/public/WebSettings.h @@ -71,7 +71,6 @@ namespace WebKit { virtual void setDownloadableBinaryFontsEnabled(bool) = 0; virtual void setXSSAuditorEnabled(bool) = 0; virtual void setLocalStorageEnabled(bool) = 0; - virtual void setSessionStorageEnabled(bool) = 0; virtual void setEditableLinkBehaviorNeverLive() = 0; virtual void setFontRenderingModeNormal() = 0; virtual void setShouldPaintCustomScrollbars(bool) = 0; diff --git a/webkit/api/src/WebKit.cpp b/webkit/api/src/WebKit.cpp index c0ea7a3..915031c 100644 --- a/webkit/api/src/WebKit.cpp +++ b/webkit/api/src/WebKit.cpp @@ -39,6 +39,7 @@ #include "FrameLoader.h" #include "Page.h" #include "SecurityOrigin.h" +#include "Storage.h" #include "TextEncoding.h" #include "WebSocket.h" #include "WorkerContextExecutionProxy.h" @@ -162,4 +163,18 @@ bool webSocketsEnabled() #endif } +void setLocalStorageEnabled(bool enabled) +{ +#if ENABLE(DOM_STORAGE) + WebCore::Storage::setLocalStorageAvailable(enabled); +#endif +} + +void setSessionStorageEnabled(bool enabled) +{ +#if ENABLE(DOM_STORAGE) + WebCore::Storage::setSessionStorageAvailable(enabled); +#endif +} + } // namespace WebKit diff --git a/webkit/api/src/WebSettingsImpl.cpp b/webkit/api/src/WebSettingsImpl.cpp index c74c16f..a193871d 100644 --- a/webkit/api/src/WebSettingsImpl.cpp +++ b/webkit/api/src/WebSettingsImpl.cpp @@ -195,11 +195,6 @@ void WebSettingsImpl::setLocalStorageEnabled(bool enabled) m_settings->setLocalStorageEnabled(enabled); } -void WebSettingsImpl::setSessionStorageEnabled(bool enabled) -{ - m_settings->setSessionStorageEnabled(enabled); -} - void WebSettingsImpl::setEditableLinkBehaviorNeverLive() { // FIXME: If you ever need more behaviors than this, then we should probably diff --git a/webkit/api/src/WebSettingsImpl.h b/webkit/api/src/WebSettingsImpl.h index cd56497..0fd6c3f 100644 --- a/webkit/api/src/WebSettingsImpl.h +++ b/webkit/api/src/WebSettingsImpl.h @@ -73,7 +73,6 @@ namespace WebKit { virtual void setDownloadableBinaryFontsEnabled(bool); virtual void setXSSAuditorEnabled(bool); virtual void setLocalStorageEnabled(bool); - virtual void setSessionStorageEnabled(bool); virtual void setEditableLinkBehaviorNeverLive(); virtual void setFontRenderingModeNormal(); virtual void setShouldPaintCustomScrollbars(bool); diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc index cdb7260..a2a2b71 100644 --- a/webkit/glue/webpreferences.cc +++ b/webkit/glue/webpreferences.cc @@ -51,7 +51,6 @@ void WebPreferences::Apply(WebView* web_view) const { settings->setXSSAuditorEnabled(xss_auditor_enabled); settings->setLocalStorageEnabled(local_storage_enabled); settings->setDatabasesEnabled(WebKit::databasesEnabled() || databases_enabled); - settings->setSessionStorageEnabled(session_storage_enabled); settings->setOfflineWebApplicationCacheEnabled(application_cache_enabled); settings->setExperimentalNotificationsEnabled( experimental_notifications_enabled); diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index 0693fb9..13a8c7b3 100644 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -48,7 +48,6 @@ struct WebPreferences { bool xss_auditor_enabled; bool local_storage_enabled; bool databases_enabled; - bool session_storage_enabled; bool application_cache_enabled; bool tabs_to_links; @@ -94,7 +93,6 @@ struct WebPreferences { xss_auditor_enabled(false), local_storage_enabled(false), databases_enabled(false), - session_storage_enabled(false), application_cache_enabled(false), tabs_to_links(true), user_style_sheet_enabled(false), diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 5c28287..4fb5e82 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -425,7 +425,6 @@ void TestShell::ResetWebPreferences() { // lose the coverage of dynamic font tests in webkit test. web_prefs_->remote_fonts_enabled = true; web_prefs_->local_storage_enabled = true; - web_prefs_->session_storage_enabled = true; web_prefs_->application_cache_enabled = true; web_prefs_->databases_enabled = true; // LayoutTests were written with Safari Mac in mind which does not allow |