Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: net/dns/host_cache.cc

Issue 2910473005: Deprecate NonThreadSafe in net/ in favor of SequenceChecker/ThreadChecker. (Closed)
Patch Set: another compile nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;
}

Powered by Google App Engine
This is Rietveld 408576698