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

Unified Diff: net/proxy/proxy_resolver_v8_tracing.cc

Issue 1141573002: [net/proxy] Usage of ThreadTaskRunnerHandle & SingleThreadTaskRunner instead of MLP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/proxy_resolver_v8_tracing.h ('k') | net/proxy/proxy_script_fetcher_impl_unittest.cc » ('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 ce5cb5f881c9d34e391acf01091d5e5241a7c390..921cd558574d84b5de98a6d90e7a0a462b0a3a11 100644
--- a/net/proxy/proxy_resolver_v8_tracing.cc
+++ b/net/proxy/proxy_resolver_v8_tracing.cc
@@ -5,10 +5,11 @@
#include "net/proxy/proxy_resolver_v8_tracing.h"
#include "base/bind.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/cancellation_flag.h"
#include "base/synchronization/waitable_event.h"
+#include "base/thread_task_runner_handle.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
@@ -200,7 +201,7 @@ class ProxyResolverV8Tracing::Job
// The thread which called into ProxyResolverV8Tracing, and on which the
// completion callback is expected to run.
- scoped_refptr<base::MessageLoopProxy> origin_loop_;
+ scoped_refptr<base::SingleThreadTaskRunner> origin_runner_;
// The ProxyResolverV8Tracing which spawned this Job.
// Initialized on origin thread and then accessed from both threads.
@@ -295,7 +296,7 @@ class ProxyResolverV8Tracing::Job
};
ProxyResolverV8Tracing::Job::Job(ProxyResolverV8Tracing* parent)
- : origin_loop_(base::MessageLoopProxy::current()),
+ : origin_runner_(base::ThreadTaskRunnerHandle::Get()),
parent_(parent),
event_(true, false),
last_num_dns_(0),
@@ -385,7 +386,7 @@ void ProxyResolverV8Tracing::Job::CheckIsOnWorkerThread() const {
}
void ProxyResolverV8Tracing::Job::CheckIsOnOriginThread() const {
- DCHECK(origin_loop_->BelongsToCurrentThread());
+ DCHECK(origin_runner_->BelongsToCurrentThread());
}
void ProxyResolverV8Tracing::Job::SetCallback(
@@ -430,9 +431,8 @@ NetLog* ProxyResolverV8Tracing::Job::net_log() {
void ProxyResolverV8Tracing::Job::NotifyCaller(int result) {
CheckIsOnWorkerThread();
- origin_loop_->PostTask(
- FROM_HERE,
- base::Bind(&Job::NotifyCallerOnOriginLoop, this, result));
+ origin_runner_->PostTask(
+ FROM_HERE, base::Bind(&Job::NotifyCallerOnOriginLoop, this, result));
}
void ProxyResolverV8Tracing::Job::NotifyCallerOnOriginLoop(int result) {
@@ -662,7 +662,7 @@ bool ProxyResolverV8Tracing::Job::PostDnsOperationAndWait(
DCHECK(!pending_dns_);
pending_dns_host_ = host;
pending_dns_op_ = op;
- origin_loop_->PostTask(FROM_HERE, base::Bind(&Job::DoDnsOperation, this));
+ origin_runner_->PostTask(FROM_HERE, base::Bind(&Job::DoDnsOperation, this));
event_.Wait();
event_.Reset();
« no previous file with comments | « net/proxy/proxy_resolver_v8_tracing.h ('k') | net/proxy/proxy_script_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698