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

Side by Side Diff: base/threading/worker_pool_win.cc

Issue 2726523002: Pass Callback to TaskRunner by value and consume it on invocation (1) (Closed)
Patch Set: erase Closure* Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « base/threading/worker_pool_posix.cc ('k') | base/trace_event/memory_dump_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/worker_pool.h" 5 #include "base/threading/worker_pool.h"
6 6
7 #include <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/callback.h" 10 #include "base/callback.h"
9 #include "base/logging.h" 11 #include "base/logging.h"
10 #include "base/pending_task.h" 12 #include "base/pending_task.h"
11 #include "base/threading/thread_local.h" 13 #include "base/threading/thread_local.h"
12 #include "base/trace_event/trace_event.h" 14 #include "base/trace_event/trace_event.h"
13 #include "base/tracked_objects.h" 15 #include "base/tracked_objects.h"
14 16
15 namespace base { 17 namespace base {
16 18
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return false; 55 return false;
54 } 56 }
55 57
56 return true; 58 return true;
57 } 59 }
58 60
59 } // namespace 61 } // namespace
60 62
61 // static 63 // static
62 bool WorkerPool::PostTask(const tracked_objects::Location& from_here, 64 bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
63 const base::Closure& task, bool task_is_slow) { 65 base::Closure task,
64 PendingTask* pending_task = new PendingTask(from_here, task); 66 bool task_is_slow) {
67 PendingTask* pending_task = new PendingTask(from_here, std::move(task));
65 return PostTaskInternal(pending_task, task_is_slow); 68 return PostTaskInternal(pending_task, task_is_slow);
66 } 69 }
67 70
68 // static 71 // static
69 bool WorkerPool::RunsTasksOnCurrentThread() { 72 bool WorkerPool::RunsTasksOnCurrentThread() {
70 return GetWorkerPoolRunningOnThisThread()->Get(); 73 return GetWorkerPoolRunningOnThisThread()->Get();
71 } 74 }
72 75
73 } // namespace base 76 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/worker_pool_posix.cc ('k') | base/trace_event/memory_dump_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698