| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Also fix some comments that refer to the old Pass() helper.
BUG=557422
TBR=darin@chromium.org
Review URL: https://codereview.chromium.org/1759223002
Cr-Commit-Position: refs/heads/master@{#379162}
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also cleaned up a few stragglers from grepping the source: it's unclear
if these are just building with weird defines, don't build at all, only
build on obscure platforms, or something else… either way, Pass()
itself will be removed shortly after this.
BUG=557422
Review URL: https://codereview.chromium.org/1752233002
Cr-Commit-Position: refs/heads/master@{#378872}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://codereview.chromium.org/1597543002/ )
Reason for revert:
Relanding per discussion: dcheng will fix official builders,
while this patch will remain in-tree to prevent regressions.
Original issue's description:
> Revert of Remove Pass on OS X. (patchset #1 id:1 of https://codereview.chromium.org/1586743002/ )
>
> Reason for revert:
> This has broken compiles on this Mac bot: https://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20Mac/builds/6887
>
> Original issue's description:
> > Remove Pass on OS X.
> >
> > Pass() is a legacy of the original C++03 move emulation implementation.
> > New code should use std::move from <utility>.
> >
> > BUG=557422
> > R=danakj@chromium.org
> >
> > Committed: https://crrev.com/04e90d5757b393018d1b608fd67608d460bb97f6
> > Cr-Commit-Position: refs/heads/master@{#369765}
>
> TBR=danakj@chromium.org,dcheng@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=557422
>
> Committed: https://crrev.com/1c392f8d584a4ccae3264679483d26bdaddb146f
> Cr-Commit-Position: refs/heads/master@{#369787}
TBR=danakj@chromium.org,samuong@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=557422
Review URL: https://codereview.chromium.org/1583283005
Cr-Commit-Position: refs/heads/master@{#369788}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://codereview.chromium.org/1586743002/ )
Reason for revert:
This has broken compiles on this Mac bot: https://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20Mac/builds/6887
Original issue's description:
> Remove Pass on OS X.
>
> Pass() is a legacy of the original C++03 move emulation implementation.
> New code should use std::move from <utility>.
>
> BUG=557422
> R=danakj@chromium.org
>
> Committed: https://crrev.com/04e90d5757b393018d1b608fd67608d460bb97f6
> Cr-Commit-Position: refs/heads/master@{#369765}
TBR=danakj@chromium.org,dcheng@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=557422
Review URL: https://codereview.chromium.org/1597543002
Cr-Commit-Position: refs/heads/master@{#369787}
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pass() is a legacy of the original C++03 move emulation implementation.
New code should use std::move from <utility>.
BUG=557422
R=danakj@chromium.org
Review URL: https://codereview.chromium.org/1586743002
Cr-Commit-Position: refs/heads/master@{#369765}
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pass() is a legacy of the original C++03 move emulation implementation.
New code should use std::move from <utility>.
BUG=557422
R=danakj@chromium.org,sandersd@chromium.org,spang@chromium.org
TBR=reveman@chromium.org,sky@chromium.org
Review URL: https://codereview.chromium.org/1553263002
Cr-Commit-Position: refs/heads/master@{#368009}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://codereview.chromium.org/1564763002/ )
Reason for revert:
Relanding because the build config in question is not covered by any trybots or the default waterfall.
Per the discussion:
1) Keeping this reverted makes things harder to reland, due to the possibility of mid-air collisions.
2) The remaining failures will be fixed shortly afterwards in a followup patch.
Original issue's description:
> Revert of Remove Pass() on Android. (patchset #1 id:1 of https://codereview.chromium.org/1559603002/ )
>
> Reason for revert:
> This breaks compilation, as there are still some callsites of Pass() left.
>
> See Android Cronet Data Reduction Proxy Builder build #961 and onwards: https://build.chromium.org/p/chromium.android/builders/Android%20Cronet%20Data%20Reduction%20Proxy%20Builder/builds/961/steps/compile/logs/stdio
>
> Original issue's description:
> > Remove Pass() on Android.
> >
> > Pass() is a legacy of the original C++03 move emulation implementation.
> > New code should use std::move from <utility>.
> >
> > ❆(੭ु ◜◡‾)੭ु⁾☃❆
> >
> > BUG=557422
> > R=thestig@chromium.org
> >
> > Committed: https://crrev.com/92469c8c4b7da052273dee1a31308663d1dd1e3d
> > Cr-Commit-Position: refs/heads/master@{#367251}
>
> TBR=thestig@chromium.org,dcheng@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=557422
>
> Committed: https://crrev.com/f737edcf768bad1883164ac1c2270df670c7f6a9
> Cr-Commit-Position: refs/heads/master@{#367811}
TBR=thestig@chromium.org,msramek@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=557422
Review URL: https://codereview.chromium.org/1562043002
Cr-Commit-Position: refs/heads/master@{#367820}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://codereview.chromium.org/1559603002/ )
Reason for revert:
This breaks compilation, as there are still some callsites of Pass() left.
See Android Cronet Data Reduction Proxy Builder build #961 and onwards: https://build.chromium.org/p/chromium.android/builders/Android%20Cronet%20Data%20Reduction%20Proxy%20Builder/builds/961/steps/compile/logs/stdio
Original issue's description:
> Remove Pass() on Android.
>
> Pass() is a legacy of the original C++03 move emulation implementation.
> New code should use std::move from <utility>.
>
> ❆(੭ु ◜◡‾)੭ु⁾☃❆
>
> BUG=557422
> R=thestig@chromium.org
>
> Committed: https://crrev.com/92469c8c4b7da052273dee1a31308663d1dd1e3d
> Cr-Commit-Position: refs/heads/master@{#367251}
TBR=thestig@chromium.org,dcheng@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=557422
Review URL: https://codereview.chromium.org/1564763002
Cr-Commit-Position: refs/heads/master@{#367811}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pass() is a legacy of the original C++03 move emulation implementation.
New code should use std::move from <utility>.
❆(੭ु ◜◡‾)੭ु⁾☃❆
BUG=557422
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1559603002
Cr-Commit-Position: refs/heads/master@{#367251}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pass() is a legacy of the original C++03 move emulation implementation.
New code should use std::move from <utility>. ChromeOS is exempt until the
migration there is complete.
❆(੭ु ◜◡‾)੭ु⁾☃❆
BUG=557422
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1548273002 .
Cr-Commit-Position: refs/heads/master@{#367177}
|
|
|
|
|
|
|
|
|
|
| |
BUG=138542
TBR=mark@chromium.org
NOPRESUBMIT=true
Review URL: https://codereview.chromium.org/1538743002
Cr-Commit-Position: refs/heads/master@{#366910}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This renames the macro to be more standard and express its intent and
relationship to DISALLOW_COPY_AND_ASSIGN. It renames the macro to
DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND, as it does what
the old DISALLOW_COPY_AND_ASSIGN does, but also whitelists the type
for Bind/Callback to try move it.
R=Nico
TBR=sky
BUG=561749
Review URL: https://codereview.chromium.org/1501793003
Cr-Commit-Position: refs/heads/master@{#363712}
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This macro existed only to add a Pass() method on scoped_refptr and
skia::RefPtr. We can just use std::move() now, so replace callsites
to Pass() with std::move() and kill the macro.
R=thakis@chromium.org
BUG=557422
Review URL: https://codereview.chromium.org/1477643002
Cr-Commit-Position: refs/heads/master@{#363281}
|
|
|
|
|
|
|
|
|
|
|
| |
Chrome allows the use of C++11 features now, so just use rvalue
references directly.
BUG=543901
Review URL: https://codereview.chromium.org/1407443002
Cr-Commit-Position: refs/heads/master@{#362394}
|
|
|
|
|
|
|
|
| |
R=danakj@chromium.org, thakis@chromium.org
Review URL: https://codereview.chromium.org/1450013002
Cr-Commit-Position: refs/heads/master@{#359949}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gcc -H warned about base/move.h missing an include guard and it was
because the existing include guard didn't encompass all the code in the
file.
This fixes that warning and maybe makes compilations one nanosecond
faster.
The code outside the include guard was added Oct 2014 when fixing bug
418297.
BUG=418297
Review URL: https://codereview.chromium.org/1082263002
Cr-Commit-Position: refs/heads/master@{#325132}
|
|
|
|
|
|
| |
Review URL: https://codereview.chromium.org/1061073004
Cr-Commit-Position: refs/heads/master@{#325107}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
scoped_ptr has
- move constructor.
- move assignment operator.
- .Pass().
This CL adds the same support for scoped_refptr.
The main benefit is reducing unnecessary reference counter updates.
// Example 1
class Foo {
// Without .Pass(), a copy constructor would be called, which
// increments and decrements the reference counter unnecessarily.
// With .Pass(), a move constructor is called which doesn't update
// the reference counter
Foo(scoped_refptr<T> t) : t_(t.Pass()) {}
const scoped_refptr<T> t_;
};
// Example 2
scoped_refptr<Foo> func() {
return scoped_refptr<Foo>(new Foo());
}
main() {
scoped_refptr<Foo> foo;
// The following would be done by a copy assignment operator before,
// but now a move assignment operator will be used instead.
foo = func();
}
// Example 3
class Foo : public base::RefCountedThreadSafe<Foo> {
...
}
void func(scoped_refptr<Foo> foo) {
...
}
main() {
scoped_refptr<Foo> foo(...);
// Because it's moved, the reference counter won't be updated.
massage_loop->PostTask(FROM_HERE,
base::Bind(&func, base::Passed(foo)));
}
Review URL: https://codereview.chromium.org/1076953002
Cr-Commit-Position: refs/heads/master@{#324910}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This brings scoped_ptr closer to unique_ptr without changing the API
of scoped_ptr or exposing rvalue references outside of scoped_ptr yet.
This also adds WARN_UNUSED_RESULT to scoped_ptr::Pass() as well as
Pass() for other move-only-emulation types.
R=jamesr
BUG=418297
Review URL: https://codereview.chromium.org/617933004
Cr-Commit-Position: refs/heads/master@{#298292}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
by SFINAE
So that all move-only types defined with MOVE_ONLY_TYPE_FOR_CPP03 automatically
becomes Passable in bind and callbacks.
BUG=none
R=ajwong@chromium.org, awong
Review URL: https://codereview.chromium.org/26848010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230080 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) Missing member initialization in constructor.
2) More explicit evaluation precedence in an expression.
3) Typos in comments.
BUG=
Review URL: https://chromiumcodereview.appspot.com/12316136
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186355 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
BUG=171118
Review URL: https://codereview.chromium.org/12041050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180253 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RValue&.
For move semantics, we need to create a private "RValue" type that is used to
create move constructors and move operators. Previously, we emulated Boost's
idea of making the RValue type a subclass of the move-only type that doesn't add
any new member fields. We then just reinterpret_cast "this" into a RValue&
depending on the fact that RValue is just a type pun for the move-only type.
This ends up being undefined behavior though (C++98 5.2.10.7).
This change makes use a concrete RValue class that contains a pointer to the
move-only type. With -O2 on clang version 3.2 (trunk 163674), this yields
identical assembly code to the previous implementation. With -O0, we generate
2 more instructions to allocate and initialize the temporary RValue struct's
object field when calling Pass().
This should be acceptable. The snowman says so ☃.
BUG=155436
Review URL: https://chromiumcodereview.appspot.com/11078014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161945 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
CID_COUNT=1
CID=103292
BUG=none
TEST=none
R=groby
Review URL: https://chromiumcodereview.appspot.com/9380051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125070 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ScopedVector move-only.
Also:
* Add a lot of documentation explaining what this macro does.
* Change the implementation of RValue so it cannot be instantiated.
The change to always use RValue& makes for more efficent code in debug builds. Looking at the disassembly for a simple use case (calling a function with one parameter), it removes the creation of one temporary.
BUG=96118
TEST=new unittests. exist code still compiles.
Review URL: https://chromiumcodereview.appspot.com/9207021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118388 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
confusing people.
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/4682003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65444 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
|
|
BUG=521
TEST=none
Review URL: http://codereview.chromium.org/1079007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42153 0039d316-1c4b-4281-b951-d872f2087c98
|