Changeset 90776 in webkit


Ignore:
Timestamp:
Jul 11, 2011 12:10:40 PM (13 years ago)
Author:
kov@webkit.org
Message:

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):

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/gtk/ChangeLog

    r90627 r90776  
     12011-06-14  Mike Stegeman  <mrstegeman@gmail.com>
     2
     3        Add API to WebKit-GTK to allow setting localStorage database path
     4        https://bugs.webkit.org/show_bug.cgi?id=62091
     5
     6        Reviewed by Martin Robinson and Gustavo Noronha.
     7
     8        Expose the path of the localStorage databases through a setting
     9        to allow HTML5 localStorage to be persistent. New setting is:
     10        html5-local-storage-database-path
     11
     12        * webkit/webkitwebsettings.cpp:
     13        (webkit_web_settings_class_init):
     14        (webkit_web_settings_set_property):
     15        (webkit_web_settings_get_property):
     16        * webkit/webkitwebsettingsprivate.h:
     17        * webkit/webkitwebview.cpp:
     18        (webkit_web_view_update_settings):
     19        (webkit_web_view_settings_notify):
     20
    1212011-07-08  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
    222
  • trunk/Source/WebKit/gtk/webkit/webkitwebsettings.cpp

    r89288 r90776  
    9797    PROP_ENABLE_HTML5_DATABASE,
    9898    PROP_ENABLE_HTML5_LOCAL_STORAGE,
     99    PROP_HTML5_LOCAL_STORAGE_DATABASE_PATH,
    99100    PROP_ENABLE_XSS_AUDITOR,
    100101    PROP_ENABLE_SPATIAL_NAVIGATION,
     
    524525                                                         flags));
    525526    /**
     527    * WebKitWebSettings:html5-local-storage-database-path:
     528    *
     529    * Path to store persistent HTML5 localStorage databases, which are enabled by
     530    * "enable-html5-local-storage". The default path is $XDG_DATA_HOME/webkit/databases/.
     531    *
     532    * Since: 1.5.2
     533    */
     534    GOwnPtr<gchar> localStoragePath(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL));
     535    g_object_class_install_property(gobject_class,
     536                                    PROP_HTML5_LOCAL_STORAGE_DATABASE_PATH,
     537                                    g_param_spec_string("html5-local-storage-database-path",
     538                                                        _("Local Storage Database Path"),
     539                                                        _("The path to where HTML5 Local Storage databases are stored."),
     540                                                        localStoragePath.get(),
     541                                                        flags));
     542    /**
    526543    * WebKitWebSettings:enable-xss-auditor
    527544    *
     
    9891006        priv->enableHTML5LocalStorage = g_value_get_boolean(value);
    9901007        break;
     1008    case PROP_HTML5_LOCAL_STORAGE_DATABASE_PATH:
     1009        priv->html5LocalStorageDatabasePath = g_value_get_string(value);
     1010        break;
    9911011    case PROP_ENABLE_SPELL_CHECKING:
    9921012        priv->enableSpellChecking = g_value_get_boolean(value);
     
    11471167    case PROP_ENABLE_HTML5_LOCAL_STORAGE:
    11481168        g_value_set_boolean(value, priv->enableHTML5LocalStorage);
     1169        break;
     1170    case PROP_HTML5_LOCAL_STORAGE_DATABASE_PATH:
     1171        g_value_set_string(value, priv->html5LocalStorageDatabasePath.data());
    11491172        break;
    11501173    case PROP_ENABLE_SPELL_CHECKING:
  • trunk/Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h

    r89282 r90776  
    5757    gboolean enableHTML5Database;
    5858    gboolean enableHTML5LocalStorage;
     59    CString html5LocalStorageDatabasePath;
    5960    gboolean enableXSSAuditor;
    6061    gboolean enableSpatialNavigation;
  • trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp

    r90240 r90776  
    32003200    coreSettings->setCaretBrowsingEnabled(settingsPrivate->enableCaretBrowsing);
    32013201    coreSettings->setLocalStorageEnabled(settingsPrivate->enableHTML5LocalStorage);
     3202    coreSettings->setLocalStorageDatabasePath(settingsPrivate->html5LocalStorageDatabasePath.data());
    32023203    coreSettings->setXSSAuditorEnabled(settingsPrivate->enableXSSAuditor);
    32033204    coreSettings->setSpatialNavigationEnabled(settingsPrivate->enableSpatialNavigation);
     
    33083309    else if (name == g_intern_string("enable-html5-local-storage"))
    33093310        settings->setLocalStorageEnabled(g_value_get_boolean(&value));
     3311    else if (name == g_intern_string("html5-local-storage-database-path"))
     3312        settings->setLocalStorageDatabasePath(g_value_get_string(&value));
    33103313    else if (name == g_intern_string("enable-xss-auditor"))
    33113314        settings->setXSSAuditorEnabled(g_value_get_boolean(&value));
  • trunk/Tools/ChangeLog

    r90774 r90776  
     12011-06-14  Mike Stegeman  <mrstegeman@gmail.com>
     2
     3        [GTK] Add API to allow setting local storage database path
     4        https://bugs.webkit.org/show_bug.cgi?id=62091
     5
     6        Reviewed by Martin Robinson and Gustavo Noronha.
     7
     8        Expose the path of the localStorage databases through a setting
     9        to allow HTML5 localStorage to be persistent. New setting is:
     10        html5-local-storage-database-path
     11
     12        * DumpRenderTree/gtk/DumpRenderTree.cpp:
     13        (resetDefaultsToConsistentValues):
     14
    1152011-07-11  Adam Barth  <abarth@webkit.org>
    216
  • trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp

    r88066 r90776  
    405405{
    406406    WebKitWebSettings* settings = webkit_web_view_get_settings(webView);
     407    GOwnPtr<gchar> localStoragePath(g_build_filename(g_get_user_data_dir(), "DumpRenderTreeGtk", "databases", NULL));
    407408    g_object_set(G_OBJECT(settings),
    408409                 "enable-private-browsing", FALSE,
     
    411412                 "enable-html5-database", TRUE,
    412413                 "enable-html5-local-storage", TRUE,
     414                 "html5-local-storage-database-path", localStoragePath.get(),
    413415                 "enable-xss-auditor", FALSE,
    414416                 "enable-spatial-navigation", FALSE,
Note: See TracChangeset for help on using the changeset viewer.