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

Unified Diff: net/dns/dns_transaction.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/dns_config_service_win.cc ('k') | net/dns/host_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_transaction.cc
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
index 8c7a757724096773e40e90d5178c981f9cdfaee9..3828e6dae8b635f7bcde1a1f96c76f54b501fbe1 100644
--- a/net/dns/dns_transaction.cc
+++ b/net/dns/dns_transaction.cc
@@ -23,7 +23,7 @@
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/string_piece.h"
-#include "base/threading/non_thread_safe.h"
+#include "base/threading/thread_checker.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/timer/timer.h"
#include "base/values.h"
@@ -559,7 +559,6 @@ class DnsTCPAttempt : public DnsAttempt {
// DnsSession::NextFirstServerIndex, and the order is round-robin afterwards.
// Each server is attempted DnsConfig::attempts times.
class DnsTransactionImpl : public DnsTransaction,
- public base::NonThreadSafe,
public base::SupportsWeakPtr<DnsTransactionImpl> {
public:
DnsTransactionImpl(DnsSession* session,
@@ -583,6 +582,7 @@ class DnsTransactionImpl : public DnsTransaction,
}
~DnsTransactionImpl() override {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (!callback_.is_null()) {
net_log_.EndEventWithNetErrorCode(NetLogEventType::DNS_TRANSACTION,
ERR_ABORTED);
@@ -590,12 +590,12 @@ class DnsTransactionImpl : public DnsTransaction,
}
const std::string& GetHostname() const override {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
return hostname_;
}
uint16_t GetType() const override {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
return qtype_;
}
@@ -970,6 +970,8 @@ class DnsTransactionImpl : public DnsTransaction,
base::OneShotTimer timer_;
+ THREAD_CHECKER(thread_checker_);
+
DISALLOW_COPY_AND_ASSIGN(DnsTransactionImpl);
};
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | net/dns/host_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698