Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: google_apis/drive/task_util.h

Issue 1135793002: Using ThreadTaskRunnerHandle in lieu of MessageLoopProxy in google_apis module (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | google_apis/gaia/oauth2_access_token_fetcher_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/message_loop/message_loop_proxy.h" 9 #include "base/thread_task_runner_handle.h"
10 10
11 namespace google_apis { 11 namespace google_apis {
12 12
13 // Runs the task with the task runner. 13 // Runs the task with the task runner.
14 void RunTaskWithTaskRunner(scoped_refptr<base::TaskRunner> task_runner, 14 void RunTaskWithTaskRunner(scoped_refptr<base::TaskRunner> task_runner,
15 const base::Closure& task); 15 const base::Closure& task);
16 16
17 namespace internal { 17 namespace internal {
18 18
19 // Implementation of the composed callback, whose signature is |Sig|. 19 // Implementation of the composed callback, whose signature is |Sig|.
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 DCHECK(!callback.is_null()); 109 DCHECK(!callback.is_null());
110 return base::Bind( 110 return base::Bind(
111 &internal::ComposedCallback<typename CallbackType::RunType>::Run, 111 &internal::ComposedCallback<typename CallbackType::RunType>::Run,
112 runner, callback); 112 runner, callback);
113 } 113 }
114 114
115 // Returns callback which runs the given |callback| on the current thread. 115 // Returns callback which runs the given |callback| on the current thread.
116 template<typename CallbackType> 116 template<typename CallbackType>
117 CallbackType CreateRelayCallback(const CallbackType& callback) { 117 CallbackType CreateRelayCallback(const CallbackType& callback) {
118 return CreateComposedCallback( 118 return CreateComposedCallback(
119 base::Bind(&RunTaskWithTaskRunner, base::MessageLoopProxy::current()), 119 base::Bind(&RunTaskWithTaskRunner, base::ThreadTaskRunnerHandle::Get()),
120 callback); 120 callback);
121 } 121 }
122 122
123 } // namespace google_apis 123 } // namespace google_apis
124 124
125 #endif // GOOGLE_APIS_DRIVE_TASK_UTIL_H_ 125 #endif // GOOGLE_APIS_DRIVE_TASK_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | google_apis/gaia/oauth2_access_token_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698