summaryrefslogtreecommitdiffstats
path: root/base/move.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove move-only-type whitelists in CallbackParamTraits and CallbackForward ↵kinuko@chromium.org2013-10-221-0/+11
| | | | | | | | | | | | | | 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
* Small fixes around the codesergeygs@chromium.org2013-03-061-6/+6
| | | | | | | | | | | | | 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
* Fix scoped_ptr<T[]> to disallow construction and reset from NULL.dcheng@chromium.org2013-02-021-1/+1
| | | | | | | | 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
* Fix move.h's to use a concrete RValue carrier object rather than hacking a ↵ajwong@chromium.org2012-10-151-34/+30
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Coverity: Fix a pass-by-value.jhawkins@chromium.org2012-03-061-2/+2
| | | | | | | | | | | | 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
* Transfer the C++03 move-only type emulation into base/move.h and also make ↵ajwong@chromium.org2012-01-201-0/+211
| | | | | | | | | | | | | | | | | 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
* Erase base/move. The pattern we use is pass by const ref and this is ↵brettw@chromium.org2010-11-081-55/+0
| | | | | | | | | | 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
* `#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
* Notification for battery with <= 15 minutes remaining.seanparent@google.com2010-03-191-0/+54
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