summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authoravi <avi@chromium.org>2014-12-23 13:47:26 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-23 21:48:10 +0000
commit4f841af78da6aeeeed3557f40e5c00d06ff9ce3c (patch)
treedfac76e6655a7e52e084c53439081e7bd8bef7f7 /ipc
parent809cd0ca6770eb6748fadb5f6528dfd46e0ccd01 (diff)
downloadchromium_src-4f841af78da6aeeeed3557f40e5c00d06ff9ce3c.zip
chromium_src-4f841af78da6aeeeed3557f40e5c00d06ff9ce3c.tar.gz
chromium_src-4f841af78da6aeeeed3557f40e5c00d06ff9ce3c.tar.bz2
Revert of Revert "Update legacy Tuple-using code." (patchset #1 id:1 of https://codereview.chromium.org/826573002/)
Reason for revert: The tests should have failed with this. Undoing the revert. Original issue's description: > Revert "Update legacy Tuple-using code." > > This reverts commit 12f4b98357b9dedc93cb546aac0aece2c8d9e850 > > BUG=440675, 444827 > > Committed: https://chromium.googlesource.com/chromium/src/+/85748694f2a119a057088f77f70b97f11607473c TBR= NOTREECHECKS=true NOTRY=true BUG=440675, 444827 Review URL: https://codereview.chromium.org/794073003 Cr-Commit-Position: refs/heads/master@{#309586}
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_message_macros.h35
-rw-r--r--ipc/ipc_message_utils.h116
2 files changed, 76 insertions, 75 deletions
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h
index 20c8335..01789cb 100644
--- a/ipc/ipc_message_macros.h
+++ b/ipc/ipc_message_macros.h
@@ -457,7 +457,7 @@
void (T::*func)(P*, TA)) { \
Schema::Param p; \
if (Read(msg, &p)) { \
- (obj->*func)(parameter, p.a); \
+ (obj->*func)(parameter, get<0>(p)); \
return true; \
} \
return false; \
@@ -469,7 +469,7 @@
void (T::*func)(P*, TA, TB)) { \
Schema::Param p; \
if (Read(msg, &p)) { \
- (obj->*func)(parameter, p.a, p.b); \
+ (obj->*func)(parameter, get<0>(p), get<1>(p)); \
return true; \
} \
return false; \
@@ -481,7 +481,7 @@
void (T::*func)(P*, TA, TB, TC)) { \
Schema::Param p; \
if (Read(msg, &p)) { \
- (obj->*func)(parameter, p.a, p.b, p.c); \
+ (obj->*func)(parameter, get<0>(p), get<1>(p), get<2>(p)); \
return true; \
} \
return false; \
@@ -494,7 +494,7 @@
void (T::*func)(P*, TA, TB, TC, TD)) { \
Schema::Param p; \
if (Read(msg, &p)) { \
- (obj->*func)(parameter, p.a, p.b, p.c, p.d); \
+ (obj->*func)(parameter, get<0>(p), get<1>(p), get<2>(p), get<3>(p)); \
return true; \
} \
return false; \
@@ -507,7 +507,8 @@
void (T::*func)(P*, TA, TB, TC, TD, TE)) { \
Schema::Param p; \
if (Read(msg, &p)) { \
- (obj->*func)(parameter, p.a, p.b, p.c, p.d, p.e); \
+ (obj->*func)(parameter, get<0>(p), get<1>(p), get<2>(p), get<3>(p), \
+ get<4>(p)); \
return true; \
} \
return false; \
@@ -817,18 +818,18 @@
#define IPC_TYPE_OUT_3(t1, t2, t3) t1* arg6, t2* arg7, t3* arg8
#define IPC_TYPE_OUT_4(t1, t2, t3, t4) t1* arg6, t2* arg7, t3* arg8, t4* arg9
-#define IPC_TUPLE_IN_0() Tuple0
-#define IPC_TUPLE_IN_1(t1) Tuple1<t1>
-#define IPC_TUPLE_IN_2(t1, t2) Tuple2<t1, t2>
-#define IPC_TUPLE_IN_3(t1, t2, t3) Tuple3<t1, t2, t3>
-#define IPC_TUPLE_IN_4(t1, t2, t3, t4) Tuple4<t1, t2, t3, t4>
-#define IPC_TUPLE_IN_5(t1, t2, t3, t4, t5) Tuple5<t1, t2, t3, t4, t5>
-
-#define IPC_TUPLE_OUT_0() Tuple0
-#define IPC_TUPLE_OUT_1(t1) Tuple1<t1&>
-#define IPC_TUPLE_OUT_2(t1, t2) Tuple2<t1&, t2&>
-#define IPC_TUPLE_OUT_3(t1, t2, t3) Tuple3<t1&, t2&, t3&>
-#define IPC_TUPLE_OUT_4(t1, t2, t3, t4) Tuple4<t1&, t2&, t3&, t4&>
+#define IPC_TUPLE_IN_0() Tuple<>
+#define IPC_TUPLE_IN_1(t1) Tuple<t1>
+#define IPC_TUPLE_IN_2(t1, t2) Tuple<t1, t2>
+#define IPC_TUPLE_IN_3(t1, t2, t3) Tuple<t1, t2, t3>
+#define IPC_TUPLE_IN_4(t1, t2, t3, t4) Tuple<t1, t2, t3, t4>
+#define IPC_TUPLE_IN_5(t1, t2, t3, t4, t5) Tuple<t1, t2, t3, t4, t5>
+
+#define IPC_TUPLE_OUT_0() Tuple<>
+#define IPC_TUPLE_OUT_1(t1) Tuple<t1&>
+#define IPC_TUPLE_OUT_2(t1, t2) Tuple<t1&, t2&>
+#define IPC_TUPLE_OUT_3(t1, t2, t3) Tuple<t1&, t2&, t3&>
+#define IPC_TUPLE_OUT_4(t1, t2, t3, t4) Tuple<t1&, t2&, t3&, t4&>
#define IPC_NAME_IN_0() MakeTuple()
#define IPC_NAME_IN_1(t1) MakeRefTuple(arg1)
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index c78192a..d4c6268 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -520,8 +520,8 @@ struct IPC_EXPORT ParamTraits<base::TimeTicks> {
};
template <>
-struct ParamTraits<Tuple0> {
- typedef Tuple0 param_type;
+struct ParamTraits<Tuple<>> {
+ typedef Tuple<> param_type;
static void Write(Message* m, const param_type& p) {
}
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
@@ -532,112 +532,112 @@ struct ParamTraits<Tuple0> {
};
template <class A>
-struct ParamTraits< Tuple1<A> > {
- typedef Tuple1<A> param_type;
+struct ParamTraits<Tuple<A>> {
+ typedef Tuple<A> param_type;
static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.a);
+ WriteParam(m, get<0>(p));
}
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
- return ReadParam(m, iter, &r->a);
+ return ReadParam(m, iter, &get<0>(*r));
}
static void Log(const param_type& p, std::string* l) {
- LogParam(p.a, l);
+ LogParam(get<0>(p), l);
}
};
template <class A, class B>
-struct ParamTraits< Tuple2<A, B> > {
- typedef Tuple2<A, B> param_type;
+struct ParamTraits< Tuple<A, B> > {
+ typedef Tuple<A, B> param_type;
static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.a);
- WriteParam(m, p.b);
+ WriteParam(m, get<0>(p));
+ WriteParam(m, get<1>(p));
}
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
- return (ReadParam(m, iter, &r->a) &&
- ReadParam(m, iter, &r->b));
+ return (ReadParam(m, iter, &get<0>(*r)) &&
+ ReadParam(m, iter, &get<1>(*r)));
}
static void Log(const param_type& p, std::string* l) {
- LogParam(p.a, l);
+ LogParam(get<0>(p), l);
l->append(", ");
- LogParam(p.b, l);
+ LogParam(get<1>(p), l);
}
};
template <class A, class B, class C>
-struct ParamTraits< Tuple3<A, B, C> > {
- typedef Tuple3<A, B, C> param_type;
+struct ParamTraits< Tuple<A, B, C> > {
+ typedef Tuple<A, B, C> param_type;
static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.a);
- WriteParam(m, p.b);
- WriteParam(m, p.c);
+ WriteParam(m, get<0>(p));
+ WriteParam(m, get<1>(p));
+ WriteParam(m, get<2>(p));
}
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
- return (ReadParam(m, iter, &r->a) &&
- ReadParam(m, iter, &r->b) &&
- ReadParam(m, iter, &r->c));
+ return (ReadParam(m, iter, &get<0>(*r)) &&
+ ReadParam(m, iter, &get<1>(*r)) &&
+ ReadParam(m, iter, &get<2>(*r)));
}
static void Log(const param_type& p, std::string* l) {
- LogParam(p.a, l);
+ LogParam(get<0>(p), l);
l->append(", ");
- LogParam(p.b, l);
+ LogParam(get<1>(p), l);
l->append(", ");
- LogParam(p.c, l);
+ LogParam(get<2>(p), l);
}
};
template <class A, class B, class C, class D>
-struct ParamTraits< Tuple4<A, B, C, D> > {
- typedef Tuple4<A, B, C, D> param_type;
+struct ParamTraits< Tuple<A, B, C, D> > {
+ typedef Tuple<A, B, C, D> param_type;
static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.a);
- WriteParam(m, p.b);
- WriteParam(m, p.c);
- WriteParam(m, p.d);
+ WriteParam(m, get<0>(p));
+ WriteParam(m, get<1>(p));
+ WriteParam(m, get<2>(p));
+ WriteParam(m, get<3>(p));
}
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
- return (ReadParam(m, iter, &r->a) &&
- ReadParam(m, iter, &r->b) &&
- ReadParam(m, iter, &r->c) &&
- ReadParam(m, iter, &r->d));
+ return (ReadParam(m, iter, &get<0>(*r)) &&
+ ReadParam(m, iter, &get<1>(*r)) &&
+ ReadParam(m, iter, &get<2>(*r)) &&
+ ReadParam(m, iter, &get<3>(*r)));
}
static void Log(const param_type& p, std::string* l) {
- LogParam(p.a, l);
+ LogParam(get<0>(p), l);
l->append(", ");
- LogParam(p.b, l);
+ LogParam(get<1>(p), l);
l->append(", ");
- LogParam(p.c, l);
+ LogParam(get<2>(p), l);
l->append(", ");
- LogParam(p.d, l);
+ LogParam(get<3>(p), l);
}
};
template <class A, class B, class C, class D, class E>
-struct ParamTraits< Tuple5<A, B, C, D, E> > {
- typedef Tuple5<A, B, C, D, E> param_type;
+struct ParamTraits< Tuple<A, B, C, D, E> > {
+ typedef Tuple<A, B, C, D, E> param_type;
static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.a);
- WriteParam(m, p.b);
- WriteParam(m, p.c);
- WriteParam(m, p.d);
- WriteParam(m, p.e);
+ WriteParam(m, get<0>(p));
+ WriteParam(m, get<1>(p));
+ WriteParam(m, get<2>(p));
+ WriteParam(m, get<3>(p));
+ WriteParam(m, get<4>(p));
}
static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
- return (ReadParam(m, iter, &r->a) &&
- ReadParam(m, iter, &r->b) &&
- ReadParam(m, iter, &r->c) &&
- ReadParam(m, iter, &r->d) &&
- ReadParam(m, iter, &r->e));
+ return (ReadParam(m, iter, &get<0>(*r)) &&
+ ReadParam(m, iter, &get<1>(*r)) &&
+ ReadParam(m, iter, &get<2>(*r)) &&
+ ReadParam(m, iter, &get<3>(*r)) &&
+ ReadParam(m, iter, &get<4>(*r)));
}
static void Log(const param_type& p, std::string* l) {
- LogParam(p.a, l);
+ LogParam(get<0>(p), l);
l->append(", ");
- LogParam(p.b, l);
+ LogParam(get<1>(p), l);
l->append(", ");
- LogParam(p.c, l);
+ LogParam(get<2>(p), l);
l->append(", ");
- LogParam(p.d, l);
+ LogParam(get<3>(p), l);
l->append(", ");
- LogParam(p.e, l);
+ LogParam(get<4>(p), l);
}
};
@@ -912,7 +912,7 @@ class SyncMessageSchema {
Method func) {
Message* reply = SyncMessage::GenerateReply(msg);
if (ok) {
- Tuple1<Message&> t = MakeRefTuple(*reply);
+ Tuple<Message&> t = MakeRefTuple(*reply);
ConnectMessageAndReply(msg, reply);
DispatchToMethod(obj, func, send_params, &t);
} else {