| 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 CHROME_BROWSER_GOOGLE_APIS_TASK_UTIL_H_ | 5 #ifndef GOOGLE_APIS_DRIVE_TASK_UTIL_H_ |
| 6 #define CHROME_BROWSER_GOOGLE_APIS_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/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 | 10 |
| 11 namespace google_apis { | 11 namespace google_apis { |
| 12 | 12 |
| 13 // Runs task on the thread to which |task_runner| belongs. | 13 // Runs task on the thread to which |task_runner| belongs. |
| 14 void RunTaskOnThread(scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 14 void RunTaskOnThread(scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 15 const base::Closure& task); | 15 const base::Closure& task); |
| 16 | 16 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // Returns callback which runs the given |callback| on the current thread. | 126 // Returns callback which runs the given |callback| on the current thread. |
| 127 template<typename CallbackType> | 127 template<typename CallbackType> |
| 128 CallbackType CreateRelayCallback(const CallbackType& callback) { | 128 CallbackType CreateRelayCallback(const CallbackType& callback) { |
| 129 return CreateComposedCallback( | 129 return CreateComposedCallback( |
| 130 base::Bind(&RunTaskOnThread, base::MessageLoopProxy::current()), | 130 base::Bind(&RunTaskOnThread, base::MessageLoopProxy::current()), |
| 131 callback); | 131 callback); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace google_apis | 134 } // namespace google_apis |
| 135 | 135 |
| 136 #endif // CHROME_BROWSER_GOOGLE_APIS_TASK_UTIL_H_ | 136 #endif // GOOGLE_APIS_DRIVE_TASK_UTIL_H_ |
| OLD | NEW |