[Webkit-unassigned] [Bug 62091] Add API to WebKit-GTK to allow setting localStorage database path

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 13 21:52:59 PDT 2011


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


Martin Robinson <mrobinson at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #96504|review?                     |review-
               Flag|                            |




--- Comment #8 from Martin Robinson <mrobinson at webkit.org>  2011-06-13 21:52:59 PST ---
(From update of attachment 96504)
View in context: https://bugs.webkit.org/attachment.cgi?id=96504&action=review

> Source/WebKit/gtk/webkit/webkitwebsettings.cpp:594
> +                                    g_strdup(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL)),

Hrm. The issue here is that g_build_filename return a newly-allocated string. Now you've wrapped it in g_strdup which creates another newly allocated string.

Probably what you should do is something like this:

GOwnPtr<gchar> localStoragePath(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL));
g_object_class_install_property(gobject_class,
...etc etc..
                                       localStoragePath.get(),
                                       flags);

> Tools/DumpRenderTree/gtk/DumpRenderTree.cpp:413
> +                 "local-storage-database-path", g_strdup(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL)),

You should probably set this as something like g_build_filename(g_get_user_data_dir(), "DumpRenderTreeGtk", "databases", NULL) to avoid mixing databases with the WebKit installation. Please use the same approach that I mentioned above to avoid the memory leak as well.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list