| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Kill off NewRunnableMethod() and remove silly declarations of unused ScopedRunnableMethodFactory(s).
BUG=none
TEST=existing.
Review URL: http://codereview.chromium.org/9034032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116250 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
R=groby,ajwong
Review URL: http://codereview.chromium.org/8960011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116072 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
scoped_array....
-- This time for sure. --
Add Pass(), which implements move semantics, to scoped_ptr, scoped_array, and
scoped_ptr_malloc.
This modification to the scopers implements the "moveable but not copyable"
semantics that were introduced in C++11's unique_ptr<>.
With this, is now possible to use scopers as an argument type or a return type.
This signifies, in the type system, transfer of ownership into a function or out
of a function respectively. Calling, or returning such a function MUST use the
temporary resulting from a function or explicit cast.
This distinction makes it possible to avoid the implicit ownership transfer
issues of auto_ptr, but still allow us to have compiler enforced ownership
transfer.
Also adds a Passed() helper that allows using a scoper with Bind().
Original Review URL: http://codereview.chromium.org/8774032
BUG=96118
TEST=new unittests
Review URL: http://codereview.chromium.org/9018037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115607 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to scoped_ptr, scoped_array....
(This undoes the revert in r114247. Win canaries still can't link, but
this change has been deemed safe).
Add Pass(), which implements move semantics, to scoped_ptr, scoped_array, and
scoped_ptr_malloc.
This modification to the scopers implements the "moveable but not copyable"
semantics that were introduced in C++11's unique_ptr<>.
With this, is now possible to use scopers as an argument type or a return type.
This signifies, in the type system, transfer of ownership into a function or out
of a function respectively. Calling, or returning such a function MUST use the
temporary resulting from a function or explicit cast.
This distinction makes it possible to avoid the implicit ownership transfer
issues of auto_ptr, but still allow us to have compiler enforced ownership
transfer.
Also adds a Passed() helper that allows using a scoper with Bind().
BUG=96118
TEST=new unittests
Review URL: http://codereview.chromium.org/9021032
TBR=ajwong@chromium.org
Review URL: http://codereview.chromium.org/8949057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115444 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
scoped_array....
(This undoes the revert in r114247. Win canaries still can't link, but
this change has been deemed safe).
Add Pass(), which implements move semantics, to scoped_ptr, scoped_array, and
scoped_ptr_malloc.
This modification to the scopers implements the "moveable but not copyable"
semantics that were introduced in C++11's unique_ptr<>.
With this, is now possible to use scopers as an argument type or a return type.
This signifies, in the type system, transfer of ownership into a function or out
of a function respectively. Calling, or returning such a function MUST use the
temporary resulting from a function or explicit cast.
This distinction makes it possible to avoid the implicit ownership transfer
issues of auto_ptr, but still allow us to have compiler enforced ownership
transfer.
Also adds a Passed() helper that allows using a scoper with Bind().
BUG=96118
TEST=new unittests
Review URL: http://codereview.chromium.org/9021032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115441 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
scoped_ptr, scoped_ar..."
This reverts commit r113922.
Win Canary has been failing to link due to OOM since the weekend. While this was not the original cause, it might be making things worse. Speculatively remove for now.
Also changes render_widge_host_view to use Owned() instead of Passed().
BUG=none
TEST=existing.
Review URL: http://codereview.chromium.org/8931008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114247 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
semantics, to scoped_ptr..."
This reverts commit r114228.
BUG=none
TEST=none
TBR=acolwell
Review URL: http://codereview.chromium.org/8929008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114230 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
scoped_ptr, scoped_array...."
This reverts commit r113922.
Win Canary has been failing to link due to OOM since the weekend. While this was not the original cause, it might be making things worse. Speculatively remove for now.
BUG=none
TEST=none
TBR=kareng
Review URL: http://codereview.chromium.org/8932006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114228 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
R=ajwong
Review URL: http://codereview.chromium.org/8919016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114122 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
scoped_array....
Add Pass(), which implements move semantics, to scoped_ptr, scoped_array, and scoped_ptr_malloc.
This modification to the scopers implements the "moveable but not copyable" semantics that were introduced in C++11's unique_ptr<>.
With this, is now possible to use scopers as an argument type or a return type. This signifies, in the type system, transfer of ownership into a function or out of a function respectively. Calling, or returning such a function MUST use the temporary resultin
This distinction makes it possible to avoid the implicit ownership transfer issues of auto_ptr, but still allow us to have compiler enforced ownership transfer.
Also adds a Passed() helper that allows using a scoper with Bind().
BUG=96118
TEST=new unittests
Original review URL: http://codereview.chromium.org/8774032
Review URL: http://codereview.chromium.org/8897005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113922 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
scoped_array, and scoped_ptr_malloc.
This modification to the scopers implements the "moveable but not copyable" semantics that were introduced in C++11's unique_ptr<>.
With this, is now possible to use scopers as an argument type or a return type. This signifies, in the type system, transfer of ownership into a function or out of a function respectively. Calling, or returning such a function MUST use the temporary resulting from the scoper's Pass() function. You CANNOT just pass the scoper by copy as there is still no copy constructor or assignment operator; trying to do so will yield a compilation error.
This distinction makes it possible to avoid the implicit ownership transfer issues of auto_ptr, but still allow us to have compiler enforced ownership transfer.
Also adds a Passed() helper that allows using a scoper with Bind().
BUG=96118
TEST=new unittests
Review URL: http://codereview.chromium.org/8774032
TBR=ajwong@chromium.org
Review URL: http://codereview.chromium.org/8890060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113738 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and scoped_ptr_malloc.
This modification to the scopers implements the "moveable but not copyable" semantics that were introduced in C++11's unique_ptr<>.
With this, is now possible to use scopers as an argument type or a return type. This signifies, in the type system, transfer of ownership into a function or out of a function respectively. Calling, or returning such a function MUST use the temporary resulting from the scoper's Pass() function. You CANNOT just pass the scoper by copy as there is still no copy constructor or assignment operator; trying to do so will yield a compilation error.
This distinction makes it possible to avoid the implicit ownership transfer issues of auto_ptr, but still allow us to have compiler enforced ownership transfer.
Also adds a Passed() helper that allows using a scoper with Bind().
BUG=96118
TEST=new unittests
Review URL: http://codereview.chromium.org/8774032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113722 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
declaration.
The first bit is designed to ensure that the correctness of callback_forward.h is tested by the callback unittests. The second bit is designed to increase the likelihood of developers actually using callback_forward.h as intended.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/8846003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113472 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
R=csilv@chromium.org,ajwong@chromium.org
Review URL: http://codereview.chromium.org/8113025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103978 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we were using the base class's comparator to check equality, which allows us to make comparisons across callbacks of different types. This disallows such a thing.
BUG=none
TEST=New no-compile test.
Review URL: http://codereview.chromium.org/7780016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100565 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Required because we abstract the storage of the funciton pointer out using
a reinterpret_cast to reduce template bloat. This effectively readds the
failure that would have happened had we stored the function pointer directly
in the template class.
BUG=86008
TEST=new unittests.
Review URL: http://codereview.chromium.org/7241015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90525 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none. Comment change.
Review URL: http://codereview.chromium.org/7019024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85806 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
BUG=82098
TEST=none
Review URL: http://codereview.chromium.org/7003003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85003 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/6882042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82127 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
change.
BUG=chromium-os:13247
TEST=Manual
Review URL: http://codereview.chromium.org/6835004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81574 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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_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
|
|
|
|
|
|
|
|
|
|
| |
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_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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49985 0039d316-1c4b-4281-b951-d872f2087c98
|
|
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
|