diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 17:33:29 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 17:33:29 +0000 |
commit | 6d32cb06edeb614f99568027e06a32c13c6eb6bb (patch) | |
tree | 29edbd4f53858cdfe234028d6f7a7da0211436d8 /gpu | |
parent | 2cd60b80267486f4fcf362b13940a34217d2dfe3 (diff) | |
download | chromium_src-6d32cb06edeb614f99568027e06a32c13c6eb6bb.zip chromium_src-6d32cb06edeb614f99568027e06a32c13c6eb6bb.tar.gz chromium_src-6d32cb06edeb614f99568027e06a32c13c6eb6bb.tar.bz2 |
gdata: Implement very simple cache eviction logic
The basic idea is to evict files from <gcache>/tmp as needed, but
do not remove recursively as we don't want to touch <gache>/tmp/downloads,
which is used for user initiated downloads like "Save As"
Here's the behaviors added in this patch.
Before downloading a file:
- Check if we have enough space, based on the expected file size.
- If we don't have enough space, remove files in <gcache>/tmp
- If we still don't have enough space, return base::PLATFORM_FILE_ERROR_NO_SPACE
- If we have enough space, start downloading the file
After a file is downloaded:
- At this point, the disk can be full or nearly full for various reasons.
- If we don't have enough buffer space,
- Remove the downloaded file
- Remove files in <gcache>/tmp
- Return base::PLATFORM_FILE_ERROR_NO_SPACE
After a file is unpinned:
- This is a chance to remove files in <gcache>/tmp
- Try to remove files in <gcache>/tmp if we don't have enough space
BUG=chromium-os:28553
TEST=added tests.
Review URL: https://chromiumcodereview.appspot.com/10031001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131578 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
0 files changed, 0 insertions, 0 deletions