RESOLVED FIXED Bug 123458
[GTK] Put cache files in XDG_CACHE_HOME
https://bugs.webkit.org/show_bug.cgi?id=123458
Summary [GTK] Put cache files in XDG_CACHE_HOME
Emilio Pozuelo Monfort
Reported 2013-10-29 12:41:47 PDT
It looks like webkit is placing some cache in ~/.local/share/webkit ($XDG_DATA_HOME). That should probably go in ~/.cache/webkit ($XDG_CACHE_HOME)
Attachments
Patch (4.99 KB, patch)
2013-12-12 01:41 PST, Enrique Ocaña
no flags
Patch (5.02 KB, patch)
2013-12-19 10:46 PST, Enrique Ocaña
no flags
Patch (4.80 KB, patch)
2013-12-20 01:24 PST, Enrique Ocaña
no flags
Patch (4.79 KB, patch)
2014-01-17 11:43 PST, Enrique Ocaña
no flags
Patch (4.78 KB, patch)
2014-01-24 11:06 PST, Enrique Ocaña
no flags
Enrique Ocaña
Comment 1 2013-12-12 00:39:11 PST
There are three places where XDG env vars are used: WebKit/gtk/webkit/webkitapplicationcache.cpp: * $XDG_CACHE_HOME/webkitgtk/applications and cannot be modified. WebKit/gtk/webkit/webkiticondatabase.cpp: * ~/.local/share/webkit/icondatabase, depending on XDG_DATA_HOME. WebKit/gtk/webkit/webkitwebsettings.cpp: * "enable-html5-local-storage". The default path is $XDG_DATA_HOME/webkit/databases/. The icon database can be considered "cache". The HTML5 local storage can't, and sould remain where it is by default. However, it can be changed by the application via the "html5-local-storage-database-path" property in WebKitWebSettings. I'm going to prepare a patch to change the icon database path.
Enrique Ocaña
Comment 2 2013-12-12 01:41:32 PST
Enrique Ocaña
Comment 3 2013-12-12 01:47:54 PST
BTW, found more places where XDG_DATA_HOME is used, but they seem to be persistent data that shouldn't be moved to cache: $ git grep g_get_user_data_dir Source/WebKit/gtk/webkit/webkitglobals.cpp: GOwnPtr<gchar> databaseDirectory(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL)); Source/WebKit/gtk/webkit/webkitglobals.cpp: GOwnPtr<gchar> iconDatabasePath(g_build_filename(g_get_user_data_dir(), "webkit", "icondatabase", NULL)); Source/WebKit/gtk/webkit/webkitwebsettings.cpp: GOwnPtr<gchar> localStoragePath(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL)); Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp: * default directory for the platform (see g_get_user_data_dir()). Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp: GOwnPtr<gchar> databaseDirectory(g_build_filename(g_get_user_data_dir(), "webkitgtk", "databases", NULL)); Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp: GOwnPtr<gchar> databaseDirectory(g_build_filename(g_get_user_data_dir(), "webkitgtk", "icondatabase", NULL)); Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp: GOwnPtr<gchar> storageDirectory(g_build_filename(g_get_user_data_dir(), "webkitgtk", "localstorage", NULL)); Tools/DumpRenderTree/gtk/DumpRenderTree.cpp: GOwnPtr<gchar> localStoragePath(g_build_filename(g_get_user_data_dir(), "DumpRenderTreeGtk", "databases", NULL)); Tools/DumpRenderTree/gtk/DumpRenderTree.cpp: GOwnPtr<char> fallback(g_build_filename(g_get_user_data_dir(), "gtkwebkitdrt", "databases", NULL)); Tools/GtkLauncher/main.c: iconDatabasePath = g_build_filename(g_get_user_data_dir(), "webkit", "icondatabase", NULL);
Enrique Ocaña
Comment 4 2013-12-19 10:46:51 PST
Sergio Villar Senin
Comment 5 2013-12-20 00:07:26 PST
Comment on attachment 219658 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=219658&action=review The change looks good to me. > Source/WebKit/gtk/ChangeLog:10 > + The format of the ChangeLog is not correct. You have to use Tools/Scripts/prepare-Changelog to properly generate it. > Source/WebKit2/ChangeLog:9 > + Ditto. > Tools/ChangeLog:9 > + Ditto.
Enrique Ocaña
Comment 6 2013-12-20 01:23:35 PST
Thanks. The inclusion of the git log message confused me.
Enrique Ocaña
Comment 7 2013-12-20 01:24:04 PST
Martin Robinson
Comment 8 2013-12-20 11:13:25 PST
Comment on attachment 219740 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=219740&action=review Looks good, but a few small suggestions before landing this. You can just upload a new version with the Reviewed by line filled in and then I can commit it with the commit queue. > Source/WebKit/gtk/ChangeLog:3 > + https://bugs.webkit.org/show_bug.cgi?id=123458 This changelog is missing a newline. > Source/WebKit2/ChangeLog:3 > + [GTK] Put cache files in XDG_CACHE_HOME > + https://bugs.webkit.org/show_bug.cgi?id=123458 This one too. > Tools/GtkLauncher/main.c:242 > - iconDatabasePath = g_build_filename(g_get_user_data_dir(), "webkit", "icondatabase", NULL); > + iconDatabasePath = g_build_filename(g_get_user_cache_dir(), "webkit", "icondatabase", NULL); It's probably a good moment to actually put this into a GtkLauncher subdirectory instead of "webkit"
Enrique Ocaña
Comment 9 2014-01-17 11:43:52 PST
WebKit Commit Bot
Comment 10 2014-01-24 08:23:34 PST
Comment on attachment 221479 [details] Patch Rejecting attachment 221479 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-03', 'apply-attachment', '--no-update', '--non-interactive', 221479, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit Last 500 characters of output: t/webkitglobals.cpp.rej patching file Source/WebKit/gtk/webkit/webkiticondatabase.cpp patching file Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp Hunk #1 FAILED at 122. 1 out of 1 hunk FAILED -- saving rejects to file Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp.rej patching file Tools/ChangeLog Hunk #1 succeeded at 1 with fuzz 3. patching file Tools/GtkLauncher/main.c Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit Full output: http://webkit-queues.appspot.com/results/6529999087599616
Enrique Ocaña
Comment 11 2014-01-24 11:06:53 PST
WebKit Commit Bot
Comment 12 2014-01-24 12:01:54 PST
Comment on attachment 222120 [details] Patch Clearing flags on attachment: 222120 Committed r162714: <http://trac.webkit.org/changeset/162714>
WebKit Commit Bot
Comment 13 2014-01-24 12:01:57 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.