diff options
author | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 18:24:14 +0000 |
---|---|---|
committer | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 18:24:14 +0000 |
commit | c2fe3154d36ad61b45fd3300aa172d968c33d5f8 (patch) | |
tree | 87ead19b92968aff1a40bec06ee19e5ee9eb09d2 /base | |
parent | 374c5495268eb82a7328d504c1fe24969c56e9b6 (diff) | |
download | chromium_src-c2fe3154d36ad61b45fd3300aa172d968c33d5f8.zip chromium_src-c2fe3154d36ad61b45fd3300aa172d968c33d5f8.tar.gz chromium_src-c2fe3154d36ad61b45fd3300aa172d968c33d5f8.tar.bz2 |
Prevent an extra copy of data types that get passed into IPC messages when
sending them. This makes it so that types sendable via IPC no longer need
copy constructors.
BUG=12296
Review URL: http://codereview.chromium.org/112042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16497 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/tuple.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/base/tuple.h b/base/tuple.h index 685fa25..23ef9de 100644 --- a/base/tuple.h +++ b/base/tuple.h @@ -68,6 +68,7 @@ struct TupleTraits<P&> { struct Tuple0 { typedef Tuple0 ValueTuple; typedef Tuple0 RefTuple; + typedef Tuple0 ParamTuple; }; template <class A> @@ -76,6 +77,7 @@ struct Tuple1 { typedef A TypeA; typedef Tuple1<typename TupleTraits<A>::ValueType> ValueTuple; typedef Tuple1<typename TupleTraits<A>::RefType> RefTuple; + typedef Tuple1<typename TupleTraits<A>::ParamType> ParamTuple; Tuple1() {} explicit Tuple1(typename TupleTraits<A>::ParamType a) : a(a) {} @@ -92,6 +94,8 @@ struct Tuple2 { typename TupleTraits<B>::ValueType> ValueTuple; typedef Tuple2<typename TupleTraits<A>::RefType, typename TupleTraits<B>::RefType> RefTuple; + typedef Tuple2<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType> ParamTuple; Tuple2() {} Tuple2(typename TupleTraits<A>::ParamType a, @@ -115,6 +119,9 @@ struct Tuple3 { typedef Tuple3<typename TupleTraits<A>::RefType, typename TupleTraits<B>::RefType, typename TupleTraits<C>::RefType> RefTuple; + typedef Tuple3<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType, + typename TupleTraits<C>::ParamType> ParamTuple; Tuple3() {} Tuple3(typename TupleTraits<A>::ParamType a, @@ -143,6 +150,10 @@ struct Tuple4 { typename TupleTraits<B>::RefType, typename TupleTraits<C>::RefType, typename TupleTraits<D>::RefType> RefTuple; + typedef Tuple4<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType, + typename TupleTraits<C>::ParamType, + typename TupleTraits<D>::ParamType> ParamTuple; Tuple4() {} Tuple4(typename TupleTraits<A>::ParamType a, @@ -176,6 +187,11 @@ public: typename TupleTraits<C>::RefType, typename TupleTraits<D>::RefType, typename TupleTraits<E>::RefType> RefTuple; + typedef Tuple5<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType, + typename TupleTraits<C>::ParamType, + typename TupleTraits<D>::ParamType, + typename TupleTraits<E>::ParamType> ParamTuple; Tuple5() {} Tuple5(typename TupleTraits<A>::ParamType a, @@ -214,6 +230,12 @@ public: typename TupleTraits<D>::RefType, typename TupleTraits<E>::RefType, typename TupleTraits<F>::RefType> RefTuple; + typedef Tuple6<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType, + typename TupleTraits<C>::ParamType, + typename TupleTraits<D>::ParamType, + typename TupleTraits<E>::ParamType, + typename TupleTraits<F>::ParamType> ParamTuple; Tuple6() {} Tuple6(typename TupleTraits<A>::ParamType a, @@ -257,6 +279,13 @@ public: typename TupleTraits<E>::RefType, typename TupleTraits<F>::RefType, typename TupleTraits<G>::RefType> RefTuple; + typedef Tuple7<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType, + typename TupleTraits<C>::ParamType, + typename TupleTraits<D>::ParamType, + typename TupleTraits<E>::ParamType, + typename TupleTraits<F>::ParamType, + typename TupleTraits<G>::ParamType> ParamTuple; Tuple7() {} Tuple7(typename TupleTraits<A>::ParamType a, |