OLD | NEW |
1 // This file was GENERATED by command: | 1 // This file was GENERATED by command: |
2 // pump.py bind.h.pump | 2 // pump.py bind.h.pump |
3 // DO NOT EDIT BY HAND!!! | 3 // DO NOT EDIT BY HAND!!! |
4 | 4 |
5 | 5 |
6 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 6 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
7 // Use of this source code is governed by a BSD-style license that can be | 7 // Use of this source code is governed by a BSD-style license that can be |
8 // found in the LICENSE file. | 8 // found in the LICENSE file. |
9 | 9 |
10 #ifndef BASE_BIND_H_ | 10 #ifndef BASE_BIND_H_ |
(...skipping 26 matching lines...) Expand all Loading... |
37 // TODO(ajwong): We might be able to avoid this now, but need to test. | 37 // TODO(ajwong): We might be able to avoid this now, but need to test. |
38 // | 38 // |
39 // It is possible to move most of the COMPILE_ASSERT asserts into BindState<>, | 39 // It is possible to move most of the COMPILE_ASSERT asserts into BindState<>, |
40 // but it feels a little nicer to have the asserts here so people do not | 40 // but it feels a little nicer to have the asserts here so people do not |
41 // need to crack open bind_internal.h. On the other hand, it makes Bind() | 41 // need to crack open bind_internal.h. On the other hand, it makes Bind() |
42 // harder to read. | 42 // harder to read. |
43 | 43 |
44 namespace base { | 44 namespace base { |
45 | 45 |
46 template <typename Functor> | 46 template <typename Functor> |
47 base::Callback< | 47 internal::BindStateHolder< |
48 typename internal::BindState< | 48 internal::BindState< |
49 typename internal::FunctorTraits<Functor>::RunnableType, | 49 typename internal::FunctorTraits<Functor>::RunnableType, |
50 typename internal::FunctorTraits<Functor>::RunType, | 50 typename internal::FunctorTraits<Functor>::RunType, |
51 void()> | 51 void()> > |
52 ::UnboundRunType> | |
53 Bind(Functor functor) { | 52 Bind(Functor functor) { |
54 // Typedefs for how to store and run the functor. | 53 // Typedefs for how to store and run the functor. |
55 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 54 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
56 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 55 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
57 | 56 |
58 // Use RunnableType::RunType instead of RunType above because our | 57 // Use RunnableType::RunType instead of RunType above because our |
59 // checks should below for bound references need to know what the actual | 58 // checks should below for bound references need to know what the actual |
60 // functor is going to interpret the argument as. | 59 // functor is going to interpret the argument as. |
61 typedef internal::FunctionTraits<typename RunnableType::RunType> | 60 typedef internal::FunctionTraits<typename RunnableType::RunType> |
62 BoundFunctorTraits; | 61 BoundFunctorTraits; |
63 | 62 |
64 typedef internal::BindState<RunnableType, RunType, void()> BindState; | |
65 | 63 |
66 | 64 return internal::MakeBindStateHolder( |
67 return Callback<typename BindState::UnboundRunType>( | 65 new internal::BindState<RunnableType, RunType, void()>( |
68 new BindState(internal::MakeRunnable(functor))); | 66 internal::MakeRunnable(functor))); |
69 } | 67 } |
70 | 68 |
71 template <typename Functor, typename P1> | 69 template <typename Functor, typename P1> |
72 base::Callback< | 70 internal::BindStateHolder< |
73 typename internal::BindState< | 71 internal::BindState< |
74 typename internal::FunctorTraits<Functor>::RunnableType, | 72 typename internal::FunctorTraits<Functor>::RunnableType, |
75 typename internal::FunctorTraits<Functor>::RunType, | 73 typename internal::FunctorTraits<Functor>::RunType, |
76 void(typename internal::CallbackParamTraits<P1>::StorageType)> | 74 void(typename internal::CallbackParamTraits<P1>::StorageType)> > |
77 ::UnboundRunType> | |
78 Bind(Functor functor, const P1& p1) { | 75 Bind(Functor functor, const P1& p1) { |
79 // Typedefs for how to store and run the functor. | 76 // Typedefs for how to store and run the functor. |
80 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 77 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
81 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 78 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
82 | 79 |
83 // Use RunnableType::RunType instead of RunType above because our | 80 // Use RunnableType::RunType instead of RunType above because our |
84 // checks should below for bound references need to know what the actual | 81 // checks should below for bound references need to know what the actual |
85 // functor is going to interpret the argument as. | 82 // functor is going to interpret the argument as. |
86 typedef internal::FunctionTraits<typename RunnableType::RunType> | 83 typedef internal::FunctionTraits<typename RunnableType::RunType> |
87 BoundFunctorTraits; | 84 BoundFunctorTraits; |
(...skipping 11 matching lines...) Expand all Loading... |
99 // a scoped_refptr because BindState<> itself takes care of AddRef() for | 96 // a scoped_refptr because BindState<> itself takes care of AddRef() for |
100 // methods. We also disallow binding of an array as the method's target | 97 // methods. We also disallow binding of an array as the method's target |
101 // object. | 98 // object. |
102 COMPILE_ASSERT( | 99 COMPILE_ASSERT( |
103 internal::HasIsMethodTag<RunnableType>::value || | 100 internal::HasIsMethodTag<RunnableType>::value || |
104 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, | 101 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, |
105 p1_is_refcounted_type_and_needs_scoped_refptr); | 102 p1_is_refcounted_type_and_needs_scoped_refptr); |
106 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || | 103 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || |
107 !is_array<P1>::value, | 104 !is_array<P1>::value, |
108 first_bound_argument_to_method_cannot_be_array); | 105 first_bound_argument_to_method_cannot_be_array); |
109 typedef internal::BindState<RunnableType, RunType, | |
110 void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState; | |
111 | 106 |
112 | 107 return internal::MakeBindStateHolder( |
113 return Callback<typename BindState::UnboundRunType>( | 108 new internal::BindState<RunnableType, RunType, |
114 new BindState(internal::MakeRunnable(functor), p1)); | 109 void(typename internal::CallbackParamTraits<P1>::StorageType)>( |
| 110 internal::MakeRunnable(functor), p1)); |
115 } | 111 } |
116 | 112 |
117 template <typename Functor, typename P1, typename P2> | 113 template <typename Functor, typename P1, typename P2> |
118 base::Callback< | 114 internal::BindStateHolder< |
119 typename internal::BindState< | 115 internal::BindState< |
120 typename internal::FunctorTraits<Functor>::RunnableType, | 116 typename internal::FunctorTraits<Functor>::RunnableType, |
121 typename internal::FunctorTraits<Functor>::RunType, | 117 typename internal::FunctorTraits<Functor>::RunType, |
122 void(typename internal::CallbackParamTraits<P1>::StorageType, | 118 void(typename internal::CallbackParamTraits<P1>::StorageType, |
123 typename internal::CallbackParamTraits<P2>::StorageType)> | 119 typename internal::CallbackParamTraits<P2>::StorageType)> > |
124 ::UnboundRunType> | |
125 Bind(Functor functor, const P1& p1, const P2& p2) { | 120 Bind(Functor functor, const P1& p1, const P2& p2) { |
126 // Typedefs for how to store and run the functor. | 121 // Typedefs for how to store and run the functor. |
127 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 122 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
128 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 123 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
129 | 124 |
130 // Use RunnableType::RunType instead of RunType above because our | 125 // Use RunnableType::RunType instead of RunType above because our |
131 // checks should below for bound references need to know what the actual | 126 // checks should below for bound references need to know what the actual |
132 // functor is going to interpret the argument as. | 127 // functor is going to interpret the argument as. |
133 typedef internal::FunctionTraits<typename RunnableType::RunType> | 128 typedef internal::FunctionTraits<typename RunnableType::RunType> |
134 BoundFunctorTraits; | 129 BoundFunctorTraits; |
(...skipping 14 matching lines...) Expand all Loading... |
149 // object. | 144 // object. |
150 COMPILE_ASSERT( | 145 COMPILE_ASSERT( |
151 internal::HasIsMethodTag<RunnableType>::value || | 146 internal::HasIsMethodTag<RunnableType>::value || |
152 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, | 147 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, |
153 p1_is_refcounted_type_and_needs_scoped_refptr); | 148 p1_is_refcounted_type_and_needs_scoped_refptr); |
154 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || | 149 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || |
155 !is_array<P1>::value, | 150 !is_array<P1>::value, |
156 first_bound_argument_to_method_cannot_be_array); | 151 first_bound_argument_to_method_cannot_be_array); |
157 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, | 152 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, |
158 p2_is_refcounted_type_and_needs_scoped_refptr); | 153 p2_is_refcounted_type_and_needs_scoped_refptr); |
159 typedef internal::BindState<RunnableType, RunType, | |
160 void(typename internal::CallbackParamTraits<P1>::StorageType, | |
161 typename internal::CallbackParamTraits<P2>::StorageType)> BindState; | |
162 | 154 |
163 | 155 return internal::MakeBindStateHolder( |
164 return Callback<typename BindState::UnboundRunType>( | 156 new internal::BindState<RunnableType, RunType, |
165 new BindState(internal::MakeRunnable(functor), p1, p2)); | 157 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 158 typename internal::CallbackParamTraits<P2>::StorageType)>( |
| 159 internal::MakeRunnable(functor), p1, p2)); |
166 } | 160 } |
167 | 161 |
168 template <typename Functor, typename P1, typename P2, typename P3> | 162 template <typename Functor, typename P1, typename P2, typename P3> |
169 base::Callback< | 163 internal::BindStateHolder< |
170 typename internal::BindState< | 164 internal::BindState< |
171 typename internal::FunctorTraits<Functor>::RunnableType, | 165 typename internal::FunctorTraits<Functor>::RunnableType, |
172 typename internal::FunctorTraits<Functor>::RunType, | 166 typename internal::FunctorTraits<Functor>::RunType, |
173 void(typename internal::CallbackParamTraits<P1>::StorageType, | 167 void(typename internal::CallbackParamTraits<P1>::StorageType, |
174 typename internal::CallbackParamTraits<P2>::StorageType, | 168 typename internal::CallbackParamTraits<P2>::StorageType, |
175 typename internal::CallbackParamTraits<P3>::StorageType)> | 169 typename internal::CallbackParamTraits<P3>::StorageType)> > |
176 ::UnboundRunType> | |
177 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) { | 170 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) { |
178 // Typedefs for how to store and run the functor. | 171 // Typedefs for how to store and run the functor. |
179 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 172 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
180 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 173 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
181 | 174 |
182 // Use RunnableType::RunType instead of RunType above because our | 175 // Use RunnableType::RunType instead of RunType above because our |
183 // checks should below for bound references need to know what the actual | 176 // checks should below for bound references need to know what the actual |
184 // functor is going to interpret the argument as. | 177 // functor is going to interpret the argument as. |
185 typedef internal::FunctionTraits<typename RunnableType::RunType> | 178 typedef internal::FunctionTraits<typename RunnableType::RunType> |
186 BoundFunctorTraits; | 179 BoundFunctorTraits; |
(...skipping 17 matching lines...) Expand all Loading... |
204 internal::HasIsMethodTag<RunnableType>::value || | 197 internal::HasIsMethodTag<RunnableType>::value || |
205 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, | 198 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, |
206 p1_is_refcounted_type_and_needs_scoped_refptr); | 199 p1_is_refcounted_type_and_needs_scoped_refptr); |
207 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || | 200 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || |
208 !is_array<P1>::value, | 201 !is_array<P1>::value, |
209 first_bound_argument_to_method_cannot_be_array); | 202 first_bound_argument_to_method_cannot_be_array); |
210 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, | 203 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, |
211 p2_is_refcounted_type_and_needs_scoped_refptr); | 204 p2_is_refcounted_type_and_needs_scoped_refptr); |
212 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, | 205 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, |
213 p3_is_refcounted_type_and_needs_scoped_refptr); | 206 p3_is_refcounted_type_and_needs_scoped_refptr); |
214 typedef internal::BindState<RunnableType, RunType, | |
215 void(typename internal::CallbackParamTraits<P1>::StorageType, | |
216 typename internal::CallbackParamTraits<P2>::StorageType, | |
217 typename internal::CallbackParamTraits<P3>::StorageType)> BindState; | |
218 | 207 |
219 | 208 return internal::MakeBindStateHolder( |
220 return Callback<typename BindState::UnboundRunType>( | 209 new internal::BindState<RunnableType, RunType, |
221 new BindState(internal::MakeRunnable(functor), p1, p2, p3)); | 210 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 211 typename internal::CallbackParamTraits<P2>::StorageType, |
| 212 typename internal::CallbackParamTraits<P3>::StorageType)>( |
| 213 internal::MakeRunnable(functor), p1, p2, p3)); |
222 } | 214 } |
223 | 215 |
224 template <typename Functor, typename P1, typename P2, typename P3, typename P4> | 216 template <typename Functor, typename P1, typename P2, typename P3, typename P4> |
225 base::Callback< | 217 internal::BindStateHolder< |
226 typename internal::BindState< | 218 internal::BindState< |
227 typename internal::FunctorTraits<Functor>::RunnableType, | 219 typename internal::FunctorTraits<Functor>::RunnableType, |
228 typename internal::FunctorTraits<Functor>::RunType, | 220 typename internal::FunctorTraits<Functor>::RunType, |
229 void(typename internal::CallbackParamTraits<P1>::StorageType, | 221 void(typename internal::CallbackParamTraits<P1>::StorageType, |
230 typename internal::CallbackParamTraits<P2>::StorageType, | 222 typename internal::CallbackParamTraits<P2>::StorageType, |
231 typename internal::CallbackParamTraits<P3>::StorageType, | 223 typename internal::CallbackParamTraits<P3>::StorageType, |
232 typename internal::CallbackParamTraits<P4>::StorageType)> | 224 typename internal::CallbackParamTraits<P4>::StorageType)> > |
233 ::UnboundRunType> | |
234 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) { | 225 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) { |
235 // Typedefs for how to store and run the functor. | 226 // Typedefs for how to store and run the functor. |
236 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 227 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
237 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 228 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
238 | 229 |
239 // Use RunnableType::RunType instead of RunType above because our | 230 // Use RunnableType::RunType instead of RunType above because our |
240 // checks should below for bound references need to know what the actual | 231 // checks should below for bound references need to know what the actual |
241 // functor is going to interpret the argument as. | 232 // functor is going to interpret the argument as. |
242 typedef internal::FunctionTraits<typename RunnableType::RunType> | 233 typedef internal::FunctionTraits<typename RunnableType::RunType> |
243 BoundFunctorTraits; | 234 BoundFunctorTraits; |
(...skipping 20 matching lines...) Expand all Loading... |
264 p1_is_refcounted_type_and_needs_scoped_refptr); | 255 p1_is_refcounted_type_and_needs_scoped_refptr); |
265 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || | 256 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || |
266 !is_array<P1>::value, | 257 !is_array<P1>::value, |
267 first_bound_argument_to_method_cannot_be_array); | 258 first_bound_argument_to_method_cannot_be_array); |
268 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, | 259 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, |
269 p2_is_refcounted_type_and_needs_scoped_refptr); | 260 p2_is_refcounted_type_and_needs_scoped_refptr); |
270 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, | 261 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, |
271 p3_is_refcounted_type_and_needs_scoped_refptr); | 262 p3_is_refcounted_type_and_needs_scoped_refptr); |
272 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, | 263 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, |
273 p4_is_refcounted_type_and_needs_scoped_refptr); | 264 p4_is_refcounted_type_and_needs_scoped_refptr); |
274 typedef internal::BindState<RunnableType, RunType, | |
275 void(typename internal::CallbackParamTraits<P1>::StorageType, | |
276 typename internal::CallbackParamTraits<P2>::StorageType, | |
277 typename internal::CallbackParamTraits<P3>::StorageType, | |
278 typename internal::CallbackParamTraits<P4>::StorageType)> BindState; | |
279 | 265 |
280 | 266 return internal::MakeBindStateHolder( |
281 return Callback<typename BindState::UnboundRunType>( | 267 new internal::BindState<RunnableType, RunType, |
282 new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4)); | 268 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 269 typename internal::CallbackParamTraits<P2>::StorageType, |
| 270 typename internal::CallbackParamTraits<P3>::StorageType, |
| 271 typename internal::CallbackParamTraits<P4>::StorageType)>( |
| 272 internal::MakeRunnable(functor), p1, p2, p3, p4)); |
283 } | 273 } |
284 | 274 |
285 template <typename Functor, typename P1, typename P2, typename P3, typename P4, | 275 template <typename Functor, typename P1, typename P2, typename P3, typename P4, |
286 typename P5> | 276 typename P5> |
287 base::Callback< | 277 internal::BindStateHolder< |
288 typename internal::BindState< | 278 internal::BindState< |
289 typename internal::FunctorTraits<Functor>::RunnableType, | 279 typename internal::FunctorTraits<Functor>::RunnableType, |
290 typename internal::FunctorTraits<Functor>::RunType, | 280 typename internal::FunctorTraits<Functor>::RunType, |
291 void(typename internal::CallbackParamTraits<P1>::StorageType, | 281 void(typename internal::CallbackParamTraits<P1>::StorageType, |
292 typename internal::CallbackParamTraits<P2>::StorageType, | 282 typename internal::CallbackParamTraits<P2>::StorageType, |
293 typename internal::CallbackParamTraits<P3>::StorageType, | 283 typename internal::CallbackParamTraits<P3>::StorageType, |
294 typename internal::CallbackParamTraits<P4>::StorageType, | 284 typename internal::CallbackParamTraits<P4>::StorageType, |
295 typename internal::CallbackParamTraits<P5>::StorageType)> | 285 typename internal::CallbackParamTraits<P5>::StorageType)> > |
296 ::UnboundRunType> | |
297 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, | 286 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, |
298 const P5& p5) { | 287 const P5& p5) { |
299 // Typedefs for how to store and run the functor. | 288 // Typedefs for how to store and run the functor. |
300 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 289 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
301 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 290 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
302 | 291 |
303 // Use RunnableType::RunType instead of RunType above because our | 292 // Use RunnableType::RunType instead of RunType above because our |
304 // checks should below for bound references need to know what the actual | 293 // checks should below for bound references need to know what the actual |
305 // functor is going to interpret the argument as. | 294 // functor is going to interpret the argument as. |
306 typedef internal::FunctionTraits<typename RunnableType::RunType> | 295 typedef internal::FunctionTraits<typename RunnableType::RunType> |
(...skipping 24 matching lines...) Expand all Loading... |
331 !is_array<P1>::value, | 320 !is_array<P1>::value, |
332 first_bound_argument_to_method_cannot_be_array); | 321 first_bound_argument_to_method_cannot_be_array); |
333 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, | 322 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, |
334 p2_is_refcounted_type_and_needs_scoped_refptr); | 323 p2_is_refcounted_type_and_needs_scoped_refptr); |
335 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, | 324 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, |
336 p3_is_refcounted_type_and_needs_scoped_refptr); | 325 p3_is_refcounted_type_and_needs_scoped_refptr); |
337 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, | 326 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, |
338 p4_is_refcounted_type_and_needs_scoped_refptr); | 327 p4_is_refcounted_type_and_needs_scoped_refptr); |
339 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, | 328 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, |
340 p5_is_refcounted_type_and_needs_scoped_refptr); | 329 p5_is_refcounted_type_and_needs_scoped_refptr); |
341 typedef internal::BindState<RunnableType, RunType, | |
342 void(typename internal::CallbackParamTraits<P1>::StorageType, | |
343 typename internal::CallbackParamTraits<P2>::StorageType, | |
344 typename internal::CallbackParamTraits<P3>::StorageType, | |
345 typename internal::CallbackParamTraits<P4>::StorageType, | |
346 typename internal::CallbackParamTraits<P5>::StorageType)> BindState; | |
347 | 330 |
348 | 331 return internal::MakeBindStateHolder( |
349 return Callback<typename BindState::UnboundRunType>( | 332 new internal::BindState<RunnableType, RunType, |
350 new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5)); | 333 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 334 typename internal::CallbackParamTraits<P2>::StorageType, |
| 335 typename internal::CallbackParamTraits<P3>::StorageType, |
| 336 typename internal::CallbackParamTraits<P4>::StorageType, |
| 337 typename internal::CallbackParamTraits<P5>::StorageType)>( |
| 338 internal::MakeRunnable(functor), p1, p2, p3, p4, p5)); |
351 } | 339 } |
352 | 340 |
353 template <typename Functor, typename P1, typename P2, typename P3, typename P4, | 341 template <typename Functor, typename P1, typename P2, typename P3, typename P4, |
354 typename P5, typename P6> | 342 typename P5, typename P6> |
355 base::Callback< | 343 internal::BindStateHolder< |
356 typename internal::BindState< | 344 internal::BindState< |
357 typename internal::FunctorTraits<Functor>::RunnableType, | 345 typename internal::FunctorTraits<Functor>::RunnableType, |
358 typename internal::FunctorTraits<Functor>::RunType, | 346 typename internal::FunctorTraits<Functor>::RunType, |
359 void(typename internal::CallbackParamTraits<P1>::StorageType, | 347 void(typename internal::CallbackParamTraits<P1>::StorageType, |
360 typename internal::CallbackParamTraits<P2>::StorageType, | 348 typename internal::CallbackParamTraits<P2>::StorageType, |
361 typename internal::CallbackParamTraits<P3>::StorageType, | 349 typename internal::CallbackParamTraits<P3>::StorageType, |
362 typename internal::CallbackParamTraits<P4>::StorageType, | 350 typename internal::CallbackParamTraits<P4>::StorageType, |
363 typename internal::CallbackParamTraits<P5>::StorageType, | 351 typename internal::CallbackParamTraits<P5>::StorageType, |
364 typename internal::CallbackParamTraits<P6>::StorageType)> | 352 typename internal::CallbackParamTraits<P6>::StorageType)> > |
365 ::UnboundRunType> | |
366 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, | 353 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, |
367 const P5& p5, const P6& p6) { | 354 const P5& p5, const P6& p6) { |
368 // Typedefs for how to store and run the functor. | 355 // Typedefs for how to store and run the functor. |
369 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 356 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
370 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 357 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
371 | 358 |
372 // Use RunnableType::RunType instead of RunType above because our | 359 // Use RunnableType::RunType instead of RunType above because our |
373 // checks should below for bound references need to know what the actual | 360 // checks should below for bound references need to know what the actual |
374 // functor is going to interpret the argument as. | 361 // functor is going to interpret the argument as. |
375 typedef internal::FunctionTraits<typename RunnableType::RunType> | 362 typedef internal::FunctionTraits<typename RunnableType::RunType> |
(...skipping 27 matching lines...) Expand all Loading... |
403 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, | 390 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, |
404 p2_is_refcounted_type_and_needs_scoped_refptr); | 391 p2_is_refcounted_type_and_needs_scoped_refptr); |
405 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, | 392 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, |
406 p3_is_refcounted_type_and_needs_scoped_refptr); | 393 p3_is_refcounted_type_and_needs_scoped_refptr); |
407 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, | 394 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, |
408 p4_is_refcounted_type_and_needs_scoped_refptr); | 395 p4_is_refcounted_type_and_needs_scoped_refptr); |
409 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, | 396 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, |
410 p5_is_refcounted_type_and_needs_scoped_refptr); | 397 p5_is_refcounted_type_and_needs_scoped_refptr); |
411 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, | 398 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, |
412 p6_is_refcounted_type_and_needs_scoped_refptr); | 399 p6_is_refcounted_type_and_needs_scoped_refptr); |
413 typedef internal::BindState<RunnableType, RunType, | |
414 void(typename internal::CallbackParamTraits<P1>::StorageType, | |
415 typename internal::CallbackParamTraits<P2>::StorageType, | |
416 typename internal::CallbackParamTraits<P3>::StorageType, | |
417 typename internal::CallbackParamTraits<P4>::StorageType, | |
418 typename internal::CallbackParamTraits<P5>::StorageType, | |
419 typename internal::CallbackParamTraits<P6>::StorageType)> BindState; | |
420 | 400 |
421 | 401 return internal::MakeBindStateHolder( |
422 return Callback<typename BindState::UnboundRunType>( | 402 new internal::BindState<RunnableType, RunType, |
423 new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6)); | 403 void(typename internal::CallbackParamTraits<P1>::StorageType, |
| 404 typename internal::CallbackParamTraits<P2>::StorageType, |
| 405 typename internal::CallbackParamTraits<P3>::StorageType, |
| 406 typename internal::CallbackParamTraits<P4>::StorageType, |
| 407 typename internal::CallbackParamTraits<P5>::StorageType, |
| 408 typename internal::CallbackParamTraits<P6>::StorageType)>( |
| 409 internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6)); |
424 } | 410 } |
425 | 411 |
426 template <typename Functor, typename P1, typename P2, typename P3, typename P4, | 412 template <typename Functor, typename P1, typename P2, typename P3, typename P4, |
427 typename P5, typename P6, typename P7> | 413 typename P5, typename P6, typename P7> |
428 base::Callback< | 414 internal::BindStateHolder< |
429 typename internal::BindState< | 415 internal::BindState< |
430 typename internal::FunctorTraits<Functor>::RunnableType, | 416 typename internal::FunctorTraits<Functor>::RunnableType, |
431 typename internal::FunctorTraits<Functor>::RunType, | 417 typename internal::FunctorTraits<Functor>::RunType, |
432 void(typename internal::CallbackParamTraits<P1>::StorageType, | 418 void(typename internal::CallbackParamTraits<P1>::StorageType, |
433 typename internal::CallbackParamTraits<P2>::StorageType, | 419 typename internal::CallbackParamTraits<P2>::StorageType, |
434 typename internal::CallbackParamTraits<P3>::StorageType, | 420 typename internal::CallbackParamTraits<P3>::StorageType, |
435 typename internal::CallbackParamTraits<P4>::StorageType, | 421 typename internal::CallbackParamTraits<P4>::StorageType, |
436 typename internal::CallbackParamTraits<P5>::StorageType, | 422 typename internal::CallbackParamTraits<P5>::StorageType, |
437 typename internal::CallbackParamTraits<P6>::StorageType, | 423 typename internal::CallbackParamTraits<P6>::StorageType, |
438 typename internal::CallbackParamTraits<P7>::StorageType)> | 424 typename internal::CallbackParamTraits<P7>::StorageType)> > |
439 ::UnboundRunType> | |
440 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, | 425 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, |
441 const P5& p5, const P6& p6, const P7& p7) { | 426 const P5& p5, const P6& p6, const P7& p7) { |
442 // Typedefs for how to store and run the functor. | 427 // Typedefs for how to store and run the functor. |
443 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; | 428 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
444 typedef typename internal::FunctorTraits<Functor>::RunType RunType; | 429 typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
445 | 430 |
446 // Use RunnableType::RunType instead of RunType above because our | 431 // Use RunnableType::RunType instead of RunType above because our |
447 // checks should below for bound references need to know what the actual | 432 // checks should below for bound references need to know what the actual |
448 // functor is going to interpret the argument as. | 433 // functor is going to interpret the argument as. |
449 typedef internal::FunctionTraits<typename RunnableType::RunType> | 434 typedef internal::FunctionTraits<typename RunnableType::RunType> |
(...skipping 30 matching lines...) Expand all Loading... |
480 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, | 465 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, |
481 p3_is_refcounted_type_and_needs_scoped_refptr); | 466 p3_is_refcounted_type_and_needs_scoped_refptr); |
482 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, | 467 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, |
483 p4_is_refcounted_type_and_needs_scoped_refptr); | 468 p4_is_refcounted_type_and_needs_scoped_refptr); |
484 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, | 469 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, |
485 p5_is_refcounted_type_and_needs_scoped_refptr); | 470 p5_is_refcounted_type_and_needs_scoped_refptr); |
486 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, | 471 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, |
487 p6_is_refcounted_type_and_needs_scoped_refptr); | 472 p6_is_refcounted_type_and_needs_scoped_refptr); |
488 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P7>::value, | 473 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P7>::value, |
489 p7_is_refcounted_type_and_needs_scoped_refptr); | 474 p7_is_refcounted_type_and_needs_scoped_refptr); |
490 typedef internal::BindState<RunnableType, RunType, | |
491 void(typename internal::CallbackParamTraits<P1>::StorageType, | |
492 typename internal::CallbackParamTraits<P2>::StorageType, | |
493 typename internal::CallbackParamTraits<P3>::StorageType, | |
494 typename internal::CallbackParamTraits<P4>::StorageType, | |
495 typename internal::CallbackParamTraits<P5>::StorageType, | |
496 typename internal::CallbackParamTraits<P6>::StorageType, | |
497 typename internal::CallbackParamTraits<P7>::StorageType)> BindState; | |
498 | 475 |
499 | 476 return internal::MakeBindStateHolder( |
500 return Callback<typename BindState::UnboundRunType>( | 477 new internal::BindState<RunnableType, RunType, |
501 new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, | 478 void(typename internal::CallbackParamTraits<P1>::StorageType, |
502 p7)); | 479 typename internal::CallbackParamTraits<P2>::StorageType, |
| 480 typename internal::CallbackParamTraits<P3>::StorageType, |
| 481 typename internal::CallbackParamTraits<P4>::StorageType, |
| 482 typename internal::CallbackParamTraits<P5>::StorageType, |
| 483 typename internal::CallbackParamTraits<P6>::StorageType, |
| 484 typename internal::CallbackParamTraits<P7>::StorageType)>( |
| 485 internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, p7)); |
503 } | 486 } |
504 | 487 |
505 } // namespace base | 488 } // namespace base |
506 | 489 |
507 #endif // BASE_BIND_H_ | 490 #endif // BASE_BIND_H_ |
OLD | NEW |