Home | History | Annotate | Download | only in base

Lines Matching refs:Bind

5 #include "base/bind.h"
166 // Some test functions that we can Bind to.
264 Callback<int()> c0 = Bind(&Sum, 32, 16, 8, 4, 2, 1);
267 Callback<int(int)> c1 = Bind(&Sum, 32, 16, 8, 4, 2);
270 Callback<int(int,int)> c2 = Bind(&Sum, 32, 16, 8, 4);
273 Callback<int(int,int,int)> c3 = Bind(&Sum, 32, 16, 8);
276 Callback<int(int,int,int,int)> c4 = Bind(&Sum, 32, 16);
279 Callback<int(int,int,int,int,int)> c5 = Bind(&Sum, 32);
282 Callback<int(int,int,int,int,int,int)> c6 = Bind(&Sum);
288 Callback<int(int,int,int,int,int,int)> c6 = Bind(&Sum);
291 Callback<int(int,int,int,int,int)> c5 = Bind(c6, 32);
294 Callback<int(int,int,int,int)> c4 = Bind(c5, 16);
297 Callback<int(int,int,int)> c3 = Bind(c4, 8);
300 Callback<int(int,int)> c2 = Bind(c3, 4);
303 Callback<int(int)> c1 = Bind(c2, 2);
306 Callback<int()> c0 = Bind(c1, 1);
310 // Test that currying the rvalue result of another Bind() works correctly.
311 // - rvalue should be usable as argument to Bind().
315 Closure cb = base::Bind(&TakesACallback, base::Bind(&PtrArgSet, &n));
317 // If we implement Bind() such that the return value has auto_ptr-like
346 Closure normal_cb = Bind(&VoidFunc0);
348 Bind(&PolymorphicIdentity<NoRef*>, &no_ref_);
352 Closure method_cb = Bind(&HasRef::VoidMethod0, &has_ref_);
353 Closure method_refptr_cb = Bind(&HasRef::VoidMethod0,
355 Closure const_method_nonconst_obj_cb = Bind(&HasRef::VoidConstMethod0,
357 Closure const_method_const_obj_cb = Bind(&HasRef::VoidConstMethod0,
366 Closure virtual_set_cb = Bind(&Parent::VirtualSet, &child);
371 Closure non_virtual_set_cb = Bind(&Parent::NonVirtualSet, &child);
389 Callback<int()> normal_cb = Bind(&IntFunc0);
390 Callback<int()> method_cb = Bind(&HasRef::IntMethod0, &has_ref_);
392 Bind(&HasRef::IntConstMethod0, &has_ref_);
394 Bind(&HasRef::IntConstMethod0, const_has_ref_ptr_);
416 Closure normal_func_cb = Bind(IgnoreResult(&IntFunc0));
420 Bind(IgnoreResult(&HasRef::IntMethod0), &has_ref_);
424 Bind(IgnoreResult(&HasRef::IntConstMethod0), &has_ref_);
431 Bind(IgnoreResult(&NoRef::IntMethod0), weak_factory.GetWeakPtr());
435 Bind(IgnoreResult(&NoRef::IntConstMethod0), weak_factory.GetWeakPtr());
457 Callback<int()> bind_primitive_cb = Bind(&Identity, n);
461 Bind(&PolymorphicIdentity<int*>, &n);
464 Callback<int()> bind_int_literal_cb = Bind(&Identity, 3);
468 Bind(&CStringIdentity, "hi");
472 Bind(&PolymorphicIdentity<int>, 4);
477 Callback<int()> bind_object_cb = Bind(&UnwrapNoRefParent, p);
482 Bind(&PolymorphicIdentity<IncompleteType*>, incomplete_ptr);
487 Callback<int()> bind_promotes_cb = Bind(&UnwrapNoRefParent, c);
492 Bind(&UnwrapNoRefParentPtr, &c);
497 Bind(&UnwrapNoRefParentConstRef, c);
510 Callback<void(int)> unbound_value_cb = Bind(&VoidPolymorphic<int>::Run);
511 Callback<void(int*)> unbound_pointer_cb = Bind(&VoidPolymorphic<int*>::Run);
512 Callback<void(int&)> unbound_ref_cb = Bind(&VoidPolymorphic<int&>::Run);
514 Bind(&VoidPolymorphic<const int&>::Run);
516 Bind(&VoidPolymorphic<int[]>::Run);
518 Bind(&VoidPolymorphic<int[2]>::Run);
520 Bind(&VoidPolymorphic<int[][2]>::Run);
523 Bind(&VoidPolymorphic<int, int&>::Run, 1);
530 Callback<void(int&)> unbound_ref_cb = Bind(&RefArgSet);
543 Callback<int()> ref_copies_cb = Bind(&Identity, ref_n);
548 Callback<int()> const_ref_copies_cb = Bind(&Identity, const_ref_n);
561 Callback<int()> array_cb = Bind(&ArrayGet, array, 1);
564 Callback<int()> const_array_cb = Bind(&ArrayGet, *const_array_ptr, 1);
603 Bind(&NoRef::VoidMethod0, Unretained(&no_ref_));
607 Bind(&NoRef::VoidConstMethod0, Unretained(&no_ref_));
611 Bind(&NoRef::VoidConstMethod0, Unretained(const_no_ref_ptr_));
629 Bind(&NoRef::VoidMethod0, weak_factory.GetWeakPtr());
633 Bind(&NoRef::VoidConstMethod0, const_weak_factory.GetWeakPtr());
637 Bind(&NoRef::VoidConstMethod0, const_weak_factory.GetWeakPtr());
641 Bind(&FunctionWithWeakFirstParam, weak_factory.GetWeakPtr());
662 Callback<int()> copy_cb = Bind(&Identity, n);
663 Callback<int()> const_ref_cb = Bind(&Identity, ConstRef(n));
674 Bind(&GetCopies, ConstRef(counter));
682 // due to a bug in base::Bind(), there's an extra call when invoking the
691 Bind(&FunctionWithScopedRefptrFirstParam, base::ConstRef(refptr), 1);
703 Bind(&PolymorphicIdentity<DeleteCounter*>, Owned(counter));
713 Bind(&DeleteCounter::VoidMethod0, Owned(counter));
732 Bind(&PassThru<scoped_ptr<DeleteCounter> >, Passed(&ptr));
744 Bind(&PassThru<scoped_ptr<DeleteCounter> >,
764 Bind(&PassThru<scoped_ptr<DeleteCounter> >);
775 Bind(&PassThru<std::unique_ptr<DeleteCounter>>, Passed(&ptr));
787 Bind(&PassThru<std::unique_ptr<DeleteCounter>>,
807 cb_unbound = Bind(&PassThru<std::unique_ptr<DeleteCounter>>);
824 Bind(&VoidPolymorphic<CopyCounter>::Run, counter);
831 Bind(&VoidPolymorphic<CopyCounter>::Run);
840 Bind(&VoidPolymorphic<CopyCounter>::Run);
862 // - Can bind a __fastcall function.
863 // - Can bind a __stdcall function.
865 Callback<int()> fastcall_cb = Bind(&FastCallFunc, 1);
868 Callback<int()> stdcall_cb = Bind(&StdCallFunc, 2);
879 EXPECT_DEATH(base::Bind(null_cb, 42), "");