Index: net/dns/host_cache.cc |
diff --git a/net/dns/host_cache.cc b/net/dns/host_cache.cc |
index 0026c02176c03c8c5dc28ba463000d4d8699d890..909c7968c960eaa5643f4df67ee48769006f3f84 100644 |
--- a/net/dns/host_cache.cc |
+++ b/net/dns/host_cache.cc |
@@ -107,12 +107,13 @@ HostCache::HostCache(size_t max_entries) |
: max_entries_(max_entries), network_changes_(0) {} |
HostCache::~HostCache() { |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
RecordEraseAll(ERASE_DESTRUCT, base::TimeTicks::Now()); |
} |
const HostCache::Entry* HostCache::Lookup(const Key& key, |
base::TimeTicks now) { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
if (caching_is_disabled()) |
return nullptr; |
@@ -135,7 +136,7 @@ const HostCache::Entry* HostCache::LookupStale( |
const Key& key, |
base::TimeTicks now, |
HostCache::EntryStaleness* stale_out) { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
if (caching_is_disabled()) |
return nullptr; |
@@ -164,7 +165,7 @@ void HostCache::Set(const Key& key, |
base::TimeTicks now, |
base::TimeDelta ttl) { |
TRACE_EVENT0(kNetTracingCategory, "HostCache::Set"); |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
if (caching_is_disabled()) |
return; |
@@ -194,14 +195,14 @@ void HostCache::OnNetworkChange() { |
} |
void HostCache::clear() { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
RecordEraseAll(ERASE_CLEAR, base::TimeTicks::Now()); |
entries_.clear(); |
} |
void HostCache::ClearForHosts( |
const base::Callback<bool(const std::string&)>& host_filter) { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
if (host_filter.is_null()) { |
clear(); |
@@ -222,12 +223,12 @@ void HostCache::ClearForHosts( |
} |
size_t HostCache::size() const { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
return entries_.size(); |
} |
size_t HostCache::max_entries() const { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
return max_entries_; |
} |