summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chromium/net/disk_cache/memory/mem_entry_impl.cc4
-rw-r--r--chromium/net/disk_cache/memory/mem_entry_impl.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/chromium/net/disk_cache/memory/mem_entry_impl.cc b/chromium/net/disk_cache/memory/mem_entry_impl.cc
index bb9affc918b..93680d2aec2 100644
--- a/chromium/net/disk_cache/memory/mem_entry_impl.cc
+++ b/chromium/net/disk_cache/memory/mem_entry_impl.cc
@@ -103,8 +103,8 @@ MemEntryImpl::MemEntryImpl(base::WeakPtr<MemBackendImpl> backend,
void MemEntryImpl::Open() {
// Only a parent entry can be opened.
DCHECK_EQ(PARENT_ENTRY, type());
+ CHECK_NE(ref_count_, std::numeric_limits<uint32_t>::max());
++ref_count_;
- DCHECK_GE(ref_count_, 1);
DCHECK(!doomed_);
}
@@ -144,6 +144,7 @@ void MemEntryImpl::Doom() {
void MemEntryImpl::Close() {
DCHECK_EQ(PARENT_ENTRY, type());
+ CHECK_GT(ref_count_, 0u);
--ref_count_;
if (ref_count_ == 0 && !doomed_) {
// At this point the user is clearly done writing, so make sure there isn't
@@ -156,7 +157,6 @@ void MemEntryImpl::Close() {
}
}
}
- DCHECK_GE(ref_count_, 0);
if (!ref_count_ && doomed_)
delete this;
}
diff --git a/chromium/net/disk_cache/memory/mem_entry_impl.h b/chromium/net/disk_cache/memory/mem_entry_impl.h
index a372dd5e9fa..be4934c02e3 100644
--- a/chromium/net/disk_cache/memory/mem_entry_impl.h
+++ b/chromium/net/disk_cache/memory/mem_entry_impl.h
@@ -179,7 +179,7 @@ class NET_EXPORT_PRIVATE MemEntryImpl final
std::string key_;
std::vector<char> data_[kNumStreams]; // User data.
- int ref_count_;
+ uint32_t ref_count_;
int64_t child_id_; // The ID of a child entry.
int child_first_pos_; // The position of the first byte in a child