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

Unified Diff: net/proxy/polling_proxy_config_service.cc

Issue 2679233003: Use TaskScheduler instead of WorkerPool in polling_proxy_config_service.cc. (Closed)
Patch Set: ScpedTaskScheduler Created 3 years, 10 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/polling_proxy_config_service.cc
diff --git a/net/proxy/polling_proxy_config_service.cc b/net/proxy/polling_proxy_config_service.cc
index defe507eab01492eb4684d2573986102f43c4f13..af6fc9cb630988cc126c6964e1be0c49f12a6360 100644
--- a/net/proxy/polling_proxy_config_service.cc
+++ b/net/proxy/polling_proxy_config_service.cc
@@ -11,8 +11,8 @@
#include "base/observer_list.h"
#include "base/single_thread_task_runner.h"
#include "base/synchronization/lock.h"
+#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "base/threading/worker_pool.h"
#include "net/proxy/proxy_config.h"
namespace net {
@@ -90,17 +90,17 @@ class PollingProxyConfigService::Core
last_poll_time_ = base::TimeTicks::Now();
poll_task_outstanding_ = true;
poll_task_queued_ = false;
- base::WorkerPool::PostTask(
- FROM_HERE,
- base::Bind(&Core::PollOnWorkerThread, this, get_config_func_),
- true);
+ base::PostTaskWithTraits(
+ FROM_HERE, base::TaskTraits().MayBlock().WithShutdownBehavior(
xunjieli 2017/02/10 16:53:32 Why does this have a "MayBlock()" ?
fdoray 2017/02/13 15:56:04 I assumed that this was blocking since it was done
eroman 2017/02/13 23:14:52 Correct. The windows implementation may do file i/
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
+ base::Bind(&Core::PollAsync, this, get_config_func_));
}
private:
friend class base::RefCountedThreadSafe<Core>;
~Core() {}
- void PollOnWorkerThread(GetConfigFunction func) {
+ void PollAsync(GetConfigFunction func) {
ProxyConfig config;
func(&config);

Powered by Google App Engine
This is Rietveld 408576698