Should GPUCache be in Storage Partition or Caches directory?

658 views
Skip to first unread message

Jiang Jiang

unread,
Jul 30, 2013, 8:35:52 AM7/30/13
to chromi...@chromium.org, dsin...@chromium.org, j...@chromium.org
Hi,

We recently noticed that a folder named GPUCache is generated under user data directory (~/Library/Application Support/Google/Chrome/Default/GPUCache on Mac) and I noticed change https://codereview.chromium.org/12500009/ is behind this. In Chromium (or Opera) we have this platform_paths::GetUserCacheDirectory() to get the cache directory for a given profile directory. For instance on Mac it will be something like ~/Library/Caches/<bundle-id>/ which matches the OS expectation.

As noted by the review https://codereview.chromium.org/12500009/, GPUCache sounds like something transient and shouldn't be synced, why not putting it under the cache directory?

I understand that StoragePartition or BrowserContext doesn't have a concept for "cache directory" yet but if the idea of not putting this GPUCache under a subdirectory of StoragePartition::GetPath(), then perhaps introducing a new virtual function (such as base::FilePath GetCachePathForStoragePartition()) to BrowserContext is viable? Implementations such as Chrome or Opera can then override this path with the actual cache directory, or leave it to be the default value, StoragePartitionImpl::GetPath().

The change I have in mind is something like: https://gist.github.com/jjgod/6112524 Of course details can be discussed in code review if you guys think the idea is acceptable.

- Jiang
Reply all
Reply to author
Forward
0 new messages