Define DevTools content API
[chromium-blink-merge.git] / base / bind.h
blobaa2cc6b2cf8bd915cae5f0240f6c17920e8e9ea9
1 // This file was GENERATED by command:
2 // pump.py bind.h.pump
3 // DO NOT EDIT BY HAND!!!
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
8 // found in the LICENSE file.
10 #ifndef BASE_BIND_H_
11 #define BASE_BIND_H_
12 #pragma once
14 #include "base/bind_internal.h"
15 #include "base/callback_internal.h"
17 // See base/callback.h for how to use these functions. If reading the
18 // implementation, before proceeding further, you should read the top
19 // comment of base/bind_internal.h for a definition of common terms and
20 // concepts.
22 // IMPLEMENTATION NOTE
23 // Though Bind()'s result is meant to be stored in a Callback<> type, it
24 // cannot actually return the exact type without requiring a large amount
25 // of extra template specializations. The problem is that in order to
26 // discern the correct specialization of Callback<>, Bind would need to
27 // unwrap the function signature to determine the signature's arity, and
28 // whether or not it is a method.
30 // Each unique combination of (arity, function_type, num_prebound) where
31 // function_type is one of {function, method, const_method} would require
32 // one specialization. We eventually have to do a similar number of
33 // specializations anyways in the implementation (see the Invoker<>,
34 // classes). However, it is avoidable in Bind if we return the result
35 // via an indirection like we do below.
37 // TODO(ajwong): We might be able to avoid this now, but need to test.
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
41 // need to crack open bind_internal.h. On the other hand, it makes Bind()
42 // harder to read.
44 namespace base {
46 template <typename Functor>
47 internal::BindStateHolder<
48 internal::BindState<
49 typename internal::FunctorTraits<Functor>::RunnableType,
50 typename internal::FunctorTraits<Functor>::RunType,
51 void()> >
52 Bind(Functor functor) {
53 // Typedefs for how to store and run the functor.
54 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
55 typedef typename internal::FunctorTraits<Functor>::RunType RunType;
57 // Use RunnableType::RunType instead of RunType above because our
58 // checks should below for bound references need to know what the actual
59 // functor is going to interpret the argument as.
60 typedef internal::FunctionTraits<typename RunnableType::RunType>
61 BoundFunctorTraits;
64 return internal::MakeBindStateHolder(
65 new internal::BindState<RunnableType, RunType, void()>(
66 internal::MakeRunnable(functor)));
69 template <typename Functor, typename P1>
70 internal::BindStateHolder<
71 internal::BindState<
72 typename internal::FunctorTraits<Functor>::RunnableType,
73 typename internal::FunctorTraits<Functor>::RunType,
74 void(typename internal::CallbackParamTraits<P1>::StorageType)> >
75 Bind(Functor functor, const P1& p1) {
76 // Typedefs for how to store and run the functor.
77 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
78 typedef typename internal::FunctorTraits<Functor>::RunType RunType;
80 // Use RunnableType::RunType instead of RunType above because our
81 // checks should below for bound references need to know what the actual
82 // functor is going to interpret the argument as.
83 typedef internal::FunctionTraits<typename RunnableType::RunType>
84 BoundFunctorTraits;
86 // Do not allow binding a non-const reference parameter. Non-const reference
87 // parameters are disallowed by the Google style guide. Also, binding a
88 // non-const reference parameter can make for subtle bugs because the
89 // invoked function will receive a reference to the stored copy of the
90 // argument and not the original.
91 COMPILE_ASSERT(
92 !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ),
93 do_not_bind_functions_with_nonconst_ref);
95 // For methods, we need to be careful for parameter 1. We do not require
96 // a scoped_refptr because BindState<> itself takes care of AddRef() for
97 // methods. We also disallow binding of an array as the method's target
98 // object.
99 COMPILE_ASSERT(
100 internal::HasIsMethodTag<RunnableType>::value ||
101 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
102 p1_is_refcounted_type_and_needs_scoped_refptr);
103 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
104 !is_array<P1>::value,
105 first_bound_argument_to_method_cannot_be_array);
107 return internal::MakeBindStateHolder(
108 new internal::BindState<RunnableType, RunType,
109 void(typename internal::CallbackParamTraits<P1>::StorageType)>(
110 internal::MakeRunnable(functor), p1));
113 template <typename Functor, typename P1, typename P2>
114 internal::BindStateHolder<
115 internal::BindState<
116 typename internal::FunctorTraits<Functor>::RunnableType,
117 typename internal::FunctorTraits<Functor>::RunType,
118 void(typename internal::CallbackParamTraits<P1>::StorageType,
119 typename internal::CallbackParamTraits<P2>::StorageType)> >
120 Bind(Functor functor, const P1& p1, const P2& p2) {
121 // Typedefs for how to store and run the functor.
122 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
123 typedef typename internal::FunctorTraits<Functor>::RunType RunType;
125 // Use RunnableType::RunType instead of RunType above because our
126 // checks should below for bound references need to know what the actual
127 // functor is going to interpret the argument as.
128 typedef internal::FunctionTraits<typename RunnableType::RunType>
129 BoundFunctorTraits;
131 // Do not allow binding a non-const reference parameter. Non-const reference
132 // parameters are disallowed by the Google style guide. Also, binding a
133 // non-const reference parameter can make for subtle bugs because the
134 // invoked function will receive a reference to the stored copy of the
135 // argument and not the original.
136 COMPILE_ASSERT(
137 !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
138 is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ),
139 do_not_bind_functions_with_nonconst_ref);
141 // For methods, we need to be careful for parameter 1. We do not require
142 // a scoped_refptr because BindState<> itself takes care of AddRef() for
143 // methods. We also disallow binding of an array as the method's target
144 // object.
145 COMPILE_ASSERT(
146 internal::HasIsMethodTag<RunnableType>::value ||
147 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
148 p1_is_refcounted_type_and_needs_scoped_refptr);
149 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
150 !is_array<P1>::value,
151 first_bound_argument_to_method_cannot_be_array);
152 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
153 p2_is_refcounted_type_and_needs_scoped_refptr);
155 return internal::MakeBindStateHolder(
156 new internal::BindState<RunnableType, RunType,
157 void(typename internal::CallbackParamTraits<P1>::StorageType,
158 typename internal::CallbackParamTraits<P2>::StorageType)>(
159 internal::MakeRunnable(functor), p1, p2));
162 template <typename Functor, typename P1, typename P2, typename P3>
163 internal::BindStateHolder<
164 internal::BindState<
165 typename internal::FunctorTraits<Functor>::RunnableType,
166 typename internal::FunctorTraits<Functor>::RunType,
167 void(typename internal::CallbackParamTraits<P1>::StorageType,
168 typename internal::CallbackParamTraits<P2>::StorageType,
169 typename internal::CallbackParamTraits<P3>::StorageType)> >
170 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
171 // Typedefs for how to store and run the functor.
172 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
173 typedef typename internal::FunctorTraits<Functor>::RunType RunType;
175 // Use RunnableType::RunType instead of RunType above because our
176 // checks should below for bound references need to know what the actual
177 // functor is going to interpret the argument as.
178 typedef internal::FunctionTraits<typename RunnableType::RunType>
179 BoundFunctorTraits;
181 // Do not allow binding a non-const reference parameter. Non-const reference
182 // parameters are disallowed by the Google style guide. Also, binding a
183 // non-const reference parameter can make for subtle bugs because the
184 // invoked function will receive a reference to the stored copy of the
185 // argument and not the original.
186 COMPILE_ASSERT(
187 !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
188 is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
189 is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ),
190 do_not_bind_functions_with_nonconst_ref);
192 // For methods, we need to be careful for parameter 1. We do not require
193 // a scoped_refptr because BindState<> itself takes care of AddRef() for
194 // methods. We also disallow binding of an array as the method's target
195 // object.
196 COMPILE_ASSERT(
197 internal::HasIsMethodTag<RunnableType>::value ||
198 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
199 p1_is_refcounted_type_and_needs_scoped_refptr);
200 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
201 !is_array<P1>::value,
202 first_bound_argument_to_method_cannot_be_array);
203 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
204 p2_is_refcounted_type_and_needs_scoped_refptr);
205 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
206 p3_is_refcounted_type_and_needs_scoped_refptr);
208 return internal::MakeBindStateHolder(
209 new internal::BindState<RunnableType, RunType,
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));
216 template <typename Functor, typename P1, typename P2, typename P3, typename P4>
217 internal::BindStateHolder<
218 internal::BindState<
219 typename internal::FunctorTraits<Functor>::RunnableType,
220 typename internal::FunctorTraits<Functor>::RunType,
221 void(typename internal::CallbackParamTraits<P1>::StorageType,
222 typename internal::CallbackParamTraits<P2>::StorageType,
223 typename internal::CallbackParamTraits<P3>::StorageType,
224 typename internal::CallbackParamTraits<P4>::StorageType)> >
225 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
226 // Typedefs for how to store and run the functor.
227 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
228 typedef typename internal::FunctorTraits<Functor>::RunType RunType;
230 // Use RunnableType::RunType instead of RunType above because our
231 // checks should below for bound references need to know what the actual
232 // functor is going to interpret the argument as.
233 typedef internal::FunctionTraits<typename RunnableType::RunType>
234 BoundFunctorTraits;
236 // Do not allow binding a non-const reference parameter. Non-const reference
237 // parameters are disallowed by the Google style guide. Also, binding a
238 // non-const reference parameter can make for subtle bugs because the
239 // invoked function will receive a reference to the stored copy of the
240 // argument and not the original.
241 COMPILE_ASSERT(
242 !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
243 is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
244 is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
245 is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ),
246 do_not_bind_functions_with_nonconst_ref);
248 // For methods, we need to be careful for parameter 1. We do not require
249 // a scoped_refptr because BindState<> itself takes care of AddRef() for
250 // methods. We also disallow binding of an array as the method's target
251 // object.
252 COMPILE_ASSERT(
253 internal::HasIsMethodTag<RunnableType>::value ||
254 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
255 p1_is_refcounted_type_and_needs_scoped_refptr);
256 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
257 !is_array<P1>::value,
258 first_bound_argument_to_method_cannot_be_array);
259 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
260 p2_is_refcounted_type_and_needs_scoped_refptr);
261 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
262 p3_is_refcounted_type_and_needs_scoped_refptr);
263 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
264 p4_is_refcounted_type_and_needs_scoped_refptr);
266 return internal::MakeBindStateHolder(
267 new internal::BindState<RunnableType, RunType,
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));
275 template <typename Functor, typename P1, typename P2, typename P3, typename P4,
276 typename P5>
277 internal::BindStateHolder<
278 internal::BindState<
279 typename internal::FunctorTraits<Functor>::RunnableType,
280 typename internal::FunctorTraits<Functor>::RunType,
281 void(typename internal::CallbackParamTraits<P1>::StorageType,
282 typename internal::CallbackParamTraits<P2>::StorageType,
283 typename internal::CallbackParamTraits<P3>::StorageType,
284 typename internal::CallbackParamTraits<P4>::StorageType,
285 typename internal::CallbackParamTraits<P5>::StorageType)> >
286 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
287 const P5& p5) {
288 // Typedefs for how to store and run the functor.
289 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
290 typedef typename internal::FunctorTraits<Functor>::RunType RunType;
292 // Use RunnableType::RunType instead of RunType above because our
293 // checks should below for bound references need to know what the actual
294 // functor is going to interpret the argument as.
295 typedef internal::FunctionTraits<typename RunnableType::RunType>
296 BoundFunctorTraits;
298 // Do not allow binding a non-const reference parameter. Non-const reference
299 // parameters are disallowed by the Google style guide. Also, binding a
300 // non-const reference parameter can make for subtle bugs because the
301 // invoked function will receive a reference to the stored copy of the
302 // argument and not the original.
303 COMPILE_ASSERT(
304 !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
305 is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
306 is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
307 is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
308 is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ),
309 do_not_bind_functions_with_nonconst_ref);
311 // For methods, we need to be careful for parameter 1. We do not require
312 // a scoped_refptr because BindState<> itself takes care of AddRef() for
313 // methods. We also disallow binding of an array as the method's target
314 // object.
315 COMPILE_ASSERT(
316 internal::HasIsMethodTag<RunnableType>::value ||
317 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
318 p1_is_refcounted_type_and_needs_scoped_refptr);
319 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
320 !is_array<P1>::value,
321 first_bound_argument_to_method_cannot_be_array);
322 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
323 p2_is_refcounted_type_and_needs_scoped_refptr);
324 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
325 p3_is_refcounted_type_and_needs_scoped_refptr);
326 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
327 p4_is_refcounted_type_and_needs_scoped_refptr);
328 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
329 p5_is_refcounted_type_and_needs_scoped_refptr);
331 return internal::MakeBindStateHolder(
332 new internal::BindState<RunnableType, RunType,
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));
341 template <typename Functor, typename P1, typename P2, typename P3, typename P4,
342 typename P5, typename P6>
343 internal::BindStateHolder<
344 internal::BindState<
345 typename internal::FunctorTraits<Functor>::RunnableType,
346 typename internal::FunctorTraits<Functor>::RunType,
347 void(typename internal::CallbackParamTraits<P1>::StorageType,
348 typename internal::CallbackParamTraits<P2>::StorageType,
349 typename internal::CallbackParamTraits<P3>::StorageType,
350 typename internal::CallbackParamTraits<P4>::StorageType,
351 typename internal::CallbackParamTraits<P5>::StorageType,
352 typename internal::CallbackParamTraits<P6>::StorageType)> >
353 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
354 const P5& p5, const P6& p6) {
355 // Typedefs for how to store and run the functor.
356 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
357 typedef typename internal::FunctorTraits<Functor>::RunType RunType;
359 // Use RunnableType::RunType instead of RunType above because our
360 // checks should below for bound references need to know what the actual
361 // functor is going to interpret the argument as.
362 typedef internal::FunctionTraits<typename RunnableType::RunType>
363 BoundFunctorTraits;
365 // Do not allow binding a non-const reference parameter. Non-const reference
366 // parameters are disallowed by the Google style guide. Also, binding a
367 // non-const reference parameter can make for subtle bugs because the
368 // invoked function will receive a reference to the stored copy of the
369 // argument and not the original.
370 COMPILE_ASSERT(
371 !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
372 is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
373 is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
374 is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
375 is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
376 is_non_const_reference<typename BoundFunctorTraits::A6Type>::value ),
377 do_not_bind_functions_with_nonconst_ref);
379 // For methods, we need to be careful for parameter 1. We do not require
380 // a scoped_refptr because BindState<> itself takes care of AddRef() for
381 // methods. We also disallow binding of an array as the method's target
382 // object.
383 COMPILE_ASSERT(
384 internal::HasIsMethodTag<RunnableType>::value ||
385 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
386 p1_is_refcounted_type_and_needs_scoped_refptr);
387 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
388 !is_array<P1>::value,
389 first_bound_argument_to_method_cannot_be_array);
390 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
391 p2_is_refcounted_type_and_needs_scoped_refptr);
392 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
393 p3_is_refcounted_type_and_needs_scoped_refptr);
394 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
395 p4_is_refcounted_type_and_needs_scoped_refptr);
396 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
397 p5_is_refcounted_type_and_needs_scoped_refptr);
398 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value,
399 p6_is_refcounted_type_and_needs_scoped_refptr);
401 return internal::MakeBindStateHolder(
402 new internal::BindState<RunnableType, RunType,
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));
412 template <typename Functor, typename P1, typename P2, typename P3, typename P4,
413 typename P5, typename P6, typename P7>
414 internal::BindStateHolder<
415 internal::BindState<
416 typename internal::FunctorTraits<Functor>::RunnableType,
417 typename internal::FunctorTraits<Functor>::RunType,
418 void(typename internal::CallbackParamTraits<P1>::StorageType,
419 typename internal::CallbackParamTraits<P2>::StorageType,
420 typename internal::CallbackParamTraits<P3>::StorageType,
421 typename internal::CallbackParamTraits<P4>::StorageType,
422 typename internal::CallbackParamTraits<P5>::StorageType,
423 typename internal::CallbackParamTraits<P6>::StorageType,
424 typename internal::CallbackParamTraits<P7>::StorageType)> >
425 Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
426 const P5& p5, const P6& p6, const P7& p7) {
427 // Typedefs for how to store and run the functor.
428 typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
429 typedef typename internal::FunctorTraits<Functor>::RunType RunType;
431 // Use RunnableType::RunType instead of RunType above because our
432 // checks should below for bound references need to know what the actual
433 // functor is going to interpret the argument as.
434 typedef internal::FunctionTraits<typename RunnableType::RunType>
435 BoundFunctorTraits;
437 // Do not allow binding a non-const reference parameter. Non-const reference
438 // parameters are disallowed by the Google style guide. Also, binding a
439 // non-const reference parameter can make for subtle bugs because the
440 // invoked function will receive a reference to the stored copy of the
441 // argument and not the original.
442 COMPILE_ASSERT(
443 !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value ||
444 is_non_const_reference<typename BoundFunctorTraits::A2Type>::value ||
445 is_non_const_reference<typename BoundFunctorTraits::A3Type>::value ||
446 is_non_const_reference<typename BoundFunctorTraits::A4Type>::value ||
447 is_non_const_reference<typename BoundFunctorTraits::A5Type>::value ||
448 is_non_const_reference<typename BoundFunctorTraits::A6Type>::value ||
449 is_non_const_reference<typename BoundFunctorTraits::A7Type>::value ),
450 do_not_bind_functions_with_nonconst_ref);
452 // For methods, we need to be careful for parameter 1. We do not require
453 // a scoped_refptr because BindState<> itself takes care of AddRef() for
454 // methods. We also disallow binding of an array as the method's target
455 // object.
456 COMPILE_ASSERT(
457 internal::HasIsMethodTag<RunnableType>::value ||
458 !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
459 p1_is_refcounted_type_and_needs_scoped_refptr);
460 COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
461 !is_array<P1>::value,
462 first_bound_argument_to_method_cannot_be_array);
463 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
464 p2_is_refcounted_type_and_needs_scoped_refptr);
465 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
466 p3_is_refcounted_type_and_needs_scoped_refptr);
467 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
468 p4_is_refcounted_type_and_needs_scoped_refptr);
469 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
470 p5_is_refcounted_type_and_needs_scoped_refptr);
471 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value,
472 p6_is_refcounted_type_and_needs_scoped_refptr);
473 COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P7>::value,
474 p7_is_refcounted_type_and_needs_scoped_refptr);
476 return internal::MakeBindStateHolder(
477 new internal::BindState<RunnableType, RunType,
478 void(typename internal::CallbackParamTraits<P1>::StorageType,
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));
488 } // namespace base
490 #endif // BASE_BIND_H_