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

Unified Diff: net/proxy/proxy_resolver_v8_tracing.cc

Issue 2910473005: Deprecate NonThreadSafe in net/ in favor of SequenceChecker/ThreadChecker. (Closed)
Patch Set: Fix chromecast compile 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/proxy/proxy_resolver_v8_tracing.cc
diff --git a/net/proxy/proxy_resolver_v8_tracing.cc b/net/proxy/proxy_resolver_v8_tracing.cc
index 1019e841da718142edd14b4d2492c327dab24d5e..fc78c9788bf87786c2b05b703b722fcd8aec25d4 100644
--- a/net/proxy/proxy_resolver_v8_tracing.cc
+++ b/net/proxy/proxy_resolver_v8_tracing.cc
@@ -12,6 +12,7 @@
#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "base/sequence_checker.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/cancellation_flag.h"
@@ -302,8 +303,7 @@ class Job : public base::RefCountedThreadSafe<Job>,
AddressList pending_dns_addresses_;
};
-class ProxyResolverV8TracingImpl : public ProxyResolverV8Tracing,
- public base::NonThreadSafe {
+class ProxyResolverV8TracingImpl : public ProxyResolverV8Tracing {
public:
ProxyResolverV8TracingImpl(std::unique_ptr<base::Thread> thread,
std::unique_ptr<ProxyResolverV8> resolver,
@@ -338,6 +338,8 @@ class ProxyResolverV8TracingImpl : public ProxyResolverV8Tracing,
// The number of outstanding (non-cancelled) jobs.
int num_outstanding_callbacks_;
+ SEQUENCE_CHECKER(sequence_checker_);
+
DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8TracingImpl);
};
@@ -942,6 +944,7 @@ ProxyResolverV8TracingImpl::ProxyResolverV8TracingImpl(
}
ProxyResolverV8TracingImpl::~ProxyResolverV8TracingImpl() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Note, all requests should have been cancelled.
CHECK_EQ(0, num_outstanding_callbacks_);
@@ -967,7 +970,7 @@ void ProxyResolverV8TracingImpl::GetProxyForURL(
const CompletionCallback& callback,
std::unique_ptr<ProxyResolver::Request>* request,
std::unique_ptr<Bindings> bindings) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!callback.is_null());
scoped_refptr<Job> job = new Job(job_params_.get(), std::move(bindings));

Powered by Google App Engine
This is Rietveld 408576698