Bug 144251 - [SOUP] Use xattrs to get/set the creation time of disk cache files
Summary: [SOUP] Use xattrs to get/set the creation time of disk cache files
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk, Soup
Depends on:
Blocks: 142821
  Show dependency treegraph
 
Reported: 2015-04-27 01:16 PDT by Carlos Garcia Campos
Modified: 2015-04-28 23:19 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.45 KB, patch)
2015-04-27 01:20 PDT, Carlos Garcia Campos
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2015-04-27 01:16:39 PDT
The network process disk cache uses the creation time to compute a worth value used to determine the order in which cached resources are deleted when the cache is shrunk. In some operating systems like Linux there's no st_birthtime in struct stat, but since cache files are always created and deleted by us, we could use a custom xattr to store and retrieve the creation time of cached resources.
Comment 1 Carlos Garcia Campos 2015-04-27 01:20:04 PDT
Created attachment 251727 [details]
Patch
Comment 2 Martin Robinson 2015-04-27 07:39:33 PDT
Comment on attachment 251727 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=251727&action=review

> Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h:86
> +#if USE(SOUP)

The correct guard here is probably #elif USE(SOUP) && OS(LINUX) unless g_file_query allows xattrs to work properly on Windows.
Comment 3 Carlos Garcia Campos 2015-04-27 09:05:15 PDT
(In reply to comment #2)
> Comment on attachment 251727 [details]
> Patch

Thanks for the review.

> View in context:
> https://bugs.webkit.org/attachment.cgi?id=251727&action=review
> 
> > Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h:86
> > +#if USE(SOUP)
> 
> The correct guard here is probably #elif USE(SOUP) && OS(LINUX) unless
> g_file_query allows xattrs to work properly on Windows.

This is in a file called NetworkCacheFileSystemPosix.h in WebKit2 subdir, so no windows support at all.
Comment 4 Carlos Garcia Campos 2015-04-28 23:19:53 PDT
Committed r183532: <http://trac.webkit.org/changeset/183532>