summaryrefslogtreecommitdiffstats
path: root/base/callback.h
Commit message (Collapse)AuthorAgeFilesLines
* Callbacks: Replumb the type-inference.ajwong@chromium.org2011-02-191-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for attempting to support __stdcall, __fastcall, etc., break apart the templates so that instead of having one set of InvokerNs per type of function pointer, only have one per syntactic method of invocation. This lets the number of template specializations scale better. Previously, for each type of function pointer, we needed sum(1...arity) InvokerN specializations. There were 3 types (function, method, const method). The Windows calling conventions would have added another 2. in this method, we have 2 sets of InvokerN templates, and 1 set of FunctionTraits templates for each type. We only need (arity) number of FunctionTraits templates, so this is a net win. For our 6-arity system, it should go from 5 types * (1+2+3+4+5+6) InvokerNs = 105 specializations to 5 types * 6 FunctionTraits + 2 calling_syntaxes * (1+2+3+4+5+6) InvokerNs = 72 specializations This puts a bit more work on the compiler, but...hey, better it than the reader of the code. BUG=35223 TEST=none Review URL: http://codereview.chromium.org/6538045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75482 0039d316-1c4b-4281-b951-d872f2087c98
* Callback: De-inline CallbackBase, and move to callback_helpers -> ↵ajwong@chromium.org2011-02-181-44/+1
| | | | | | | | | | | | | | | callback_internal.h We can re-inline later if it starts being an issue. BUG=none TEST=unit-tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=75443 Review URL: http://codereview.chromium.org/6542026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75464 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Callback: De-inline CallbackBase, and move to callback_helpers -> ↵ajwong@chromium.org2011-02-181-1/+44
| | | | | | | | | | callback_internal.h" This reverts commit r75443. TBR=akalin git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75445 0039d316-1c4b-4281-b951-d872f2087c98
* Callback: De-inline CallbackBase, and move to callback_helpers -> ↵ajwong@chromium.org2011-02-181-44/+1
| | | | | | | | | | | | | callback_internal.h We can re-inline later if it starts being an issue. BUG=none TEST=unit-tests Review URL: http://codereview.chromium.org/6542026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75443 0039d316-1c4b-4281-b951-d872f2087c98
* Emptiness, Reset, and Comparison API for Callbacks.ajwong@chromium.org2011-02-181-80/+122
| | | | | | | | | | | | 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-206/+434
| | | | | | | | | | | | | | | 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
* Take 3: Reland 69237 - Fix raw_scoped_refptr_mismatch_checker.h."willchan@chromium.org2010-12-151-2/+3
| | | | | | | | | | | If this one fails, I'm just reverting and calling it quits for tonight. BUG=28083 TEST=builds Review URL: http://codereview.chromium.org/5844002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69245 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 69243 - Reland 69237 - Fix raw_scoped_refptr_mismatch_checker.h.willchan@chromium.org2010-12-151-3/+2
| | | | | | | | | | | | | | | | | | | | Damn, missed a unittest. BUG=28083 TEST=none Review URL: http://codereview.chromium.org/3549010 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/5885001 TBR=phajdan.jr@chromium.org Review URL: http://codereview.chromium.org/5887001 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/5888001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69244 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 69237 - Fix raw_scoped_refptr_mismatch_checker.h.willchan@chromium.org2010-12-151-2/+3
| | | | | | | | | | | | | | | BUG=28083 TEST=none Review URL: http://codereview.chromium.org/3549010 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/5885001 TBR=phajdan.jr@chromium.org Review URL: http://codereview.chromium.org/5887001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69243 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 69237 - Fix raw_scoped_refptr_mismatch_checker.h.phajdan.jr@chromium.org2010-12-151-3/+2
| | | | | | | | | | | | BUG=28083 TEST=none Review URL: http://codereview.chromium.org/3549010 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/5885001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69239 0039d316-1c4b-4281-b951-d872f2087c98
* Fix raw_scoped_refptr_mismatch_checker.h.willchan@chromium.org2010-12-151-2/+3
| | | | | | | | | BUG=28083 TEST=none Review URL: http://codereview.chromium.org/3549010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69237 0039d316-1c4b-4281-b951-d872f2087c98
* `#pragma once` for app, base, chrome, gfx, ipc, net, skia, viewsthakis@chromium.org2010-07-261-0/+1
| | | | | | | | | BUG=50273 TEST=everything still builds, build is 10% faster on windows, same speed on mac/linux TBR: erg git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53716 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 49985 - dohthakis@chromium.org2010-06-161-1/+1
| | | | | | | TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/2813012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49999 0039d316-1c4b-4281-b951-d872f2087c98
* dohthakis@chromium.org2010-06-161-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49985 0039d316-1c4b-4281-b951-d872f2087c98
* Pulled out Callback code into base/callback.h. This is the first step ↵akalin@chromium.org2010-02-191-0/+252
towards redoing the Callback interfaces. Added and removed includes as needed. BUG=35223 TEST=trybots Review URL: http://codereview.chromium.org/646061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39419 0039d316-1c4b-4281-b951-d872f2087c98