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

Unified Diff: base/threading/worker_pool_posix.cc

Issue 9086002: base::Bind: Remove Task. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fix. Created 8 years, 12 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 | « base/threading/worker_pool_posix.h ('k') | base/threading/worker_pool_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/worker_pool_posix.cc
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc
index f93c44725fb6ee0bc8f57273a2d8dc96201a8668..fd1a40ed0a8135c58027f6dd15b393052311b9a9 100644
--- a/base/threading/worker_pool_posix.cc
+++ b/base/threading/worker_pool_posix.cc
@@ -31,8 +31,6 @@ class WorkerPoolImpl {
WorkerPoolImpl();
~WorkerPoolImpl();
- void PostTask(const tracked_objects::Location& from_here, Task* task,
- bool task_is_slow);
void PostTask(const tracked_objects::Location& from_here,
const base::Closure& task, bool task_is_slow);
@@ -50,11 +48,6 @@ WorkerPoolImpl::~WorkerPoolImpl() {
}
void WorkerPoolImpl::PostTask(const tracked_objects::Location& from_here,
- Task* task, bool task_is_slow) {
- pool_->PostTask(from_here, task);
-}
-
-void WorkerPoolImpl::PostTask(const tracked_objects::Location& from_here,
const base::Closure& task, bool task_is_slow) {
pool_->PostTask(from_here, task);
}
@@ -109,12 +102,6 @@ void WorkerThread::ThreadMain() {
} // namespace
bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
- Task* task, bool task_is_slow) {
- g_lazy_worker_pool.Pointer()->PostTask(from_here, task, task_is_slow);
- return true;
-}
-
-bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
const base::Closure& task, bool task_is_slow) {
g_lazy_worker_pool.Pointer()->PostTask(from_here, task, task_is_slow);
return true;
@@ -146,21 +133,6 @@ void PosixDynamicThreadPool::Terminate() {
void PosixDynamicThreadPool::PostTask(
const tracked_objects::Location& from_here,
- Task* task) {
- PendingTask pending_task(from_here,
- base::Bind(&subtle::TaskClosureAdapter::Run,
- new subtle::TaskClosureAdapter(task)));
- // |pending_task| and AddTask() work in conjunction here to ensure that after
- // a successful AddTask(), the TaskClosureAdapter object is deleted on the
- // worker thread. In AddTask(), the reference |pending_task.task| is handed
- // off in a destructive manner to ensure that the local copy of
- // |pending_task| doesn't keep a ref on the Closure causing the
- // TaskClosureAdapter to be deleted on the wrong thread.
- AddTask(&pending_task);
-}
-
-void PosixDynamicThreadPool::PostTask(
- const tracked_objects::Location& from_here,
const base::Closure& task) {
PendingTask pending_task(from_here, task);
AddTask(&pending_task);
« no previous file with comments | « base/threading/worker_pool_posix.h ('k') | base/threading/worker_pool_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698