OLD | NEW |
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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" |
8 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
10 #include "base/pending_task.h" | 11 #include "base/pending_task.h" |
11 #include "base/task.h" | |
12 #include "base/tracked_objects.h" | 12 #include "base/tracked_objects.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 DWORD CALLBACK WorkItemCallback(void* param) { | 18 DWORD CALLBACK WorkItemCallback(void* param) { |
19 PendingTask* pending_task = static_cast<PendingTask*>(param); | 19 PendingTask* pending_task = static_cast<PendingTask*>(param); |
20 UNSHIPPED_TRACE_EVENT2("task", "WorkItemCallback::Run", | 20 UNSHIPPED_TRACE_EVENT2("task", "WorkItemCallback::Run", |
21 "src_file", pending_task->posted_from.file_name(), | 21 "src_file", pending_task->posted_from.file_name(), |
(...skipping 30 matching lines...) Expand all Loading... |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 bool WorkerPool::PostTask(const tracked_objects::Location& from_here, | 55 bool WorkerPool::PostTask(const tracked_objects::Location& from_here, |
56 const base::Closure& task, bool task_is_slow) { | 56 const base::Closure& task, bool task_is_slow) { |
57 PendingTask* pending_task = new PendingTask(from_here, task); | 57 PendingTask* pending_task = new PendingTask(from_here, task); |
58 return PostTaskInternal(pending_task, task_is_slow); | 58 return PostTaskInternal(pending_task, task_is_slow); |
59 } | 59 } |
60 | 60 |
61 } // namespace base | 61 } // namespace base |
OLD | NEW |