[GTK] Add GUniquePtr
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jan 2014 14:03:21 +0000 (14:03 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jan 2014 14:03:21 +0000 (14:03 +0000)
commit262d16f3165e0fbc001f2cb4868eb7a938c84d9b
treed45171b60c152a35ffaa19150842fb846387f08e
parentee76028803bc4984e69110bf2a427aab5c20ecef
[GTK] Add GUniquePtr
https://bugs.webkit.org/show_bug.cgi?id=127170

Reviewed by Gustavo Noronha Silva.

Source/WTF:

The idea is to replace GOwnPtr with a template alias of
std:unique_ptr. Not everything can be replaced, though, because
GOwnPtr::outPtr() doesn't seem to be possible to implement with
unique_ptr. This smart pointer is more flexible than GOwnPtr and
allows to transfer the ownership of the pointer using
std::move().

* GNUmakefile.list.am: Add new file to compilation.
* wtf/gobject/GUniquePtr.h: Added.
(WTF::GPtrDeleter::operator()):

Tools:

Add unit tests for GUniquePtr.

* TestWebKitAPI/GNUmakefile.am: Add new file to compilation.
* TestWebKitAPI/Tests/WTF/gobject/GUniquePtr.cpp: Added.
(log):
(takeLogStr):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/GNUmakefile.list.am
Source/WTF/wtf/gobject/GUniquePtr.h [new file with mode: 0644]
Tools/ChangeLog
Tools/TestWebKitAPI/GNUmakefile.am
Tools/TestWebKitAPI/Tests/WTF/gobject/GUniquePtr.cpp [new file with mode: 0644]