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

Unified Diff: content/browser/cancelable_request.h

Issue 8483003: Callback API Change: Reimplement Bind(); support IgnoreResult, full currying, and use less types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 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/common/profiling.cc ('k') | content/browser/debugger/worker_devtools_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/cancelable_request.h
diff --git a/content/browser/cancelable_request.h b/content/browser/cancelable_request.h
index 9a986d8871f9d7f07b215c719d17d8680224bce0..0b5c5e1865acb340445aa3c480bfb4d35a642680 100644
--- a/content/browser/cancelable_request.h
+++ b/content/browser/cancelable_request.h
@@ -776,13 +776,14 @@ class CancelableRequest<base::Callback<void(A1)> > :
DCHECK(!callback.is_null()) << "Callback must be initialized.";
}
- void ForwardResult(typename base::internal::ParamTraits<A1>::ForwardType a1) {
+ void ForwardResult(
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1), false);
}
void ForwardResultAsync(
- typename base::internal::ParamTraits<A1>::ForwardType a1) {
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1), true);
}
@@ -806,15 +807,16 @@ class CancelableRequest<base::Callback<void(A1,A2)> > :
DCHECK(!callback.is_null()) << "Callback must be initialized.";
}
- void ForwardResult(typename base::internal::ParamTraits<A1>::ForwardType a1,
- typename base::internal::ParamTraits<A2>::ForwardType a2) {
+ void ForwardResult(
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1,
+ typename base::internal::CallbackParamTraits<A2>::ForwardType a2) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1, a2), false);
}
void ForwardResultAsync(
- typename base::internal::ParamTraits<A1>::ForwardType a1,
- typename base::internal::ParamTraits<A2>::ForwardType a2) {
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1,
+ typename base::internal::CallbackParamTraits<A2>::ForwardType a2) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1, a2), true);
}
@@ -838,17 +840,18 @@ class CancelableRequest<base::Callback<void(A1,A2,A3)> > :
DCHECK(!callback.is_null()) << "Callback must be initialized.";
}
- void ForwardResult(typename base::internal::ParamTraits<A1>::ForwardType a1,
- typename base::internal::ParamTraits<A2>::ForwardType a2,
- typename base::internal::ParamTraits<A3>::ForwardType a3) {
+ void ForwardResult(
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1,
+ typename base::internal::CallbackParamTraits<A2>::ForwardType a2,
+ typename base::internal::CallbackParamTraits<A3>::ForwardType a3) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1, a2, a3), false);
}
void ForwardResultAsync(
- typename base::internal::ParamTraits<A1>::ForwardType a1,
- typename base::internal::ParamTraits<A2>::ForwardType a2,
- typename base::internal::ParamTraits<A3>::ForwardType a3) {
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1,
+ typename base::internal::CallbackParamTraits<A2>::ForwardType a2,
+ typename base::internal::CallbackParamTraits<A3>::ForwardType a3) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1, a2, a3), true);
}
@@ -872,19 +875,20 @@ class CancelableRequest<base::Callback<void(A1, A2, A3, A4)> > :
DCHECK(!callback.is_null()) << "Callback must be initialized.";
}
- void ForwardResult(typename base::internal::ParamTraits<A1>::ForwardType a1,
- typename base::internal::ParamTraits<A2>::ForwardType a2,
- typename base::internal::ParamTraits<A3>::ForwardType a3,
- typename base::internal::ParamTraits<A4>::ForwardType a4) {
+ void ForwardResult(
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1,
+ typename base::internal::CallbackParamTraits<A2>::ForwardType a2,
+ typename base::internal::CallbackParamTraits<A3>::ForwardType a3,
+ typename base::internal::CallbackParamTraits<A4>::ForwardType a4) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1, a2, a3, a4), false);
}
void ForwardResultAsync(
- typename base::internal::ParamTraits<A1>::ForwardType a1,
- typename base::internal::ParamTraits<A2>::ForwardType a2,
- typename base::internal::ParamTraits<A3>::ForwardType a3,
- typename base::internal::ParamTraits<A4>::ForwardType a4) {
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1,
+ typename base::internal::CallbackParamTraits<A2>::ForwardType a2,
+ typename base::internal::CallbackParamTraits<A3>::ForwardType a3,
+ typename base::internal::CallbackParamTraits<A4>::ForwardType a4) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1, a2, a3, a4), true);
}
@@ -908,21 +912,22 @@ class CancelableRequest<base::Callback<void(A1, A2, A3, A4, A5)> > :
DCHECK(!callback.is_null()) << "Callback must be initialized.";
}
- void ForwardResult(typename base::internal::ParamTraits<A1>::ForwardType a1,
- typename base::internal::ParamTraits<A2>::ForwardType a2,
- typename base::internal::ParamTraits<A3>::ForwardType a3,
- typename base::internal::ParamTraits<A4>::ForwardType a4,
- typename base::internal::ParamTraits<A5>::ForwardType a5) {
+ void ForwardResult(
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1,
+ typename base::internal::CallbackParamTraits<A2>::ForwardType a2,
+ typename base::internal::CallbackParamTraits<A3>::ForwardType a3,
+ typename base::internal::CallbackParamTraits<A4>::ForwardType a4,
+ typename base::internal::CallbackParamTraits<A5>::ForwardType a5) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1, a2, a3, a4, a5), false);
}
void ForwardResultAsync(
- typename base::internal::ParamTraits<A1>::ForwardType a1,
- typename base::internal::ParamTraits<A2>::ForwardType a2,
- typename base::internal::ParamTraits<A3>::ForwardType a3,
- typename base::internal::ParamTraits<A4>::ForwardType a4,
- typename base::internal::ParamTraits<A5>::ForwardType a5) {
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1,
+ typename base::internal::CallbackParamTraits<A2>::ForwardType a2,
+ typename base::internal::CallbackParamTraits<A3>::ForwardType a3,
+ typename base::internal::CallbackParamTraits<A4>::ForwardType a4,
+ typename base::internal::CallbackParamTraits<A5>::ForwardType a5) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1, a2, a3, a4, a5), true);
}
@@ -947,23 +952,24 @@ class CancelableRequest<base::Callback<void(A1, A2, A3, A4, A5, A6)> > :
DCHECK(!callback.is_null()) << "Callback must be initialized.";
}
- void ForwardResult(typename base::internal::ParamTraits<A1>::ForwardType a1,
- typename base::internal::ParamTraits<A2>::ForwardType a2,
- typename base::internal::ParamTraits<A3>::ForwardType a3,
- typename base::internal::ParamTraits<A4>::ForwardType a4,
- typename base::internal::ParamTraits<A5>::ForwardType a5,
- typename base::internal::ParamTraits<A6>::ForwardType a6) {
+ void ForwardResult(
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1,
+ typename base::internal::CallbackParamTraits<A2>::ForwardType a2,
+ typename base::internal::CallbackParamTraits<A3>::ForwardType a3,
+ typename base::internal::CallbackParamTraits<A4>::ForwardType a4,
+ typename base::internal::CallbackParamTraits<A5>::ForwardType a5,
+ typename base::internal::CallbackParamTraits<A6>::ForwardType a6) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1, a2, a3, a4, a5, a6), false);
}
void ForwardResultAsync(
- typename base::internal::ParamTraits<A1>::ForwardType a1,
- typename base::internal::ParamTraits<A2>::ForwardType a2,
- typename base::internal::ParamTraits<A3>::ForwardType a3,
- typename base::internal::ParamTraits<A4>::ForwardType a4,
- typename base::internal::ParamTraits<A5>::ForwardType a5,
- typename base::internal::ParamTraits<A6>::ForwardType a6) {
+ typename base::internal::CallbackParamTraits<A1>::ForwardType a1,
+ typename base::internal::CallbackParamTraits<A2>::ForwardType a2,
+ typename base::internal::CallbackParamTraits<A3>::ForwardType a3,
+ typename base::internal::CallbackParamTraits<A4>::ForwardType a4,
+ typename base::internal::CallbackParamTraits<A5>::ForwardType a5,
+ typename base::internal::CallbackParamTraits<A6>::ForwardType a6) {
if (canceled()) return;
DoForward(base::Bind(callback_, a1, a2, a3, a4, a5, a6), true);
}
« no previous file with comments | « chrome/common/profiling.cc ('k') | content/browser/debugger/worker_devtools_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698