summaryrefslogtreecommitdiffstats
path: root/base/bind.h.pump
Commit message (Collapse)AuthorAgeFilesLines
* Add quick reference for bind/callback usage.brettw@chromium.org2012-07-121-5/+16
| | | | | | Review URL: https://chromiumcodereview.appspot.com/10692147 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146425 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the rest of #pragma once in one big CL.ajwong@chromium.org2012-07-111-1/+0
| | | | | | | | | For context see this thread: https://groups.google.com/a/chromium.org/forum/?fromgroups#!topic/chromium-dev/RMcVNGjB4II TBR=thakis,pkasting,jam git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146163 0039d316-1c4b-4281-b951-d872f2087c98
* Retry 114494 - Remove BindStateHolder and have Bind() return a Callback<> ↵ajwong@chromium.org2011-12-201-7/+10
| | | | | | | | | | | | | | | object directly." This removes some complexity and also fixes a bug where if you call Bind() with the result of Bind(), the resulting Callback would only be valid during the first call. Ouch. Also makes the static type checking a bit more strict when assigning into a Callback<>. BUG=none TEST=new unittests Review URL: http://codereview.chromium.org/8915024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115045 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 114494 - Remove BindStateHolder and have Bind() return a Callback<> ↵sail@chromium.org2011-12-141-10/+7
| | | | | | | | | | | | | | | | | object directly. This removes some complexity and also fixes a bug where if you call Bind() with the result of Bind(), the resulting Callback would only be valid during the first call. Ouch. BUG=none TEST=new unittests Review URL: http://codereview.chromium.org/8738001 TBR=ajwong@chromium.org Review URL: http://codereview.chromium.org/8914022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114495 0039d316-1c4b-4281-b951-d872f2087c98
* Remove BindStateHolder and have Bind() return a Callback<> object directly.ajwong@chromium.org2011-12-141-7/+10
| | | | | | | | | | | | This removes some complexity and also fixes a bug where if you call Bind() with the result of Bind(), the resulting Callback would only be valid during the first call. Ouch. BUG=none TEST=new unittests Review URL: http://codereview.chromium.org/8738001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114494 0039d316-1c4b-4281-b951-d872f2087c98
* Increase Bind/Callback Arity from 6 -> 7.ajwong@chromium.org2011-11-281-1/+19
| | | | | | | | | | | | | | A few functions need this and the expected compile-speed impact is low. We should be careful when raising this number higher. If you're binding a function that has more parameters than this supports, consider refactoring your API to use a parameter struct or something. Template equation: (n^2 + 26n) / 2 Template growth: 96 -> 116 types. BUG=98542 TEST=try bots Review URL: http://codereview.chromium.org/8728010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111788 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Increase Bind/Callback Arity from 6 -> 11: These go to eleven."ajwong@chromium.org2011-11-241-1/+1
| | | | | | | | | | | | | | | This reverts r111410. Doing this increased Win builder cycle time by about 10s on incrementals (eyeballed from stats dashboard). Alas, 11 proved to be too high for us. BUG=98542 TEST=none Review URL: http://codereview.chromium.org/8682030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111463 0039d316-1c4b-4281-b951-d872f2087c98
* Increase Bind/Callback Arity from 6 -> 11: These go to eleven.ajwong@chromium.org2011-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is only for a build time stress test only. I will revert back to 6 after getting the data. 11 allows for binding of 11 arguments to a function, and 10 arguments to a method. 10 seemed like a nice round number to try (MSVC's tr1::bind() only supports 10). Template Growth rate (n == arity): bind.h: n bind_internal.h: (n^2 + 20n)/2 bind_internal_win.h: n callback.h: n Template growth equation: (n^2 + 26n) / 2 Template growth: 96 -> 203 types BUG=98542 TEST=try bots. Then we get to watch the bot cycle times. Review URL: http://codereview.chromium.org/8682015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111410 0039d316-1c4b-4281-b951-d872f2087c98
* Callback API Change: Reimplement Bind(); support IgnoreResult, full ↵ajwong@chromium.org2011-11-211-42/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | currying, and use less types. The main API change IgnoreResult() and fully currying. See unittest for what the new API looks like. The rest of the changes are done to support that. Previously, IgnoreReturn could not be used with WeakPtr<> Bind()s as it was applied after the fact to the Callback object. Now, IgnoreResult() wraps the function like Unretained(). As an incidental benefit, the new implementation gave us fully currying for free. Also, the new implementation scales better when supporting higher arities of functions. The new type growth is: (n^2 + 20n) / 2 as opposed to (3n^2 + 17n) / 2 where n == arity. For n = 6 and n=10, the new implementation has 81 and 155 templates respectively. The old implementation had 105 and 235 templates respectively. BUG=35233,98919,98542 TEST=existing unittests Review URL: http://codereview.chromium.org/8483003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110975 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting as an experiment to determine if this caused increased Win buildjhawkins@chromium.org2011-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | times. Revert 105754 - base::Bind: Increase the arity to 7. This is required by a CL I have in the works. Stats from builds of Release Chrome target with -j12: Build time: -0.2%, within the noise. Size: No change in size of chrome binary. BUG=98542 TEST=none R=ajwong@chromium.org,akalin@chromium.org,willchan@chromium.org Review URL: http://codereview.chromium.org/8306008 TBR=jhawkins@chromium.org Review URL: http://codereview.chromium.org/8344065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106386 0039d316-1c4b-4281-b951-d872f2087c98
* base::Bind: Increase the arity to 7.jhawkins@chromium.org2011-10-161-1/+1
| | | | | | | | | | | | | | | | | This is required by a CL I have in the works. Stats from builds of Release Chrome target with -j12: Build time: -0.2%, within the noise. Size: No change in size of chrome binary. BUG=98542 TEST=none R=ajwong@chromium.org,akalin@chromium.org,willchan@chromium.org Review URL: http://codereview.chromium.org/8306008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105754 0039d316-1c4b-4281-b951-d872f2087c98
* Allow Bind() to take a Callback<> and bind all its free parameters.ajwong@chromium.org2011-09-301-0/+20
| | | | | | | | | | | | | | | | Basically, turns base::Callback<void(...)> to base::Closure. It turns out there are a number of use caess where an API takes a callback, and then wants to invoke the Callback on another thread. This piece of syntactic sugar removes the need for custom helper functions. This isn't quite full currying, however it is much simpler to implement. BUG=87287 TEST=none Review URL: http://codereview.chromium.org/8073012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103446 0039d316-1c4b-4281-b951-d872f2087c98
* Callback: De-inline CallbackBase, and move to callback_helpers -> ↵ajwong@chromium.org2011-02-181-1/+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/+1
| | | | | | | | | | 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-1/+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
* Unified callback system based on tr1::function/tr1::bind and Google's ↵ajwong@chromium.org2011-02-151-0/+71
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