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

Unified Diff: net/proxy/multi_threaded_proxy_resolver.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/dhcp_proxy_script_fetcher_win.cc ('k') | net/proxy/proxy_resolver_v8_tracing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/multi_threaded_proxy_resolver.cc
diff --git a/net/proxy/multi_threaded_proxy_resolver.cc b/net/proxy/multi_threaded_proxy_resolver.cc
index d2c722a61be32aaabbeebe94d15c0d1b9ab81650..407710f01b1a39bd1c343d6ff9f748aef5f43908 100644
--- a/net/proxy/multi_threaded_proxy_resolver.cc
+++ b/net/proxy/multi_threaded_proxy_resolver.cc
@@ -15,8 +15,8 @@
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
-#include "base/threading/non_thread_safe.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 "net/base/net_errors.h"
@@ -98,8 +98,7 @@ class Executor : public base::RefCountedThreadSafe<Executor> {
};
class MultiThreadedProxyResolver : public ProxyResolver,
- public Executor::Coordinator,
- public base::NonThreadSafe {
+ public Executor::Coordinator {
public:
// Creates an asynchronous ProxyResolver that runs requests on up to
// |max_num_threads|.
@@ -145,6 +144,8 @@ class MultiThreadedProxyResolver : public ProxyResolver,
PendingJobsQueue pending_jobs_;
ExecutorList executors_;
scoped_refptr<ProxyResolverScriptData> script_data_;
+
+ THREAD_CHECKER(thread_checker_);
};
// Job ---------------------------------------------
@@ -447,7 +448,7 @@ MultiThreadedProxyResolver::MultiThreadedProxyResolver(
}
MultiThreadedProxyResolver::~MultiThreadedProxyResolver() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
// We will cancel all outstanding requests.
pending_jobs_.clear();
@@ -462,7 +463,7 @@ int MultiThreadedProxyResolver::GetProxyForURL(
const CompletionCallback& callback,
std::unique_ptr<Request>* request,
const NetLogWithSource& net_log) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(!callback.is_null());
scoped_refptr<GetProxyForURLJob> job(
@@ -495,7 +496,7 @@ int MultiThreadedProxyResolver::GetProxyForURL(
}
Executor* MultiThreadedProxyResolver::FindIdleExecutor() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
for (ExecutorList::iterator it = executors_.begin();
it != executors_.end(); ++it) {
Executor* executor = it->get();
@@ -506,7 +507,7 @@ Executor* MultiThreadedProxyResolver::FindIdleExecutor() {
}
void MultiThreadedProxyResolver::AddNewExecutor() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK_LT(executors_.size(), max_num_threads_);
// The "thread number" is used to give the thread a unique name.
int thread_number = executors_.size();
@@ -517,7 +518,7 @@ void MultiThreadedProxyResolver::AddNewExecutor() {
}
void MultiThreadedProxyResolver::OnExecutorReady(Executor* executor) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
while (!pending_jobs_.empty()) {
scoped_refptr<Job> job = pending_jobs_.front();
pending_jobs_.pop_front();
« no previous file with comments | « net/proxy/dhcp_proxy_script_fetcher_win.cc ('k') | net/proxy/proxy_resolver_v8_tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698