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

Unified Diff: net/dns/dns_transaction.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/dns_transaction.cc
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
index 8c7a757724096773e40e90d5178c981f9cdfaee9..2ec93d0443be40205f8f9d871a66fe81c5ec4d55 100644
--- a/net/dns/dns_transaction.cc
+++ b/net/dns/dns_transaction.cc
@@ -20,10 +20,10 @@
#include "base/metrics/histogram_macros.h"
#include "base/profiler/scoped_tracker.h"
#include "base/rand_util.h"
+#include "base/sequence_checker.h"
#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_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_SEQUENCE(sequence_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_SEQUENCE(sequence_checker_);
return hostname_;
}
uint16_t GetType() const override {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return qtype_;
}
@@ -970,6 +970,8 @@ class DnsTransactionImpl : public DnsTransaction,
base::OneShotTimer timer_;
+ SEQUENCE_CHECKER(sequence_checker_);
+
DISALLOW_COPY_AND_ASSIGN(DnsTransactionImpl);
};

Powered by Google App Engine
This is Rietveld 408576698