Index: net/disk_cache/memory/mem_entry_impl.cc |
diff --git a/net/disk_cache/memory/mem_entry_impl.cc b/net/disk_cache/memory/mem_entry_impl.cc |
index c28a7fab748d565877004f12331eb6db71efbfb4..bcbebb3cf2f8b7992a307489f828fc5d3025c763 100644 |
--- a/net/disk_cache/memory/mem_entry_impl.cc |
+++ b/net/disk_cache/memory/mem_entry_impl.cc |
@@ -103,16 +103,10 @@ void MemEntryImpl::Open() { |
} |
bool MemEntryImpl::InUse() const { |
- if (type() == PARENT_ENTRY) { |
- return ref_count_ > 0; |
- } else { |
- // TODO(gavinp): Can't this just be a DCHECK? How would ref_count_ not be |
- // zero? |
+ if (type() == CHILD_ENTRY) |
+ return parent_->InUse(); |
- // A child entry is never in use. Thus one can always be evicted, even while |
- // its parent entry is open and in use. |
- return false; |
- } |
+ return ref_count_ > 0; |
} |
int MemEntryImpl::GetStorageSize() const { |