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

Unified Diff: net/dns/host_resolver_impl.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_resolver_impl.h ('k') | net/dns/mock_host_resolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/host_resolver_impl.cc
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index abfddf9be9d1cde596368117131fa8337e56e988..33d951b894e0e546bfc3fa14901f389fe7598cb5 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -1933,6 +1933,7 @@ HostResolverImpl::HostResolverImpl(const Options& options, NetLog* net_log)
base::WorkerPool::GetTaskRunner(true /* task_is_slow */)) {}
HostResolverImpl::~HostResolverImpl() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
// Prevent the dispatcher from starting new jobs.
dispatcher_->SetLimitsToZero();
// It's now safe for Jobs to call KillDnsTask on destruction, because
@@ -1957,7 +1958,7 @@ int HostResolverImpl::Resolve(const RequestInfo& info,
std::unique_ptr<Request>* out_req,
const NetLogWithSource& source_net_log) {
DCHECK(addresses);
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK_EQ(false, callback.is_null());
DCHECK(out_req);
@@ -2132,7 +2133,7 @@ int HostResolverImpl::ResolveHelper(const Key& key,
int HostResolverImpl::ResolveFromCache(const RequestInfo& info,
AddressList* addresses,
const NetLogWithSource& source_net_log) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(addresses);
// Update the net log and notify registered observers.
@@ -2152,7 +2153,7 @@ int HostResolverImpl::ResolveFromCache(const RequestInfo& info,
}
void HostResolverImpl::SetDnsClientEnabled(bool enabled) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
#if defined(ENABLE_BUILT_IN_DNS)
if (enabled && !dns_client_) {
SetDnsClient(DnsClient::CreateClient(net_log_));
@@ -2185,7 +2186,7 @@ int HostResolverImpl::ResolveStaleFromCache(
AddressList* addresses,
HostCache::EntryStaleness* stale_info,
const NetLogWithSource& source_net_log) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(addresses);
DCHECK(stale_info);
@@ -2206,7 +2207,7 @@ int HostResolverImpl::ResolveStaleFromCache(
}
void HostResolverImpl::SetNoIPv6OnWifi(bool no_ipv6_on_wifi) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
assume_ipv6_failure_on_wifi_ = no_ipv6_on_wifi;
}
« no previous file with comments | « net/dns/host_resolver_impl.h ('k') | net/dns/mock_host_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698