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

Unified Diff: net/dns/host_cache.cc

Issue 2910473005: Deprecate NonThreadSafe in net/ in favor of SequenceChecker/ThreadChecker. (Closed)
Patch Set: rebase on r476634 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
« no previous file with comments | « net/dns/host_cache.h ('k') | net/dns/host_resolver_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/host_cache.cc
diff --git a/net/dns/host_cache.cc b/net/dns/host_cache.cc
index c1dbbda9b0afb67f356c1be16b14f83463af71d9..84a6e80c6f38072d18d33fd8dd71492389d591d3 100644
--- a/net/dns/host_cache.cc
+++ b/net/dns/host_cache.cc
@@ -148,12 +148,13 @@ HostCache::HostCache(size_t max_entries)
: max_entries_(max_entries), network_changes_(0) {}
HostCache::~HostCache() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
RecordEraseAll(ERASE_DESTRUCT, base::TimeTicks::Now());
}
const HostCache::Entry* HostCache::Lookup(const Key& key,
base::TimeTicks now) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (caching_is_disabled())
return nullptr;
@@ -176,7 +177,7 @@ const HostCache::Entry* HostCache::LookupStale(
const Key& key,
base::TimeTicks now,
HostCache::EntryStaleness* stale_out) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (caching_is_disabled())
return nullptr;
@@ -205,7 +206,7 @@ void HostCache::Set(const Key& key,
base::TimeTicks now,
base::TimeDelta ttl) {
TRACE_EVENT0(kNetTracingCategory, "HostCache::Set");
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (caching_is_disabled())
return;
@@ -238,14 +239,14 @@ void HostCache::OnNetworkChange() {
}
void HostCache::clear() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_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_THREAD(thread_checker_);
if (host_filter.is_null()) {
clear();
@@ -370,12 +371,12 @@ bool HostCache::RestoreFromListValue(base::ListValue& old_cache) {
}
size_t HostCache::size() const {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
return entries_.size();
}
size_t HostCache::max_entries() const {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
return max_entries_;
}
« no previous file with comments | « net/dns/host_cache.h ('k') | net/dns/host_resolver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698