diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc index f2438af8debd31..c41c829bdefd80 100644 --- a/net/disk_cache/simple/simple_index.cc +++ b/net/disk_cache/simple/simple_index.cc @@ -140,7 +140,7 @@ SimpleIndex::SimpleIndex( app_on_background_(false) {} SimpleIndex::~SimpleIndex() { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); // Fail all callbacks waiting for the index to come up. for (CallbackList::iterator it = to_run_when_initialized_.begin(), @@ -150,7 +150,7 @@ SimpleIndex::~SimpleIndex() { } void SimpleIndex::Initialize(base::Time cache_mtime) { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); #if defined(OS_ANDROID) if (base::android::IsVMInitialized()) { @@ -178,7 +178,7 @@ void SimpleIndex::SetMaxSize(uint64_t max_bytes) { } int SimpleIndex::ExecuteWhenReady(const net::CompletionCallback& task) { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); if (initialized_) io_thread_->PostTask(FROM_HERE, base::Bind(task, net::OK)); else @@ -251,7 +251,7 @@ size_t SimpleIndex::EstimateMemoryUsage() const { } void SimpleIndex::Insert(uint64_t entry_hash) { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); // Upon insert we don't know yet the size of the entry. // It will be updated later when the SimpleEntryImpl finishes opening or // creating the new entry, and then UpdateEntrySize will be called. @@ -263,7 +263,7 @@ void SimpleIndex::Insert(uint64_t entry_hash) { } void SimpleIndex::Remove(uint64_t entry_hash) { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); EntrySet::iterator it = entries_set_.find(entry_hash); if (it != entries_set_.end()) { UpdateEntryIteratorSize(&it, 0u); @@ -282,7 +282,7 @@ bool SimpleIndex::Has(uint64_t hash) const { } bool SimpleIndex::UseIfExists(uint64_t entry_hash) { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); // Always update the last used time, even if it is during initialization. // It will be merged later. EntrySet::iterator it = entries_set_.find(entry_hash); @@ -295,7 +295,7 @@ bool SimpleIndex::UseIfExists(uint64_t entry_hash) { } void SimpleIndex::StartEvictionIfNeeded() { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); if (eviction_in_progress_ || cache_size_ <= high_watermark_) return; // Take all live key hashes from the index and sort them by time. @@ -352,7 +352,7 @@ void SimpleIndex::StartEvictionIfNeeded() { bool SimpleIndex::UpdateEntrySize(uint64_t entry_hash, base::StrictNumeric entry_size) { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); EntrySet::iterator it = entries_set_.find(entry_hash); if (it == entries_set_.end()) return false; @@ -364,7 +364,7 @@ bool SimpleIndex::UpdateEntrySize(uint64_t entry_hash, } void SimpleIndex::EvictionDone(int result) { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); // Ignore the result of eviction. We did our best. eviction_in_progress_ = false; @@ -416,7 +416,7 @@ void SimpleIndex::UpdateEntryIteratorSize( void SimpleIndex::MergeInitializingSet( std::unique_ptr load_result) { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); DCHECK(load_result->did_load); EntrySet* index_file_entries = &load_result->entries; @@ -482,7 +482,7 @@ void SimpleIndex::MergeInitializingSet( #if defined(OS_ANDROID) void SimpleIndex::OnApplicationStateChange( base::android::ApplicationState state) { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); // For more info about android activities, see: // developer.android.com/training/basics/activity-lifecycle/pausing.html if (state == base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) { @@ -496,7 +496,7 @@ void SimpleIndex::OnApplicationStateChange( #endif void SimpleIndex::WriteToDisk(IndexWriteToDiskReason reason) { - CHECK(io_thread_checker_.CalledOnValidThread()); + DCHECK(io_thread_checker_.CalledOnValidThread()); if (!initialized_) return; SIMPLE_CACHE_UMA(CUSTOM_COUNTS, diff --git a/net/disk_cache/simple/simple_index.h b/net/disk_cache/simple/simple_index.h index 3877f1e2a85fa6..6740c2c91e2b81 100644 --- a/net/disk_cache/simple/simple_index.h +++ b/net/disk_cache/simple/simple_index.h @@ -230,9 +230,7 @@ class NET_EXPORT_PRIVATE SimpleIndex // All nonstatic SimpleEntryImpl methods should always be called on the IO // thread, in all cases. |io_thread_checker_| documents and enforces this. - // NOTE: Temporarily forced on to chase a crash, https://crbug.com/710994, - // turn off by 2017-04-21, also going back CHECK -> DCHECK in the impl. - base::ThreadCheckerImpl io_thread_checker_; + base::ThreadChecker io_thread_checker_; // Timestamp of the last time we wrote the index to disk. // PostponeWritingToDisk() may give up postponing and allow the write if it