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

Unified Diff: base/bind_internal.h

Issue 8073012: Callback API Change: Allow Bind() to take a Callback<> and bind all its free parameters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/bind.h.pump ('k') | base/bind_internal.h.pump » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind_internal.h
diff --git a/base/bind_internal.h b/base/bind_internal.h
index 17ce9c89bde702b637b860c8b77355a9e3b0377a..404b795297897106ba29b85f32c13260f6ca99e2 100644
--- a/base/bind_internal.h
+++ b/base/bind_internal.h
@@ -1721,6 +1721,47 @@ struct Invoker6<true, StorageType, void(T::*)(X1, X2, X3, X4, X5)> {
}
};
+// BindMoreFuncN<>
+//
+// This set of functions help in fully binding the free parameters in a
+// Callback<>.
+template <typename Sig, typename P1>
+void BindMoreFunc1(const base::Callback<Sig>& callback, const P1& p1) {
+ callback.Run(p1);
+}
+
+template <typename Sig, typename P1, typename P2>
+void BindMoreFunc2(const base::Callback<Sig>& callback, const P1& p1,
+ const P2& p2) {
+ callback.Run(p1, p2);
+}
+
+template <typename Sig, typename P1, typename P2, typename P3>
+void BindMoreFunc3(const base::Callback<Sig>& callback, const P1& p1,
+ const P2& p2, const P3& p3) {
+ callback.Run(p1, p2, p3);
+}
+
+template <typename Sig, typename P1, typename P2, typename P3, typename P4>
+void BindMoreFunc4(const base::Callback<Sig>& callback, const P1& p1,
+ const P2& p2, const P3& p3, const P4& p4) {
+ callback.Run(p1, p2, p3, p4);
+}
+
+template <typename Sig, typename P1, typename P2, typename P3, typename P4,
+ typename P5>
+void BindMoreFunc5(const base::Callback<Sig>& callback, const P1& p1,
+ const P2& p2, const P3& p3, const P4& p4, const P5& p5) {
+ callback.Run(p1, p2, p3, p4, p5);
+}
+
+template <typename Sig, typename P1, typename P2, typename P3, typename P4,
+ typename P5, typename P6>
+void BindMoreFunc6(const base::Callback<Sig>& callback, const P1& p1,
+ const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6) {
+ callback.Run(p1, p2, p3, p4, p5, p6);
+}
+
// InvokerStorageN<>
//
// These are the actual storage classes for the Invokers.
« no previous file with comments | « base/bind.h.pump ('k') | base/bind_internal.h.pump » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698