CacheStorage: Improve reading quota size from index file.
When determining the quota size of cache_storage we would prefer to use the value stored in the index file. This reduces the number of files we need to open and read. We can't use the index value, though, if the index file is stale compared to the data stored in cache_storage. Unfortunately, previous code had a bug that would always consider the index file as stale. It only permitted the index file to be used if the index file's modified time was newer than the modified time of its containing directory. This was an impossible condition to meet, however, because the directory will have the same time or newer than its contents. This CL allows us to use the index file value if it has the same time as its containing directory under certain conditions. Specifically, the index file must also be newer than all cache directories referenced from the index. Bug: 986474 Change-Id: I11bba1edbf78f9cc99f62823f370842c5f291bff Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1712951Reviewed-by:Brian White <bcwhite@chromium.org> Reviewed-by:
Daniel Murphy <dmurph@chromium.org> Commit-Queue: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/master@{#680255}
Showing
Please register or sign in to comment