| 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_CHROMEOS_GDATA_TASK_UTIL_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_TASK_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_TASK_UTIL_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_TASK_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 | 10 |
| 11 namespace gdata { | 11 namespace gdata { |
| 12 | 12 |
| 13 // Runs task on the thread to which |relay_proxy| belongs. | 13 // Runs task on the thread to which |relay_proxy| belongs. |
| 14 void RunTaskOnThread(scoped_refptr<base::MessageLoopProxy> relay_proxy, | 14 void RunTaskOnThread(scoped_refptr<base::MessageLoopProxy> relay_proxy, |
| 15 const base::Closure& task); | 15 const base::Closure& task); |
| 16 | 16 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // Returns callback which runs the given |callback| on the current thread. | 111 // Returns callback which runs the given |callback| on the current thread. |
| 112 template<typename CallbackType> | 112 template<typename CallbackType> |
| 113 CallbackType CreateRelayCallback(const CallbackType& callback) { | 113 CallbackType CreateRelayCallback(const CallbackType& callback) { |
| 114 return base::Bind(&internal::RelayCallback<CallbackType>::Run, | 114 return base::Bind(&internal::RelayCallback<CallbackType>::Run, |
| 115 base::MessageLoopProxy::current(), | 115 base::MessageLoopProxy::current(), |
| 116 callback); | 116 callback); |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace gdata | 119 } // namespace gdata |
| 120 | 120 |
| 121 #endif // CHROME_BROWSER_CHROMEOS_GDATA_TASK_UTIL_H_ | 121 #endif // CHROME_BROWSER_GOOGLE_APIS_TASK_UTIL_H_ |
| OLD | NEW |