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 #ifndef GOOGLE_APIS_DRIVE_TASK_UTIL_H_ | 5 #ifndef GOOGLE_APIS_DRIVE_TASK_UTIL_H_ |
6 #define GOOGLE_APIS_DRIVE_TASK_UTIL_H_ | 6 #define GOOGLE_APIS_DRIVE_TASK_UTIL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
12 | 12 |
13 namespace google_apis { | 13 namespace google_apis { |
14 | 14 |
15 // Runs the task with the task runner. | 15 // Runs the task with the task runner. |
16 void RunTaskWithTaskRunner(scoped_refptr<base::TaskRunner> task_runner, | 16 void RunTaskWithTaskRunner(scoped_refptr<base::TaskRunner> task_runner, |
17 const base::Closure& task); | 17 const base::Closure& task); |
18 | 18 |
19 namespace internal { | 19 namespace internal { |
20 | 20 |
21 // Implementation of the composed callback, whose signature is |Sig|. | 21 // Implementation of the composed callback, whose signature is |Sig|. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 template<typename CallbackType> | 121 template<typename CallbackType> |
122 CallbackType CreateRelayCallback(const CallbackType& callback) { | 122 CallbackType CreateRelayCallback(const CallbackType& callback) { |
123 return CreateComposedCallback( | 123 return CreateComposedCallback( |
124 base::Bind(&RunTaskWithTaskRunner, base::ThreadTaskRunnerHandle::Get()), | 124 base::Bind(&RunTaskWithTaskRunner, base::ThreadTaskRunnerHandle::Get()), |
125 callback); | 125 callback); |
126 } | 126 } |
127 | 127 |
128 } // namespace google_apis | 128 } // namespace google_apis |
129 | 129 |
130 #endif // GOOGLE_APIS_DRIVE_TASK_UTIL_H_ | 130 #endif // GOOGLE_APIS_DRIVE_TASK_UTIL_H_ |
OLD | NEW |