Home | History | Annotate | Download | only in base

Lines Matching refs:Callback

11 #include "base/callback.h"
312 void TakesACallback(const Closure& callback) {
313 callback.Run();
349 // Sanity check that we can instantiate a callback for each arity.
351 Callback<int()> c0 = Bind(&Sum, 32, 16, 8, 4, 2, 1);
354 Callback<int(int)> c1 = Bind(&Sum, 32, 16, 8, 4, 2);
357 Callback<int(int,int)> c2 = Bind(&Sum, 32, 16, 8, 4);
360 Callback<int(int,int,int)> c3 = Bind(&Sum, 32, 16, 8);
363 Callback<int(int,int,int,int)> c4 = Bind(&Sum, 32, 16);
366 Callback<int(int,int,int,int,int)> c5 = Bind(&Sum, 32);
369 Callback<int(int,int,int,int,int,int)> c6 = Bind(&Sum);
373 // Test the Currying ability of the Callback system.
375 Callback<int(int,int,int,int,int,int)> c6 = Bind(&Sum);
378 Callback<int(int,int,int,int,int)> c5 = Bind(c6, 32);
381 Callback<int(int,int,int,int)> c4 = Bind(c5, 16);
384 Callback<int(int,int,int)> c3 = Bind(c4, 8);
387 Callback<int(int,int)> c2 = Bind(c3, 4);
390 Callback<int(int)> c1 = Bind(c2, 2);
393 Callback<int()> c0 = Bind(c1, 1);
399 // - multiple runs of resulting Callback remain valid.
407 // constructon of a Callback object on the first call.
434 Callback<NoRef*()> normal_non_refcounted_cb =
476 Callback<int()> normal_cb = Bind(&IntFunc0);
477 Callback<int()> method_cb = Bind(&HasRef::IntMethod0, &has_ref_);
478 Callback<int()> const_method_nonconst_obj_cb =
480 Callback<int()> const_method_const_obj_cb =
544 Callback<int()> bind_primitive_cb = Bind(&Identity, n);
547 Callback<int*()> bind_primitive_pointer_cb =
551 Callback<int()> bind_int_literal_cb = Bind(&Identity, 3);
554 Callback<const char*()> bind_string_literal_cb =
558 Callback<int()> bind_template_function_cb =
564 Callback<int()> bind_object_cb = Bind(&UnwrapNoRefParent, p);
568 Callback<IncompleteType*()> bind_incomplete_ptr_cb =
574 Callback<int()> bind_promotes_cb = Bind(&UnwrapNoRefParent, c);
578 Callback<int()> bind_pointer_promotes_cb =
583 Callback
597 Callback<void(int)> unbound_value_cb = Bind(&VoidPolymorphic<int>::Run);
598 Callback<void(int*)> unbound_pointer_cb = Bind(&VoidPolymorphic<int*>::Run);
599 Callback<void(int&)> unbound_ref_cb = Bind(&VoidPolymorphic<int&>::Run);
600 Callback<void(const int&)> unbound_const_ref_cb =
602 Callback<void(int[])> unbound_unsized_array_cb =
604 Callback<void(int[2])> unbound_sized_array_cb =
606 Callback<void(int[][2])> unbound_array_of_arrays_cb =
609 Callback<void(int&)> unbound_ref_with_bound_arg =
614 // - Original parameter is modified by callback.
617 Callback<void(int&)> unbound_ref_cb = Bind(&RefArgSet);
630 Callback<int()> ref_copies_cb = Bind(&Identity, ref_n);
635 Callback<int()> const_ref_copies_cb = Bind(&Identity, const_ref_n);
648 Callback<int()> array_cb = Bind(&ArrayGet, array, 1);
651 Callback<int()> const_array_cb = Bind(&ArrayGet, *const_array_ptr, 1);
667 Callback<void()> method_cb =
671 Callback<void()> const_method_cb =
675 Callback<void()> const_method_const_ptr_cb =
705 Callback<int(int)> normal_func_cb =
727 Callback<int()> copy_cb = Bind(&Identity, n);
728 Callback<int()> const_ref_cb = Bind(&Identity, ConstRef(n));
740 Callback<int()> all_const_ref_cb =
754 Callback<int()> scoped_refptr_const_ref_cb =
764 // If we don't capture, delete happens on Callback destruction/reset.
766 Callback<DeleteCounter*()> no_capture_cb =
793 // - Using Passed() gives Callback Ownership.
794 // - Ownership is transferred from Callback to callee on the first Run().
795 // - Callback supports unbound arguments.
814 Callback<TypeParam()> callback = Bind(&PassThru<TypeParam>, Passed(&ptr));
818 // If we never invoke the Callback, it retains ownership and deletes.
819 callback.Reset();
825 Callback<TypeParam()> callback = Bind(
829 // If we never invoke the Callback, it retains ownership and deletes.
830 callback.Reset();
838 Callback<TypeParam()> callback =
840 TypeParam result = callback.Run();
845 callback.Reset();
857 Callback<TypeParam(TypeParam)> cb_unbound = Bind(&PassThru<TypeParam>);
873 // Test that a vector containing move-only types can be used with Callback.
881 base::Callback<MoveOnlyVector()> bound_cb =
887 base::Callback<MoveOnlyVector(MoveOnlyVector)> unbound_cb =
953 // of a variant of Callback.
1069 base::Callback<void(int)> cb =
1077 // Callback construction and assignment tests.
1079 // - Assignment from other callback should only cause one ref
1096 Callback<int()> fastcall_cb = Bind(&FastCallFunc, 1);
1099 Callback
1108 base::Callback<void(int)> null_cb;