| 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 "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| 10 | 11 |
| 11 namespace google_apis { | 12 namespace google_apis { |
| 12 | 13 |
| 13 // Runs the task with the task runner. | 14 // Runs the task with the task runner. |
| 14 void RunTaskWithTaskRunner(scoped_refptr<base::TaskRunner> task_runner, | 15 void RunTaskWithTaskRunner(scoped_refptr<base::TaskRunner> task_runner, |
| 15 const base::Closure& task); | 16 const base::Closure& task); |
| 16 | 17 |
| 17 namespace internal { | 18 namespace internal { |
| 18 | 19 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 template<typename CallbackType> | 117 template<typename CallbackType> |
| 117 CallbackType CreateRelayCallback(const CallbackType& callback) { | 118 CallbackType CreateRelayCallback(const CallbackType& callback) { |
| 118 return CreateComposedCallback( | 119 return CreateComposedCallback( |
| 119 base::Bind(&RunTaskWithTaskRunner, base::ThreadTaskRunnerHandle::Get()), | 120 base::Bind(&RunTaskWithTaskRunner, base::ThreadTaskRunnerHandle::Get()), |
| 120 callback); | 121 callback); |
| 121 } | 122 } |
| 122 | 123 |
| 123 } // namespace google_apis | 124 } // namespace google_apis |
| 124 | 125 |
| 125 #endif // GOOGLE_APIS_DRIVE_TASK_UTIL_H_ | 126 #endif // GOOGLE_APIS_DRIVE_TASK_UTIL_H_ |
| OLD | NEW |