RESOLVED FIXED 70680
[WK2][GTK] Application cache directory is incorrectly set
https://bugs.webkit.org/show_bug.cgi?id=70680
Summary [WK2][GTK] Application cache directory is incorrectly set
Zan Dobersek
Reported 2011-10-22 07:12:08 PDT
In WebProcess::initializeWebProcess the appcache directory of the cache storage is set from the applicationCacheDirectory parameter that is set in WebContext::ensureProcess. Unluckily this parameter holds the return value of WebContext::applicationCacheDirectory() which returns the current cache directory of the cache storage. So it's basically setting an empty string as the directory, which is wrong. In WebKit1 the appcache directory is set to be the same as for the web databases - "g_get_user_data_dir()/webkit/databases". The same should be done in WebKit2.
Attachments
Patch (1.47 KB, patch)
2011-10-22 07:17 PDT, Zan Dobersek
no flags
Now the appcache directory most likely looks something like ~/.cache/webkitgtk/applications (1.58 KB, patch)
2011-11-07 23:05 PST, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2011-10-22 07:17:37 PDT
Philippe Normand
Comment 2 2011-11-02 06:43:00 PDT
Not sure why it's been done like this in WebKit1 but storing application cache data in a databases directory seems odd. Can we use a new directory for this? At least in WebKit2?
Martin Robinson
Comment 3 2011-11-02 09:54:29 PDT
For reference Chromium stores this information for me at ~/.config/chromium/Default/Application Cache.
Zan Dobersek
Comment 4 2011-11-06 23:57:19 PST
(In reply to comment #3) > For reference Chromium stores this information for me at ~/.config/chromium/Default/Application Cache. I then propose for application cache directory path to be constructed this way: > g_build_filename(g_get_user_data_dir(), "webkit", "applicationcache", NULL); Once an agreement is made about which name to use, I'll upload a new patch.
Martin Robinson
Comment 5 2011-11-07 00:00:24 PST
(In reply to comment #4) > (In reply to comment #3) > > For reference Chromium stores this information for me at ~/.config/chromium/Default/Application Cache. > > I then propose for application cache directory path to be constructed this way: > > > g_build_filename(g_get_user_data_dir(), "webkit", "applicationcache", NULL); > > Once an agreement is made about which name to use, I'll upload a new patch. Shouldn't it be something like this? g_build_filename(g_get_user_cache_dir(), "webkitgtk", "applications", NULL); or g_build_filename(g_get_user_cache_dir(), "webkitgtk", "applicationcache", NULL);
Zan Dobersek
Comment 6 2011-11-07 00:11:05 PST
(In reply to comment #5) > (In reply to comment #4) > > (In reply to comment #3) > > > For reference Chromium stores this information for me at ~/.config/chromium/Default/Application Cache. > > > > I then propose for application cache directory path to be constructed this way: > > > > > g_build_filename(g_get_user_data_dir(), "webkit", "applicationcache", NULL); > > > > Once an agreement is made about which name to use, I'll upload a new patch. > > Shouldn't it be something like this? > > g_build_filename(g_get_user_cache_dir(), "webkitgtk", "applications", NULL); > > or > > g_build_filename(g_get_user_cache_dir(), "webkitgtk", "applicationcache", NULL); You're right, this sort of data should be put into user's cache directory. Regarding the name of bottom directory, I'd prefer 'applications' or perhaps nothing, simply putting cached data into ~/.cache/webkitgtk (if application cache is the only cached data). Repeating the word 'cache' in the path is not helpful. Just to note, this again shows just how wrong it is that WebKit1 puts appcache into database directory. If there's interest/need, I can open another bug.
Martin Robinson
Comment 7 2011-11-07 09:05:37 PST
(In reply to comment #6) > Just to note, this again shows just how wrong it is that WebKit1 puts appcache into database directory. If there's interest/need, I can open another bug. Yeah, I thnk we should fix both WebKit1 and WebKit2. The name of top-level directory should be "webkitgtk" too, since we no longer pretend to be the only game in town.
Zan Dobersek
Comment 8 2011-11-07 23:05:39 PST
Created attachment 113995 [details] Now the appcache directory most likely looks something like ~/.cache/webkitgtk/applications
Zan Dobersek
Comment 9 2011-11-07 23:07:28 PST
(In reply to comment #8) > Created an attachment (id=113995) [details] > Now the appcache directory most likely looks something like ~/.cache/webkitgtk/applications Sorry for the long name, mixed up flags when uploading through webkit-patch.
Philippe Normand
Comment 10 2011-11-07 23:58:57 PST
Comment on attachment 113995 [details] Now the appcache directory most likely looks something like ~/.cache/webkitgtk/applications Thanks Zan!
Martin Robinson
Comment 11 2011-11-08 00:05:48 PST
(In reply to comment #10) > (From update of attachment 113995 [details]) > Thanks Zan! Zan do you mind also changing the WebKit2 database directory to relfect the new "webkitgtk" name? I don't think we can in WebKit1, because it's an API break.
WebKit Review Bot
Comment 12 2011-11-08 01:07:44 PST
Comment on attachment 113995 [details] Now the appcache directory most likely looks something like ~/.cache/webkitgtk/applications Clearing flags on attachment: 113995 Committed r99537: <http://trac.webkit.org/changeset/99537>
WebKit Review Bot
Comment 13 2011-11-08 01:07:48 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.