summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/memory
diff options
context:
space:
mode:
authorrvargas <rvargas@chromium.org>2015-08-03 21:57:11 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-04 04:59:30 +0000
commit0112f1037b342f1f1718c8615e9a17559b1bdfde (patch)
tree7d4431fa0df0cefbad0561c8e9ed5b9cf4b50616 /net/disk_cache/memory
parent8cb079f8e1ce0efd8a7f0328c3bc6d33807f9470 (diff)
downloadchromium_src-0112f1037b342f1f1718c8615e9a17559b1bdfde.zip
chromium_src-0112f1037b342f1f1718c8615e9a17559b1bdfde.tar.gz
chromium_src-0112f1037b342f1f1718c8615e9a17559b1bdfde.tar.bz2
Memory-only disk cache: Fix GetAvailableRange for small ranges.
This CL makes sure that when a range is scanned for stored bytes, and that range is small enough so that no bytes are present even though there are bytes on that entry beyond the range, the return of the operation is "0 bytes found". BUG=513937 TEST=net_unittests Review URL: https://codereview.chromium.org/1266713010 Cr-Commit-Position: refs/heads/master@{#341674}
Diffstat (limited to 'net/disk_cache/memory')
-rw-r--r--net/disk_cache/memory/mem_entry_impl.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/disk_cache/memory/mem_entry_impl.cc b/net/disk_cache/memory/mem_entry_impl.cc
index dffaf42..daa3980 100644
--- a/net/disk_cache/memory/mem_entry_impl.cc
+++ b/net/disk_cache/memory/mem_entry_impl.cc
@@ -481,7 +481,7 @@ int MemEntryImpl::GetAvailableRange(int64 offset, int len, int64* start) {
// Find the first child and record the number of empty bytes.
int empty = FindNextChild(offset, len, &current_child);
- if (current_child) {
+ if (current_child && empty < len) {
*start = offset + empty;
len -= empty;