Commit 0f5b5790 authored by gavinp's avatar gavinp Committed by Commit bot

Downgrade all CHECKs to DCHECKs in SimpleCache backend.

After we're sure we have fixed 317138, let's drop these CHECKs. Also,
celebrate!

R=ttuttle@chromium.org
BUG=317138

Review URL: https://codereview.chromium.org/509993002

Cr-Commit-Position: refs/heads/master@{#296972}
parent 83b94acc
...@@ -280,15 +280,13 @@ int SimpleBackendImpl::GetMaxFileSize() const { ...@@ -280,15 +280,13 @@ int SimpleBackendImpl::GetMaxFileSize() const {
} }
void SimpleBackendImpl::OnDoomStart(uint64 entry_hash) { void SimpleBackendImpl::OnDoomStart(uint64 entry_hash) {
// TODO(ttuttle): Revert to DCHECK once http://crbug.com/317138 is fixed. DCHECK_EQ(0u, entries_pending_doom_.count(entry_hash));
CHECK_EQ(0u, entries_pending_doom_.count(entry_hash));
entries_pending_doom_.insert( entries_pending_doom_.insert(
std::make_pair(entry_hash, std::vector<Closure>())); std::make_pair(entry_hash, std::vector<Closure>()));
} }
void SimpleBackendImpl::OnDoomComplete(uint64 entry_hash) { void SimpleBackendImpl::OnDoomComplete(uint64 entry_hash) {
// TODO(ttuttle): Revert to DCHECK once http://crbug.com/317138 is fixed. DCHECK_EQ(1u, entries_pending_doom_.count(entry_hash));
CHECK_EQ(1u, entries_pending_doom_.count(entry_hash));
base::hash_map<uint64, std::vector<Closure> >::iterator it = base::hash_map<uint64, std::vector<Closure> >::iterator it =
entries_pending_doom_.find(entry_hash); entries_pending_doom_.find(entry_hash);
std::vector<Closure> to_run_closures; std::vector<Closure> to_run_closures;
...@@ -314,11 +312,8 @@ void SimpleBackendImpl::DoomEntries(std::vector<uint64>* entry_hashes, ...@@ -314,11 +312,8 @@ void SimpleBackendImpl::DoomEntries(std::vector<uint64>* entry_hashes,
// SimpleSynchronousEntry::DoomEntrySet and delete the files en masse. // SimpleSynchronousEntry::DoomEntrySet and delete the files en masse.
for (int i = mass_doom_entry_hashes->size() - 1; i >= 0; --i) { for (int i = mass_doom_entry_hashes->size() - 1; i >= 0; --i) {
const uint64 entry_hash = (*mass_doom_entry_hashes)[i]; const uint64 entry_hash = (*mass_doom_entry_hashes)[i];
// TODO(ttuttle): Revert to DCHECK once http://crbug.com/317138 is fixed. DCHECK(active_entries_.count(entry_hash) == 0 ||
CHECK(active_entries_.count(entry_hash) == 0 || entries_pending_doom_.count(entry_hash) == 0);
entries_pending_doom_.count(entry_hash) == 0)
<< "The entry 0x" << std::hex << entry_hash
<< " is both active and pending doom.";
if (!active_entries_.count(entry_hash) && if (!active_entries_.count(entry_hash) &&
!entries_pending_doom_.count(entry_hash)) { !entries_pending_doom_.count(entry_hash)) {
continue; continue;
...@@ -337,8 +332,7 @@ void SimpleBackendImpl::DoomEntries(std::vector<uint64>* entry_hashes, ...@@ -337,8 +332,7 @@ void SimpleBackendImpl::DoomEntries(std::vector<uint64>* entry_hashes,
it = to_doom_individually_hashes.begin(), it = to_doom_individually_hashes.begin(),
end = to_doom_individually_hashes.end(); it != end; ++it) { end = to_doom_individually_hashes.end(); it != end; ++it) {
const int doom_result = DoomEntryFromHash(*it, barrier_callback); const int doom_result = DoomEntryFromHash(*it, barrier_callback);
// TODO(ttuttle): Revert to DCHECK once http://crbug.com/317138 is fixed. DCHECK_EQ(net::ERR_IO_PENDING, doom_result);
CHECK_EQ(net::ERR_IO_PENDING, doom_result);
index_->Remove(*it); index_->Remove(*it);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment