[webkit-reviews] review denied: [Bug 62091] Add API to WebKit-GTK to allow setting localStorage database path : [Attachment 96504] Add API to allow setting local storage database path

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


Martin Robinson <mrobinson at webkit.org> has denied Mike Stegeman
<musicmastamike at gmail.com>'s request for review:
Bug 62091: Add API to WebKit-GTK to allow setting localStorage database path
https://bugs.webkit.org/show_bug.cgi?id=62091

Attachment 96504: Add API to allow setting local storage database path
https://bugs.webkit.org/attachment.cgi?id=96504&action=review

------- Additional Comments from Martin Robinson <mrobinson at webkit.org>
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.


More information about the webkit-reviews mailing list