summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/sparse_control.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fixing bugs in sparse cache when dealing with GetAvailableRange queries not ↵hclam@chromium.org2009-09-021-5/+9
| | | | | | | | | | | | | | | | | aligned TEST=net_unittests --gtest_filter=DiskCacheEntryTest.PartialSparseEntry In handling GetAvailableRange() queries, if the start offset is not aligned to 1KB, there was some strange behaviors: 1. The start offset found is smaller than the input offset 2. Number of continus bytes doesn't take into account offset in a block. This patch will fix the above problems. Review URL: http://codereview.chromium.org/186002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25225 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing a crash in disk_cache::SparseControl::UpdateRange()hclam@chromium.org2009-09-021-0/+7
| | | | | | | | | | | | | | | TEST=net_unittests --gtest_filter=DiskCacheEntryTest::PArtialSparseEntry If we do a partial write with the following criteria, disk_cache::SparseControl will crash: 1. first_byte and last_byte in the same 1KB block 2. first_byte % 1024 != 0 3. (first_byte >> 10) % 32 == 31 Review URL: http://codereview.chromium.org/176067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25134 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Add support for having a sparse entry block thatrvargas@google.com2009-07-171-44/+123
| | | | | | | | | | | | | | | | | | is not totally filled. This is required to allow two consecutive writes to fill a given range without caring about the actual start offset of the second one (as long as it is right where the first one ended). This CL also takes care of all pending TODOs of the sparse disk cache. Sparse disk cache support is now feature complete. BUG=12258 TEST=unittests Review URL: http://codereview.chromium.org/155590 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20988 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Add explicit support for eviction / deletionrvargas@google.com2009-07-091-10/+153
| | | | | | | | | | | | | | | | | | | | | | | of sparse entries. I started to add code to modify the children_map of the parent entry when a child is evicted but that ended up being too much trouble for too little gain. We have to be prepared to handle the case of not finding a child entry because there is no way to make sure that the process doesn't go away at any time, so adding a lot of complexity just to avoid an extra entry lookup is just not worth it. On the other hand, potentially freeing up a lot of space when a sparse entry is deleted (insetad of just waiting for the eviction code to do the cleanup) seems like a good thing. BUG=12258 TEST=unittest Review URL: http://codereview.chromium.org/149306 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20325 0039d316-1c4b-4281-b951-d872f2087c98
* Disk Cache: Fix a dumb warning about a variable not being initialized.rvargas@google.com2009-06-231-1/+1
| | | | | | | | | TBR=nsylvain BUG=none Review URL: http://codereview.chromium.org/146054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19071 0039d316-1c4b-4281-b951-d872f2087c98
* Disk Cache: Implement GetAvailableRange for the regular disk cache.rvargas@google.com2009-06-231-15/+75
| | | | | | | | | | | This is required to enable sparse caching. BUG=12258 TEST=unittest Review URL: http://codereview.chromium.org/146005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19069 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: First pass to add support for sparse entries.rvargas@google.com2009-06-181-0/+407
| | | | | | | | | | | | | Adding Read/Write support. BUG=12258 TEST=unittests. original review: http://codereview.chromium.org/126179 Review URL: http://codereview.chromium.org/132031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18772 0039d316-1c4b-4281-b951-d872f2087c98
* Revert cl 18723.rvargas@google.com2009-06-181-407/+0
| | | | | | | TBR=nsylvain git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18726 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: First pass to add support for sparse entries.rvargas@google.com2009-06-181-0/+407
Adding Read/Write support. BUG=12258 TEST=unittests. Review URL: http://codereview.chromium.org/126179 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18723 0039d316-1c4b-4281-b951-d872f2087c98