Chromium Code Reviews| Index: base/threading/worker_pool.cc |
| diff --git a/base/threading/worker_pool.cc b/base/threading/worker_pool.cc |
| index 6e07b6ef37e3d1b1c47ace828c6384a10061ddf0..db942be24fd7fc369ff8b828c156de4074e6eeb7 100644 |
| --- a/base/threading/worker_pool.cc |
| +++ b/base/threading/worker_pool.cc |
| @@ -17,22 +17,6 @@ namespace base { |
| namespace { |
| -class PostTaskAndReplyWorkerPool : public internal::PostTaskAndReplyImpl { |
| - public: |
| - explicit PostTaskAndReplyWorkerPool(bool task_is_slow) |
| - : task_is_slow_(task_is_slow) { |
| - } |
| - ~PostTaskAndReplyWorkerPool() override = default; |
| - |
| - private: |
| - bool PostTask(const tracked_objects::Location& from_here, |
| - const Closure& task) override { |
| - return WorkerPool::PostTask(from_here, task, task_is_slow_); |
| - } |
| - |
| - bool task_is_slow_; |
| -}; |
| - |
| // WorkerPoolTaskRunner --------------------------------------------- |
| // A TaskRunner which posts tasks to a WorkerPool with a |
| // fixed ShutdownBehavior. |
| @@ -113,8 +97,14 @@ bool WorkerPool::PostTaskAndReply(const tracked_objects::Location& from_here, |
| // http://crbug.com/290897 |
| // Note: this annotation does not cover tasks posted through a TaskRunner. |
| ANNOTATE_SCOPED_MEMORY_LEAK; |
| - return PostTaskAndReplyWorkerPool(task_is_slow).PostTaskAndReply( |
| - from_here, task, reply); |
| + return internal::PostTaskAndReply( |
| + from_here, task, reply, |
| + Bind( |
| + [](bool task_is_slow, const tracked_objects::Location& from_here, |
|
gab
2016/07/25 17:57:44
I think you can bind |task_is_slow| by value in th
fdoray
2016/07/25 20:40:04
I think this code https://cs.chromium.org/chromium
|
| + const Closure& task) { |
| + return WorkerPool::PostTask(from_here, task, task_is_slow); |
| + }, |
| + task_is_slow)); |
| } |
| // static |