Commit 28172dc3 authored by kov@webkit.org's avatar kov@webkit.org
Browse files

Add API to WebKit-GTK to allow setting localStorage database path

https://bugs.webkit.org/show_bug.cgi?id=62091

Patch by Mike Stegeman  <mrstegeman@gmail.com> on 2011-06-14
Reviewed by Martin Robinson and Gustavo Noronha.

Expose the path of the localStorage databases through a setting
to allow HTML5 localStorage to be persistent. New setting is:
html5-local-storage-database-path

* webkit/webkitwebsettings.cpp:
(webkit_web_settings_class_init):
(webkit_web_settings_set_property):
(webkit_web_settings_get_property):
* webkit/webkitwebsettingsprivate.h:
* webkit/webkitwebview.cpp:
(webkit_web_view_update_settings):
(webkit_web_view_settings_notify):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@90776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e386a238
2011-06-14 Mike Stegeman <mrstegeman@gmail.com>
Add API to WebKit-GTK to allow setting localStorage database path
https://bugs.webkit.org/show_bug.cgi?id=62091
Reviewed by Martin Robinson and Gustavo Noronha.
Expose the path of the localStorage databases through a setting
to allow HTML5 localStorage to be persistent. New setting is:
html5-local-storage-database-path
* webkit/webkitwebsettings.cpp:
(webkit_web_settings_class_init):
(webkit_web_settings_set_property):
(webkit_web_settings_get_property):
* webkit/webkitwebsettingsprivate.h:
* webkit/webkitwebview.cpp:
(webkit_web_view_update_settings):
(webkit_web_view_settings_notify):
2011-07-08 Gustavo Noronha Silva <gustavo.noronha@collabora.com>
 
[GTK] testwebview API test fails after http://trac.webkit.org/changeset/90471
......
......@@ -96,6 +96,7 @@ enum {
PROP_ENABLE_CARET_BROWSING,
PROP_ENABLE_HTML5_DATABASE,
PROP_ENABLE_HTML5_LOCAL_STORAGE,
PROP_HTML5_LOCAL_STORAGE_DATABASE_PATH,
PROP_ENABLE_XSS_AUDITOR,
PROP_ENABLE_SPATIAL_NAVIGATION,
PROP_ENABLE_FRAME_FLATTENING,
......@@ -523,6 +524,22 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
TRUE,
flags));
/**
* WebKitWebSettings:html5-local-storage-database-path:
*
* Path to store persistent HTML5 localStorage databases, which are enabled by
* "enable-html5-local-storage". The default path is $XDG_DATA_HOME/webkit/databases/.
*
* Since: 1.5.2
*/
GOwnPtr<gchar> localStoragePath(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL));
g_object_class_install_property(gobject_class,
PROP_HTML5_LOCAL_STORAGE_DATABASE_PATH,
g_param_spec_string("html5-local-storage-database-path",
_("Local Storage Database Path"),
_("The path to where HTML5 Local Storage databases are stored."),
localStoragePath.get(),
flags));
/**
* WebKitWebSettings:enable-xss-auditor
*
* Whether to enable the XSS Auditor. This feature filters some kinds of
......@@ -988,6 +1005,9 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
case PROP_ENABLE_HTML5_LOCAL_STORAGE:
priv->enableHTML5LocalStorage = g_value_get_boolean(value);
break;
case PROP_HTML5_LOCAL_STORAGE_DATABASE_PATH:
priv->html5LocalStorageDatabasePath = g_value_get_string(value);
break;
case PROP_ENABLE_SPELL_CHECKING:
priv->enableSpellChecking = g_value_get_boolean(value);
break;
......@@ -1147,6 +1167,9 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa
case PROP_ENABLE_HTML5_LOCAL_STORAGE:
g_value_set_boolean(value, priv->enableHTML5LocalStorage);
break;
case PROP_HTML5_LOCAL_STORAGE_DATABASE_PATH:
g_value_set_string(value, priv->html5LocalStorageDatabasePath.data());
break;
case PROP_ENABLE_SPELL_CHECKING:
g_value_set_boolean(value, priv->enableSpellChecking);
break;
......
......@@ -56,6 +56,7 @@ struct _WebKitWebSettingsPrivate {
gboolean enableCaretBrowsing;
gboolean enableHTML5Database;
gboolean enableHTML5LocalStorage;
CString html5LocalStorageDatabasePath;
gboolean enableXSSAuditor;
gboolean enableSpatialNavigation;
gboolean enableFrameFlattening;
......
......@@ -3199,6 +3199,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
coreSettings->setPrivateBrowsingEnabled(settingsPrivate->enablePrivateBrowsing);
coreSettings->setCaretBrowsingEnabled(settingsPrivate->enableCaretBrowsing);
coreSettings->setLocalStorageEnabled(settingsPrivate->enableHTML5LocalStorage);
coreSettings->setLocalStorageDatabasePath(settingsPrivate->html5LocalStorageDatabasePath.data());
coreSettings->setXSSAuditorEnabled(settingsPrivate->enableXSSAuditor);
coreSettings->setSpatialNavigationEnabled(settingsPrivate->enableSpatialNavigation);
coreSettings->setFrameFlatteningEnabled(settingsPrivate->enableFrameFlattening);
......@@ -3307,6 +3308,8 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
#endif
else if (name == g_intern_string("enable-html5-local-storage"))
settings->setLocalStorageEnabled(g_value_get_boolean(&value));
else if (name == g_intern_string("html5-local-storage-database-path"))
settings->setLocalStorageDatabasePath(g_value_get_string(&value));
else if (name == g_intern_string("enable-xss-auditor"))
settings->setXSSAuditorEnabled(g_value_get_boolean(&value));
else if (name == g_intern_string("enable-spatial-navigation"))
......
2011-06-14 Mike Stegeman <mrstegeman@gmail.com>
[GTK] Add API to allow setting local storage database path
https://bugs.webkit.org/show_bug.cgi?id=62091
Reviewed by Martin Robinson and Gustavo Noronha.
Expose the path of the localStorage databases through a setting
to allow HTML5 localStorage to be persistent. New setting is:
html5-local-storage-database-path
* DumpRenderTree/gtk/DumpRenderTree.cpp:
(resetDefaultsToConsistentValues):
2011-07-11 Adam Barth <abarth@webkit.org>
 
garden-o-matic should be able to rebaseline tests
......
......@@ -404,12 +404,14 @@ static void invalidateAnyPreviousWaitToDumpWatchdog()
static void resetDefaultsToConsistentValues()
{
WebKitWebSettings* settings = webkit_web_view_get_settings(webView);
GOwnPtr<gchar> localStoragePath(g_build_filename(g_get_user_data_dir(), "DumpRenderTreeGtk", "databases", NULL));
g_object_set(G_OBJECT(settings),
"enable-private-browsing", FALSE,
"enable-developer-extras", FALSE,
"enable-spell-checking", TRUE,
"enable-html5-database", TRUE,
"enable-html5-local-storage", TRUE,
"html5-local-storage-database-path", localStoragePath.get(),
"enable-xss-auditor", FALSE,
"enable-spatial-navigation", FALSE,
"enable-frame-flattening", FALSE,
......
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