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

Unified Diff: chrome/browser/google_apis/task_util.h

Issue 77553006: google_apis: Random fix in task_util.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/drive/job_scheduler.cc ('k') | chrome/browser/google_apis/task_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/task_util.h
diff --git a/chrome/browser/google_apis/task_util.h b/chrome/browser/google_apis/task_util.h
index d186f3d8c0e9517b4990750da9b721f09bca2814..883a0e84655b1c53f250fb767d063792f992ee39 100644
--- a/chrome/browser/google_apis/task_util.h
+++ b/chrome/browser/google_apis/task_util.h
@@ -10,8 +10,8 @@
namespace google_apis {
-// Runs task on the thread to which |relay_proxy| belongs.
-void RunTaskOnThread(scoped_refptr<base::MessageLoopProxy> relay_proxy,
+// Runs task on the thread to which |task_runner| belongs.
+void RunTaskOnThread(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const base::Closure& task);
namespace internal {
@@ -106,33 +106,6 @@ struct ComposedCallback<void(T1, scoped_ptr<T2, D2>, T3, T4)> {
}
};
-// GetDefaultValue returns a value constructed by the default constructor.
-template<typename T> struct DefaultValueCreator {
- static T GetDefaultValue() { return T(); }
-};
-template<typename T> struct DefaultValueCreator<const T&> {
- static T GetDefaultValue() { return T(); }
-};
-
-// Helper of CreateErrorRunCallback implementation.
-// Provides:
-// - ResultType; the type of the Callback which should be returned by
-// CreateErrorRunCallback.
-// - Run(): a static function which takes the original |callback| and |error|,
-// and runs the |callback|.Run() with the error code and default values
-// for remaining arguments.
-template<typename CallbackType> struct CreateErrorRunCallbackHelper;
-
-// CreateErrorRunCallback with two arguments.
-template<typename ErrorType, typename P1>
-struct CreateErrorRunCallbackHelper<void(ErrorType, P1)> {
- typedef base::Callback<void(ErrorType)> ResultType;
- static void Run(
- const base::Callback<void(ErrorType, P1)>& callback, ErrorType error) {
- callback.Run(error, DefaultValueCreator<P1>::GetDefaultValue());
- }
-};
-
} // namespace internal
// Returns callback that takes arguments (arg1, arg2, ...), create a closure
@@ -158,15 +131,6 @@ CallbackType CreateRelayCallback(const CallbackType& callback) {
callback);
}
-// Returns a callback with the tail parameter bound to its default value.
-// In other words, returned_callback.Run(error) runs callback.Run(error, T()).
-template<typename CallbackType>
-typename internal::CreateErrorRunCallbackHelper<CallbackType>::ResultType
-CreateErrorRunCallback(const base::Callback<CallbackType>& callback) {
- return base::Bind(
- &internal::CreateErrorRunCallbackHelper<CallbackType>::Run, callback);
-}
-
} // namespace google_apis
#endif // CHROME_BROWSER_GOOGLE_APIS_TASK_UTIL_H_
« no previous file with comments | « chrome/browser/chromeos/drive/job_scheduler.cc ('k') | chrome/browser/google_apis/task_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698