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

Unified Diff: net/proxy/proxy_resolver_v8_tracing.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/proxy/multi_threaded_proxy_resolver.cc ('k') | net/proxy/proxy_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..417b99a2128d1b74fc923c5735856f86bf790d2a 100644
--- a/net/proxy/proxy_resolver_v8_tracing.cc
+++ b/net/proxy/proxy_resolver_v8_tracing.cc
@@ -17,6 +17,7 @@
#include "base/synchronization/cancellation_flag.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
+#include "base/threading/thread_checker.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/trace_event.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_;
+ THREAD_CHECKER(thread_checker_);
+
DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8TracingImpl);
};
@@ -942,6 +944,7 @@ ProxyResolverV8TracingImpl::ProxyResolverV8TracingImpl(
}
ProxyResolverV8TracingImpl::~ProxyResolverV8TracingImpl() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_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_THREAD(thread_checker_);
DCHECK(!callback.is_null());
scoped_refptr<Job> job = new Job(job_params_.get(), std::move(bindings));
« no previous file with comments | « net/proxy/multi_threaded_proxy_resolver.cc ('k') | net/proxy/proxy_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698