summaryrefslogtreecommitdiffstats
path: root/base/bind_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Support binding WeakPtr<> to methods with void return types.ajwong@chromium.org2011-05-161-1/+51
| | | | | | | | | | | | | | | This should give functionality similar to ScopedRunnableMethodFactory. Note that binding a WeakPtr only make sense with methods with void return types. If the return type is not void, then it is unclear what the function should return when the pointer is invalidated. This code adds a compile time assert to check the return type. BUG=35223 TEST=unittests Review URL: http://codereview.chromium.org/7015064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85549 0039d316-1c4b-4281-b951-d872f2087c98
* MSVC warns when you try to use Base if T has a private destructor,ajwong@chromium.org2011-04-131-0/+14
| | | | | | | | | | | | | The common pattern for refcounted types. It does this even though no attempt to instantiate Base is made. We disable the warning for this portion of code. BUG=none TEST=try bots. Review URL: http://codereview.chromium.org/6833006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81499 0039d316-1c4b-4281-b951-d872f2087c98
* Callback support for unbound reference and array arguments.ajwong@chromium.org2011-03-241-2/+36
| | | | | | | | | | | Because the callback object uses const An& for the type of the Run() function in argument forwarding, the code breaks for An=T& or An=T[]. This CL adds in code to modify the parameter type to remove duplicate references, and other fun. BUG=35223 TEST=new unittests Review URL: http://codereview.chromium.org/6718021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79239 0039d316-1c4b-4281-b951-d872f2087c98
* Callback support for __fastcall and __stdcall functions.ajwong@chromium.org2011-02-271-0/+21
| | | | | | | | | | | | | | Create FunctionTraits specializations that can unwrap function pointers that are delcared with __fastcall and __stdcall on windows. Only include these in the Windows build. BUG=35223 TEST=new unittests Review URL: http://codereview.chromium.org/6561004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76174 0039d316-1c4b-4281-b951-d872f2087c98
* Emptiness, Reset, and Comparison API for Callbacks.ajwong@chromium.org2011-02-181-12/+0
| | | | | | | | | | | | Since Callback<> is essentially a smartpointer, some introspective APIs are required for sensible usage. BUG=35223 TEST=new unittests Review URL: http://codereview.chromium.org/6507029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75360 0039d316-1c4b-4281-b951-d872f2087c98
* Unified callback system based on tr1::function/tr1::bind and Google's ↵ajwong@chromium.org2011-02-151-0/+597
internal callback code. This callback system allows for creation of functors for normal functions, methods, and const methods. It is a superset of the functionality of NewRunnableMethod, NewRunnableFunction, NewCallback, and CreateFunctor. We support partial binding of function arguments, and also specification of refcounting semantics by wrapping a target object in a wrapper object. BUG=35223 TEST=none Review URL: http://codereview.chromium.org/6109007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74904 0039d316-1c4b-4281-b951-d872f2087c98