| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
TBR=bungeman@chromium.org
Review URL: https://codereview.chromium.org/11344041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165007 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
| |
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165006 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To give up ownership of this object to the autorelease pool:
scoped_nsobject<MyClass> obj;
you could write:
[[obj retain] autorelease];
obj.reset();
or:
[obj.release() autorelease];
This CL makes it more explicit:
obj.autorelease();
BUG=none
Review URL: https://chromiumcodereview.appspot.com/11066079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161750 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=none
Review URL: https://chromiumcodereview.appspot.com/11028044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160570 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also fixed some possible leaks related by scoped_refptr::release.
See https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/b5thcBgubsM
BUG=
Review URL: https://chromiumcodereview.appspot.com/10874054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153719 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
Task is dead.
TBR=ananta@chromium.org,apatrick@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10836116
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150202 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Found with:
$ cppcheck --enable=all -j4 --force base 2> base-errors
R=jar@chromium.org
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/10827112
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150059 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of including singleton.h in header files we can forward declare it,
and include only in the source file.
There is also a presubmit check for this, I didn't know ;)
R=willchan@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10835029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149095 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds two new methods: AlignedAlloc and AlignedFree for creating and
destroying dynamic aligned allocations respectively. Also adds a
helper class, ScopedPtrAlignedFree, for use with scoped_ptr_malloc.
AlignedAlloc uses posix_memalign for OS X (now that we're targeting
10.6), Linux and _aligned_alloc() on Windows. Android and NaCl use
memalign() since they do not expose posix_memalign() and memalign()
is safe to use with free() on those platforms.
Also hacks around a bug in Visual C++ where __alignof will sometimes
return zero:
http://connect.microsoft.com/VisualStudio/feedback/details/682695/c-alignof-fails-to-properly-evalute-alignment-of-dependent-types
BUG=none
TEST=base_unittests + new test, trybots.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=147988
Review URL: https://chromiumcodereview.appspot.com/10796020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148483 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix ScopedVector API to follow this style.
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Variable_Names#Variable_Names
BUG=136196
R=willchan@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10796028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148057 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds two new methods: AlignedAlloc and AlignedFree for creating and
destroying dynamic aligned allocations respectively. Also adds a
helper class, ScopedPtrAlignedFree, for use with scoped_ptr_malloc.
AlignedAlloc uses posix_memalign for OS X (now that we're targeting
10.6), Linux and _aligned_alloc() on Windows. Android and NaCl use
memalign() since they do not expose posix_memalign() and memalign()
is safe to use with free() on those platforms.
Also hacks around a bug in Visual C++ where __alignof will sometimes
return zero:
http://connect.microsoft.com/VisualStudio/feedback/details/682695/c-alignof-fails-to-properly-evalute-alignment-of-dependent-types
BUG=none
TEST=base_unittests + new test, trybots.
Review URL: https://chromiumcodereview.appspot.com/10796020
TBR=dalecurtis@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10817021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148016 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds two new methods: AlignedAlloc and AlignedFree for creating and
destroying dynamic aligned allocations respectively. Also adds a
helper class, ScopedPtrAlignedFree, for use with scoped_ptr_malloc.
AlignedAlloc uses posix_memalign for OS X (now that we're targeting
10.6), Linux and _aligned_alloc() on Windows. Android and NaCl use
memalign() since they do not expose posix_memalign() and memalign()
is safe to use with free() on those platforms.
Also hacks around a bug in Visual C++ where __alignof will sometimes
return zero:
http://connect.microsoft.com/VisualStudio/feedback/details/682695/c-alignof-fails-to-properly-evalute-alignment-of-dependent-types
BUG=none
TEST=base_unittests + new test, trybots.
Review URL: https://chromiumcodereview.appspot.com/10796020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147988 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
One case of the StackAlignment test is #defined out for iOS on ARM (not simulator), due to a clang armv7 codegen bug. A crbug has been created to re-enable these cases when the clang bug is fixed.
BUG=None
TEST=None
Review URL: https://chromiumcodereview.appspot.com/10785019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147649 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes ScopedVector's clear() method destroy the
elements before clearing the internal vector, matching the
behavior of the erase() method. I'm moving clear()'s
previous element-preserving behavior into a new weak_clear()
method, matching weak_erase().
I'm also removing ScopedVector::reset(), as it duplicated
clear()'s new behavior and isn't a part of std::vector.
BUG=137909
TEST=added
Review URL: https://chromiumcodereview.appspot.com/10797017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147360 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
Rename/re-comment tests and added new death tests for WeakPtr.
Review URL: https://chromiumcodereview.appspot.com/10690080
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146212 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
Review URL: https://chromiumcodereview.appspot.com/10698063
TBR=kaiwang@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10704094
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145409 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: https://chromiumcodereview.appspot.com/10698063
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145402 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=128663
R=brettw@chromium.org,willchan@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10669038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145073 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
BUG=123295
TEST=it compiles
Review URL: https://chromiumcodereview.appspot.com/10332269
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144130 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change content::ResourceResponse to be base::RefCountedData<> rather than
directly inheriting from both ResourceResponseHead and base::RefCounted.
BUG=123295
TEST=existing
Review URL: https://chromiumcodereview.appspot.com/10416003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143880 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
Invoking "other.release()" where other is of type RValue invokes undefined behavior, because the given pointer is actually of type scoped_ptr<C>. With the NaCl toolchain, this doesn't work as intended, and the pointed-to object gets destructed twice.
BUG=116317
TEST=
Review URL: https://chromiumcodereview.appspot.com/10579030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143150 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will enable ::testing::IsNull and ::testing::NotNull on scoped_refptr. It
was not working because GetRawPointer needs element_type to be defined in the
Pointer type.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10558017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142997 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: https://chromiumcodereview.appspot.com/10565038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142848 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows classes to more naturally extend classes using WeakPtr.
TEST=None
BUG=
Review URL: https://chromiumcodereview.appspot.com/10537127
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142404 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
Also, add front() and back() functions to ScopedVector.
BUG=none
TEST=existing unit tests
Review URL: https://chromiumcodereview.appspot.com/10519013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140423 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL implements media::VideoDecodeAccelerator for Mac. This will be used to implement hardware video decoding for Pepper Flash.
Currently a couple things are still missing:
- the new VideoDecodeAcceleratorMac class needs to be hooked up to GpuVideoDecodeAccelerator
- the PPB_VideoDecoder_Dev::Create() API needs to be extended so clients can specify the extra AVC data.
BUG=127414
TEST=Ran on Mac and Windows. Sending ARM try bots now.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=140153
Review URL: https://chromiumcodereview.appspot.com/10388108
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140187 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit e80c92698a601d2e737a2c5cf5e128b291fc46d5.
Revert "mac: Try to unbreak component build after 140153"
This reverts commit 6358de7919e7788e373f98260ce6486fd490f2a0.
Revert "Try to fix the previous fix."
This reverts commit 179b333fa898f7969623d0f7404a9a7cfa122c61.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com/10494008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140164 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL implements media::VideoDecodeAccelerator for Mac. This will be used to implement hardware video decoding for Pepper Flash.
Currently a couple things are still missing:
- the new VideoDecodeAcceleratorMac class needs to be hooked up to GpuVideoDecodeAccelerator
- the PPB_VideoDecoder_Dev::Create() API needs to be extended so clients can specify the extra AVC data.
BUG=127414
TEST=Ran on Mac and Windows. Sending ARM try bots now.
Review URL: https://chromiumcodereview.appspot.com/10388108
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140153 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We had a weird bug (crbug.com/127534) where the task was
posted and executed even after WeakPtrFactory has been deleted.
It turns out that someone was posting a task AFTER its detor was
called while executing destructor, and bots (including valgrind)
couldn't catch this because the memory stays valid until the
hosting object is deleted. This CL is to catch such case early by
resetting the ptr_.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10387063
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137963 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
No intended functionality change. Required for a future clang roll.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10310183
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137361 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=compiles chrome, browser_tests and ui_tests
Review URL: http://codereview.chromium.org/10272004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135011 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
BUG=123295
TEST=none
Review URL: http://codereview.chromium.org/10065037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133825 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/10165020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133702 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=compiles and tests pass on trybots
Review URL: http://codereview.chromium.org/10083022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133170 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/10004001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131098 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's easy to type scoped_ptr<> instead of scoped_refptr<>. Such bugs are
hard to debug sometimes. This change adds compile-time check to make sure
that scoped_ptr<> is not used for ref-counted objects.
Also fixed one (benign) instance of scoped_ptr<> being used for a
ref-counted object.
Review URL: http://codereview.chromium.org/9958150
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130835 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
At least MSVC 2010 wanted "value_type" in addition to the ones that were there already, so just future-proof it by adding them all.
BUG=none
TEST=none
TBR=willchan
Review URL: https://chromiumcodereview.appspot.com/9866009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129019 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original implementation neglected to define the necessary
CallbackParamTraits and CallbackForward implementations for ScopedVector.
Fix scoped_ptr_malloc and scoped_array while I'm at it. Awesome.
BUG=NONE
TEST=scoped_vector_unittest.cc
Review URL: http://codereview.chromium.org/9827003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128350 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
to support std::back_inserter.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9804002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127996 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reference is more suitable type for operator*'s return values.
Add test code for operator->.
BUG=None
TEST=base_unittests --gtest_filter="WeakPtrTest.Dereference"
Review URL: http://codereview.chromium.org/9455086
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124141 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This looks like a typo. Seems that nobody has tried to use this operator before.
BUG=none
TEST=WeakPtrTest.Dereference
R=darin@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9452021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123456 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
StaticMemorySingletonTraits
BUG=95006
Review URL: https://chromiumcodereview.appspot.com/9186057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123270 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having copyable scoped_nsobject allows to use those in C++ structure, in stl
datatypes as well as with the base::Callback API. This CL also introduces an
optional parameter to the constructor of scoped_nsobject to allow to state what
is the ownership policy.
BUG= none
TEST= memory/scoped_nsobject_mac_unittest.mm
Review URL: http://codereview.chromium.org/9349016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121215 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is to make NULL dereference crashes more obvious. Also matches scoped_ptr (which uses assert) and weak_ptr (which uses DCHECK).
DCHECK wasn't used because it pulls in logging.h, and that somehow conflicts with a webkit #define of LOG.
BUG=
TEST=
Review URL: http://codereview.chromium.org/9232069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119820 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allow to easily own protocol. The syntax is:
scoped_nsobject<id<MyProtocol> > object;
BUG= none
TEST= none
Review URL: http://codereview.chromium.org/9290046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119419 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
The new PassAs<>() method can be used to explicitly upcast scoped_ptr instances.
Review URL: http://codereview.chromium.org/9283028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118958 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=nacl_integration goes green
TBR=darin
Review URL: https://chromiumcodereview.appspot.com/9195035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118391 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
|