Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Apr 2015 16:38:28 +0000 (16:38 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Apr 2015 16:38:28 +0000 (16:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=128007

Reviewed by Anders Carlsson.

Source/WebCore:

* PlatformEfl.cmake: Removed OwnPtrCairo source files.
* PlatformGTK.cmake: Ditto.
* PlatformWinCairo.cmake: Ditto.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.

* platform/CrossThreadCopier.cpp: Removed OwnPtr specialization.
* platform/CrossThreadCopier.h: Ditto.

* platform/ScrollAnimatorNone.cpp: Removed unneeded include.
* platform/ThreadGlobalData.cpp: Ditto.
* platform/ThreadGlobalData.h: Ditto.
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: Ditto.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::processNotification): Use unique_ptr.
(WebCore::AVFWrapper::notificationCallback): Use make_unique.
(WebCore::AVFWrapper::platformLayer): Ditto.

* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::appendPathToCairoContext): Use cairo_path_destroy directly
instead of a smart pointer; the code path is simple enough that it is
clear this way.

* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::ImageBuffer): Use make_unique.
* platform/graphics/cairo/ImageBufferDataCairo.h: Use unique_ptr.

* platform/graphics/cairo/OwnPtrCairo.cpp: Removed.
* platform/graphics/cairo/OwnPtrCairo.h: Removed.

* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::Path): Use cairo_path_destroy directly instead of a
smart pointer; the code path is simple enough that it is clear this way.
(WebCore::Path::operator=): Ditto.
(WebCore::Path::addPath): Ditto.
(WebCore::Path::apply): Ditto.
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::clipForPatternFilling): Ditto.

* platform/graphics/freetype/FontCacheFreeType.cpp: Removed unneeded include.
* platform/graphics/glx/GLContextGLX.cpp: Ditto.

* platform/graphics/surfaces/egl/EGLSurface.cpp:
(WebCore::EGLOffScreenSurface::EGLOffScreenSurface): Use make_unique.

* platform/graphics/surfaces/glx/GLXConfigSelector.h:
(WebCore::GLXConfigSelector::findMatchingConfig): Use unique_ptr with X11Deleter.
(WebCore::GLXConfigSelector::findMatchingConfigWithVisualId): Ditto.
* platform/graphics/surfaces/glx/GLXSurface.cpp:
(WebCore::GLXTransportSurface::GLXTransportSurface): Ditto.
(WebCore::GLXOffScreenSurface::initialize): Ditto.

* platform/graphics/surfaces/glx/OwnPtrX11.h: Removed.

* platform/graphics/surfaces/glx/X11Helper.cpp:
(WebCore::X11Helper::createOffScreenWindow): Use unique_ptr with X11Deleter.
(WebCore::X11Helper::createPixmap): Ditto.

* platform/graphics/surfaces/glx/X11Helper.h: Added X11Deleter,
which can be used with unique_ptr to make it call XFree instead of delete.

* platform/graphics/win/FullScreenController.cpp: Use unique_ptr.
(FullScreenController::FullScreenController): Use make_unique.
(FullScreenController::enterFullScreen): Ditto.
* platform/graphics/win/FullScreenController.h: Use unique_ptr.

* platform/graphics/win/GraphicsContext3DWin.cpp: Removed unneeded includes.

* platform/graphics/win/WKCAImageQueue.cpp:
(WebCore::WKCAImageQueue::WKCAImageQueue): Use make_unique.
* platform/graphics/win/WKCAImageQueue.h: Use unique_ptr.

* platform/network/NetworkStorageSessionStub.cpp: Removed unneeded include.

* platform/network/ResourceHandleInternal.h: Use unique_ptr.

* platform/network/curl/MultipartHandle.cpp:
(WebCore::MultipartHandle::create): Deleted.
* platform/network/curl/MultipartHandle.h: Deleted the create function.

* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::headerCallback): Use make_unique.

Source/WebKit2:

* NetworkProcess/cache/NetworkCacheEncoder.h: Added an include now
needed that was inherited from OwnPtr.h before.

Source/WTF:

* WTF.vcxproj/WTF.vcxproj: Removed OwnPtr source files.
* WTF.vcxproj/WTF.vcxproj.filters: Ditto.
* WTF.xcodeproj/project.pbxproj: Ditto.
* wtf/CMakeLists.txt: Ditto.

* wtf/Forward.h: Removed OwnPtr and PassOwnPtr.
* wtf/HashTraits.h: Ditto.

* wtf/OwnPtr.h: Removed.
* wtf/OwnPtrCommon.h: Removed.
* wtf/PassOwnPtr.h: Removed.

* wtf/SizeLimits.cpp: Removed OwnPtr.
* wtf/VectorTraits.h: Removed OwnPtr specialization.

Tools:

* DumpRenderTree/win/HistoryDelegate.h: Removed unneeded include.
* DumpRenderTree/win/UIDelegate.h: Ditto.

* TestWebKitAPI/Tests/WTF/HashMap.cpp: Removed OwnPtr-specific test cases.
* TestWebKitAPI/Tests/WTF/HashSet.cpp: Ditto.

* TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp: Removed unneeded include.

* TestWebKitAPI/Tests/WebKit2/UserMessage.cpp: Use unique_ptr.
(TestWebKitAPI::WebKit2UserMessageRoundTripTest::SetUp): Use make_unique.
* TestWebKitAPI/Tests/WebKit2/WillLoad.cpp: Ditto.
(TestWebKitAPI::WebKit2WillLoadTest::SetUp): Ditto.
* TestWebKitAPI/Tests/WebKit2Gtk/DOMDOMWindowTest.cpp:
(WebKitDOMDOMWindowTest::create): Ditto.
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
(documentLoadedCallback): Use a queue of DelayedSignal objects instead
of smart pointers to DelayedSIgnal objects.
(uriChangedCallback): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183265 268f45cc-cd09-0410-ab3c-d52691b4dbfc

62 files changed:
Source/WTF/ChangeLog
Source/WTF/WTF.vcxproj/WTF.vcxproj
Source/WTF/WTF.vcxproj/WTF.vcxproj.filters
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/Forward.h
Source/WTF/wtf/HashTraits.h
Source/WTF/wtf/OwnPtr.h [deleted file]
Source/WTF/wtf/OwnPtrCommon.h [deleted file]
Source/WTF/wtf/PassOwnPtr.h [deleted file]
Source/WTF/wtf/SizeLimits.cpp
Source/WTF/wtf/VectorTraits.h
Source/WebCore/ChangeLog
Source/WebCore/PlatformEfl.cmake
Source/WebCore/PlatformGTK.cmake
Source/WebCore/PlatformWinCairo.cmake
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/platform/CrossThreadCopier.cpp
Source/WebCore/platform/CrossThreadCopier.h
Source/WebCore/platform/ScrollAnimatorNone.cpp
Source/WebCore/platform/ThreadGlobalData.cpp
Source/WebCore/platform/ThreadGlobalData.h
Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h
Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp [deleted file]
Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h [deleted file]
Source/WebCore/platform/graphics/cairo/PathCairo.cpp
Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp
Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp
Source/WebCore/platform/graphics/glx/GLContextGLX.cpp
Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp
Source/WebCore/platform/graphics/surfaces/glx/GLXConfigSelector.h
Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp
Source/WebCore/platform/graphics/surfaces/glx/OwnPtrX11.h [deleted file]
Source/WebCore/platform/graphics/surfaces/glx/X11Helper.cpp
Source/WebCore/platform/graphics/surfaces/glx/X11Helper.h
Source/WebCore/platform/graphics/win/FullScreenController.cpp
Source/WebCore/platform/graphics/win/FullScreenController.h
Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp
Source/WebCore/platform/graphics/win/WKCAImageQueue.cpp
Source/WebCore/platform/graphics/win/WKCAImageQueue.h
Source/WebCore/platform/network/NetworkStorageSessionStub.cpp
Source/WebCore/platform/network/ResourceHandleInternal.h
Source/WebCore/platform/network/curl/MultipartHandle.cpp
Source/WebCore/platform/network/curl/MultipartHandle.h
Source/WebCore/platform/network/curl/ResourceHandleManager.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCacheEncoder.h
Tools/ChangeLog
Tools/DumpRenderTree/win/HistoryDelegate.h
Tools/DumpRenderTree/win/UIDelegate.h
Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp
Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp
Tools/TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp
Tools/TestWebKitAPI/Tests/WebKit2/UserMessage.cpp
Tools/TestWebKitAPI/Tests/WebKit2/WillLoad.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMDOMWindowTest.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp

index b1194e4..3c8dfe0 100644 (file)
@@ -1,3 +1,25 @@
+2015-04-24  Darin Adler  <darin@apple.com>
+
+        Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
+        https://bugs.webkit.org/show_bug.cgi?id=128007
+
+        Reviewed by Anders Carlsson.
+
+        * WTF.vcxproj/WTF.vcxproj: Removed OwnPtr source files.
+        * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
+        * WTF.xcodeproj/project.pbxproj: Ditto.
+        * wtf/CMakeLists.txt: Ditto.
+
+        * wtf/Forward.h: Removed OwnPtr and PassOwnPtr.
+        * wtf/HashTraits.h: Ditto.
+
+        * wtf/OwnPtr.h: Removed.
+        * wtf/OwnPtrCommon.h: Removed.
+        * wtf/PassOwnPtr.h: Removed.
+
+        * wtf/SizeLimits.cpp: Removed OwnPtr.
+        * wtf/VectorTraits.h: Removed OwnPtr specialization.
+
 2015-04-23  Jer Noble  <jer.noble@apple.com>
 
         Disable HAVE_AVKIT on AppleTV
index 23a81e8..6aa473d 100644 (file)
     <ClInclude Include="..\wtf\Noncopyable.h" />
     <ClInclude Include="..\wtf\NumberOfCores.h" />
     <ClInclude Include="..\wtf\OSRandomSource.h" />
-    <ClInclude Include="..\wtf\OwnPtr.h" />
-    <ClInclude Include="..\wtf\OwnPtrCommon.h" />
     <ClInclude Include="..\wtf\PackedIntVector.h" />
     <ClInclude Include="..\wtf\PageAllocation.h" />
     <ClInclude Include="..\wtf\PageBlock.h" />
     <ClInclude Include="..\wtf\ParallelJobsGeneric.h" />
     <ClInclude Include="..\wtf\ParallelJobsLibdispatch.h" />
     <ClInclude Include="..\wtf\ParallelJobsOpenMP.h" />
-    <ClInclude Include="..\wtf\PassOwnPtr.h" />
     <ClInclude Include="..\wtf\PassRefPtr.h" />
     <ClInclude Include="..\wtf\Platform.h" />
     <ClInclude Include="..\wtf\PrintStream.h" />
index d4fec2f..fae1069 100644 (file)
     <ClInclude Include="..\wtf\OSRandomSource.h">
       <Filter>wtf</Filter>
     </ClInclude>
-    <ClInclude Include="..\wtf\OwnPtr.h">
-      <Filter>wtf</Filter>
-    </ClInclude>
-    <ClInclude Include="..\wtf\OwnPtrCommon.h">
-      <Filter>wtf</Filter>
-    </ClInclude>
     <ClInclude Include="..\wtf\PackedIntVector.h">
       <Filter>wtf</Filter>
     </ClInclude>
     <ClInclude Include="..\wtf\ParallelJobsOpenMP.h">
       <Filter>wtf</Filter>
     </ClInclude>
-    <ClInclude Include="..\wtf\PassOwnPtr.h">
-      <Filter>wtf</Filter>
-    </ClInclude>
     <ClInclude Include="..\wtf\PassRefPtr.h">
       <Filter>wtf</Filter>
     </ClInclude>
index e405d6d..a038783 100644 (file)
                A8A473F7151A825B004123FF /* OSAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472D8151A825B004123FF /* OSAllocatorPosix.cpp */; };
                A8A473F9151A825B004123FF /* OSRandomSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472DA151A825B004123FF /* OSRandomSource.cpp */; };
                A8A473FA151A825B004123FF /* OSRandomSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DB151A825B004123FF /* OSRandomSource.h */; };
-               A8A473FC151A825B004123FF /* OwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DD151A825B004123FF /* OwnPtr.h */; };
-               A8A473FD151A825B004123FF /* OwnPtrCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DE151A825B004123FF /* OwnPtrCommon.h */; };
                A8A473FE151A825B004123FF /* PackedIntVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DF151A825B004123FF /* PackedIntVector.h */; };
                A8A473FF151A825B004123FF /* PageAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E0151A825B004123FF /* PageAllocation.h */; };
                A8A47402151A825B004123FF /* PageBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472E3151A825B004123FF /* PageBlock.cpp */; };
                A8A47404151A825B004123FF /* PageReservation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E5151A825B004123FF /* PageReservation.h */; };
                A8A47405151A825B004123FF /* ParallelJobs.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E6151A825B004123FF /* ParallelJobs.h */; };
                A8A47408151A825B004123FF /* ParallelJobsLibdispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E9151A825B004123FF /* ParallelJobsLibdispatch.h */; };
-               A8A4740B151A825B004123FF /* PassOwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472EC151A825B004123FF /* PassOwnPtr.h */; };
                A8A4740C151A825B004123FF /* PassRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472ED151A825B004123FF /* PassRefPtr.h */; };
                A8A47414151A825B004123FF /* RandomNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472FB151A825B004123FF /* RandomNumber.cpp */; };
                A8A47415151A825B004123FF /* RandomNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FC151A825B004123FF /* RandomNumber.h */; };
                A8A472D8151A825B004123FF /* OSAllocatorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSAllocatorPosix.cpp; sourceTree = "<group>"; };
                A8A472DA151A825B004123FF /* OSRandomSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSRandomSource.cpp; sourceTree = "<group>"; };
                A8A472DB151A825B004123FF /* OSRandomSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSRandomSource.h; sourceTree = "<group>"; };
-               A8A472DD151A825B004123FF /* OwnPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnPtr.h; sourceTree = "<group>"; };
-               A8A472DE151A825B004123FF /* OwnPtrCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnPtrCommon.h; sourceTree = "<group>"; };
                A8A472DF151A825B004123FF /* PackedIntVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PackedIntVector.h; sourceTree = "<group>"; };
                A8A472E0151A825B004123FF /* PageAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageAllocation.h; sourceTree = "<group>"; };
                A8A472E3151A825B004123FF /* PageBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageBlock.cpp; sourceTree = "<group>"; };
                A8A472E5151A825B004123FF /* PageReservation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageReservation.h; sourceTree = "<group>"; };
                A8A472E6151A825B004123FF /* ParallelJobs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelJobs.h; sourceTree = "<group>"; };
                A8A472E9151A825B004123FF /* ParallelJobsLibdispatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelJobsLibdispatch.h; sourceTree = "<group>"; };
-               A8A472EC151A825B004123FF /* PassOwnPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PassOwnPtr.h; sourceTree = "<group>"; };
                A8A472ED151A825B004123FF /* PassRefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PassRefPtr.h; sourceTree = "<group>"; };
                A8A472FB151A825B004123FF /* RandomNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RandomNumber.cpp; sourceTree = "<group>"; };
                A8A472FC151A825B004123FF /* RandomNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RandomNumber.h; sourceTree = "<group>"; };
                                A8A472DA151A825B004123FF /* OSRandomSource.cpp */,
                                A8A472DB151A825B004123FF /* OSRandomSource.h */,
                                1AFDE6521953B23D00C48FFA /* Optional.h */,
-                               A8A472DD151A825B004123FF /* OwnPtr.h */,
-                               A8A472DE151A825B004123FF /* OwnPtrCommon.h */,
                                A8A472DF151A825B004123FF /* PackedIntVector.h */,
                                A8A472E0151A825B004123FF /* PageAllocation.h */,
                                A8A472E3151A825B004123FF /* PageBlock.cpp */,
                                A8A472E5151A825B004123FF /* PageReservation.h */,
                                A8A472E6151A825B004123FF /* ParallelJobs.h */,
                                A8A472E9151A825B004123FF /* ParallelJobsLibdispatch.h */,
-                               A8A472EC151A825B004123FF /* PassOwnPtr.h */,
                                A8A472ED151A825B004123FF /* PassRefPtr.h */,
                                A876DBD7151816E500DADB95 /* Platform.h */,
                                0F9D335D165DBA73005AD387 /* PrintStream.cpp */,
                                7E29C33E15FFD79B00516D61 /* ObjcRuntimeExtras.h in Headers */,
                                A8A473F6151A825B004123FF /* OSAllocator.h in Headers */,
                                A8A473FA151A825B004123FF /* OSRandomSource.h in Headers */,
-                               A8A473FC151A825B004123FF /* OwnPtr.h in Headers */,
-                               A8A473FD151A825B004123FF /* OwnPtrCommon.h in Headers */,
                                0FB14E1B1810E1DC009B6B4D /* BagToHashMap.h in Headers */,
                                A8A473FE151A825B004123FF /* PackedIntVector.h in Headers */,
                                A8A473FF151A825B004123FF /* PageAllocation.h in Headers */,
                                A8A47404151A825B004123FF /* PageReservation.h in Headers */,
                                A8A47405151A825B004123FF /* ParallelJobs.h in Headers */,
                                A8A47408151A825B004123FF /* ParallelJobsLibdispatch.h in Headers */,
-                               A8A4740B151A825B004123FF /* PassOwnPtr.h in Headers */,
                                A8A4740C151A825B004123FF /* PassRefPtr.h in Headers */,
                                A876DBD8151816E500DADB95 /* Platform.h in Headers */,
                                0FB14E19180FA218009B6B4D /* Bag.h in Headers */,
index c7b4285..8623bac 100644 (file)
@@ -55,8 +55,6 @@ set(WTF_HEADERS
     NumberOfCores.h
     OSAllocator.h
     OSRandomSource.h
-    OwnPtr.h
-    OwnPtrCommon.h
     PageAllocation.h
     PageBlock.h
     PageReservation.h
@@ -64,7 +62,6 @@ set(WTF_HEADERS
     ParallelJobsGeneric.h
     ParallelJobsLibdispatch.h
     ParallelJobsOpenMP.h
-    PassOwnPtr.h
     PassRefPtr.h
     Platform.h
     PrintStream.h
index 6aefa1d..39520aa 100644 (file)
@@ -28,8 +28,6 @@ namespace WTF {
 template<typename T> class Function;
 template<typename T> class LazyNeverDestroyed;
 template<typename T> class NeverDestroyed;
-template<typename T> class OwnPtr;
-template<typename T> class PassOwnPtr;
 template<typename T> class PassRefPtr;
 template<typename T> class RefPtr;
 template<typename T> class Ref;
@@ -65,8 +63,6 @@ using WTF::FunctionDispatcher;
 using WTF::LazyNeverDestroyed;
 using WTF::NeverDestroyed;
 using WTF::OrdinalNumber;
-using WTF::OwnPtr;
-using WTF::PassOwnPtr;
 using WTF::PassRefPtr;
 using WTF::PrintStream;
 using WTF::Ref;
index e47aa8b..fca35f3 100644 (file)
@@ -30,8 +30,6 @@ namespace WTF {
 
 class String;
 
-template<typename T> class OwnPtr;
-
 template<typename T> struct HashTraits;
 
 template<bool isInteger, typename T> struct GenericHashTraitsBase;
@@ -120,17 +118,8 @@ template<typename T, typename Deleter> struct HashTraits<std::unique_ptr<T, Dele
     static T* peek(std::nullptr_t) { return nullptr; }
 };
 
-template<typename T> struct HashTraits<OwnPtr<T>> : SimpleClassHashTraits<OwnPtr<T>> {
-    typedef std::nullptr_t EmptyValueType;
-    static EmptyValueType emptyValue() { return nullptr; }
-
-    typedef T* PeekType;
-    static T* peek(const OwnPtr<T>& value) { return value.get(); }
-    static T* peek(std::nullptr_t) { return nullptr; }
-};
-
 template<typename P> struct HashTraits<RefPtr<P>> : SimpleClassHashTraits<RefPtr<P>> {
-    static P* emptyValue() { return 0; }
+    static P* emptyValue() { return nullptr; }
 
     typedef P* PeekType;
     static PeekType peek(const RefPtr<P>& value) { return value.get(); }
diff --git a/Source/WTF/wtf/OwnPtr.h b/Source/WTF/wtf/OwnPtr.h
deleted file mode 100644 (file)
index 21701a4..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- *  Copyright (C) 2006, 2007, 2008, 2009, 2010, 2014 Apple Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this library; see the file COPYING.LIB.  If not, write to
- *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef WTF_OwnPtr_h
-#define WTF_OwnPtr_h
-
-#include <algorithm>
-#include <cstddef>
-#include <memory>
-#include <wtf/Assertions.h>
-#include <wtf/Atomics.h>
-#include <wtf/GetPtr.h>
-#include <wtf/HashTraits.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/OwnPtrCommon.h>
-
-namespace WTF {
-
-    template<typename T> class PassOwnPtr;
-    template<typename T> PassOwnPtr<T> adoptPtr(T*);
-
-    template<typename T> class OwnPtr {
-    public:
-        typedef T ValueType;
-        typedef ValueType* PtrType;
-
-        OwnPtr() : m_ptr(0) { }
-        OwnPtr(std::nullptr_t) : m_ptr(0) { }
-
-        // See comment in PassOwnPtr.h for why this takes a const reference.
-        template<typename U> OwnPtr(const PassOwnPtr<U>& o);
-
-        ~OwnPtr() { deleteOwnedPtr(m_ptr); }
-
-        PtrType get() const { return m_ptr; }
-
-        void clear();
-        PassOwnPtr<T> release();
-        PtrType leakPtr() WARN_UNUSED_RETURN;
-
-        ValueType& operator*() const { ASSERT(m_ptr); return *m_ptr; }
-        PtrType operator->() const { ASSERT(m_ptr); return m_ptr; }
-
-        bool operator!() const { return !m_ptr; }
-
-        // This conversion operator allows implicit conversion to bool but not to other integer types.
-        typedef PtrType OwnPtr::*UnspecifiedBoolType;
-        operator UnspecifiedBoolType() const { return m_ptr ? &OwnPtr::m_ptr : 0; }
-
-        OwnPtr& operator=(const PassOwnPtr<T>&);
-        OwnPtr& operator=(std::nullptr_t) { clear(); return *this; }
-        template<typename U> OwnPtr& operator=(const PassOwnPtr<U>&);
-
-        OwnPtr(OwnPtr&&);
-        template<typename U> OwnPtr(OwnPtr<U>&&);
-
-        OwnPtr& operator=(OwnPtr&&);
-        template<typename U> OwnPtr& operator=(OwnPtr<U>&&);
-
-        // Hash table deleted values, which are only constructed and never copied or destroyed.
-        OwnPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { }
-        bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); }
-
-        void swap(OwnPtr& o) { std::swap(m_ptr, o.m_ptr); }
-        
-        // Construct an object to store into this OwnPtr, but only so long as this OwnPtr
-        // doesn't already point to an object. This will ensure that after you call this,
-        // the OwnPtr will point to an instance of T, even if called concurrently. This
-        // instance may or may not have been created by this call. Moreover, this call uses
-        // an opportunistic transaction, in that we may create an instance of T and then
-        // immediately throw it away, if in the process of creating that instance some
-        // other thread was doing the same thing and stored its instance into this pointer
-        // before we had a chance to do so.
-        template<typename... Args>
-        void createTransactionally(Args...);
-
-    private:
-        explicit OwnPtr(PtrType ptr) : m_ptr(ptr) { }
-
-        static PtrType hashTableDeletedValue() { return reinterpret_cast<PtrType>(-1); }
-
-        // We should never have two OwnPtrs for the same underlying object (otherwise we'll get
-        // double-destruction), so these equality operators should never be needed.
-        template<typename U> bool operator==(const OwnPtr<U>&) { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; }
-        template<typename U> bool operator!=(const OwnPtr<U>&) { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; }
-        template<typename U> bool operator==(const PassOwnPtr<U>&) { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; }
-        template<typename U> bool operator!=(const PassOwnPtr<U>&) { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; }
-
-        PtrType m_ptr;
-    };
-
-    template<typename T> template<typename U> inline OwnPtr<T>::OwnPtr(const PassOwnPtr<U>& o)
-        : m_ptr(o.leakPtr())
-    {
-    }
-
-    template<typename T> inline void OwnPtr<T>::clear()
-    {
-        deleteOwnedPtr(std::exchange(m_ptr, nullptr));
-    }
-
-    template<typename T> inline PassOwnPtr<T> OwnPtr<T>::release()
-    {
-        return adoptPtr(std::exchange(m_ptr, nullptr));
-    }
-
-    template<typename T> inline typename OwnPtr<T>::PtrType OwnPtr<T>::leakPtr()
-    {
-        return std::exchange(m_ptr, nullptr);
-    }
-
-    template<typename T> inline OwnPtr<T>& OwnPtr<T>::operator=(const PassOwnPtr<T>& o)
-    {
-        PtrType ptr = std::exchange(m_ptr, o.leakPtr());
-        ASSERT(!ptr || m_ptr != ptr);
-        deleteOwnedPtr(ptr);
-        return *this;
-    }
-
-    template<typename T> template<typename U> inline OwnPtr<T>& OwnPtr<T>::operator=(const PassOwnPtr<U>& o)
-    {
-        PtrType ptr = std::exchange(m_ptr, o.leakPtr());
-        ASSERT(!ptr || m_ptr != ptr);
-        deleteOwnedPtr(ptr);
-        return *this;
-    }
-
-    template<typename T> inline OwnPtr<T>::OwnPtr(OwnPtr<T>&& o)
-        : m_ptr(o.leakPtr())
-    {
-    }
-
-    template<typename T> template<typename U> inline OwnPtr<T>::OwnPtr(OwnPtr<U>&& o)
-        : m_ptr(o.leakPtr())
-    {
-    }
-
-    template<typename T> inline auto OwnPtr<T>::operator=(OwnPtr&& o) -> OwnPtr&
-    {
-        ASSERT(!o || o != m_ptr);
-        OwnPtr ptr = WTF::move(o);
-        swap(ptr);
-        return *this;
-    }
-
-    template<typename T> template<typename U> inline auto OwnPtr<T>::operator=(OwnPtr<U>&& o) -> OwnPtr&
-    {
-        ASSERT(!o || o != m_ptr);
-        OwnPtr ptr = WTF::move(o);
-        swap(ptr);
-        return *this;
-    }
-
-    template<typename T> inline void swap(OwnPtr<T>& a, OwnPtr<T>& b)
-    {
-        a.swap(b);
-    }
-
-    template<typename T, typename U> inline bool operator==(const OwnPtr<T>& a, U* b)
-    {
-        return a.get() == b; 
-    }
-
-    template<typename T, typename U> inline bool operator==(T* a, const OwnPtr<U>& b) 
-    {
-        return a == b.get(); 
-    }
-
-    template<typename T, typename U> inline bool operator!=(const OwnPtr<T>& a, U* b)
-    {
-        return a.get() != b; 
-    }
-
-    template<typename T, typename U> inline bool operator!=(T* a, const OwnPtr<U>& b)
-    {
-        return a != b.get(); 
-    }
-
-    template<typename T> template<typename... Args> inline void OwnPtr<T>::createTransactionally(Args... args)
-    {
-        if (m_ptr) {
-            WTF::loadLoadFence();
-            return;
-        }
-        
-        T* newObject = new T(args...);
-        WTF::storeStoreFence();
-#if ENABLE(COMPARE_AND_SWAP)
-        do {
-            if (m_ptr) {
-                delete newObject;
-                WTF::loadLoadFence();
-                return;
-            }
-        } while (!WTF::weakCompareAndSwap(bitwise_cast<void*volatile*>(&m_ptr), nullptr, newObject));
-#else
-        m_ptr = newObject;
-#endif
-    }
-
-    template <typename T> struct IsSmartPtr<OwnPtr<T>> {
-        static const bool value = true;
-    };
-
-    template<typename P> struct DefaultHash<OwnPtr<P>> {
-        typedef PtrHash<OwnPtr<P>> Hash;
-    };
-
-} // namespace WTF
-
-using WTF::OwnPtr;
-
-#endif // WTF_OwnPtr_h
diff --git a/Source/WTF/wtf/OwnPtrCommon.h b/Source/WTF/wtf/OwnPtrCommon.h
deleted file mode 100644 (file)
index f2b0875..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2009, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Torch Mobile, Inc.
- * Copyright (C) 2010 Company 100 Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef WTF_OwnPtrCommon_h
-#define WTF_OwnPtrCommon_h
-
-namespace WTF {
-
-    template <typename T> inline void deleteOwnedPtr(T* ptr)
-    {
-        typedef char known[sizeof(T) ? 1 : -1];
-        if (sizeof(known))
-            delete ptr;
-    }
-
-} // namespace WTF
-
-#endif // WTF_OwnPtrCommon_h
diff --git a/Source/WTF/wtf/PassOwnPtr.h b/Source/WTF/wtf/PassOwnPtr.h
deleted file mode 100644 (file)
index 3c5efb6..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef WTF_PassOwnPtr_h
-#define WTF_PassOwnPtr_h
-
-#include <cstddef>
-#include <wtf/Assertions.h>
-#include <wtf/GetPtr.h>
-#include <wtf/OwnPtrCommon.h>
-#include <type_traits>
-
-namespace WTF {
-
-    template<typename T> class OwnPtr;
-    template<typename T> class PassOwnPtr;
-    template<typename T> PassOwnPtr<T> adoptPtr(T*);
-
-    class RefCountedBase;
-    class ThreadSafeRefCountedBase;
-
-    template<typename T> class PassOwnPtr {
-    public:
-        typedef T ValueType;
-        typedef ValueType* PtrType;
-
-        PassOwnPtr() : m_ptr(0) { }
-        PassOwnPtr(std::nullptr_t) : m_ptr(0) { }
-
-        // It somewhat breaks the type system to allow transfer of ownership out of
-        // a const PassOwnPtr. However, it makes it much easier to work with PassOwnPtr
-        // temporaries, and we don't have a need to use real const PassOwnPtrs anyway.
-        PassOwnPtr(const PassOwnPtr& o) : m_ptr(o.leakPtr()) { }
-        template<typename U> PassOwnPtr(const PassOwnPtr<U>& o) : m_ptr(o.leakPtr()) { }
-
-        ~PassOwnPtr() { deleteOwnedPtr(m_ptr); }
-
-        PtrType get() const { return m_ptr; }
-
-        PtrType leakPtr() const WARN_UNUSED_RETURN;
-
-        ValueType& operator*() const { ASSERT(m_ptr); return *m_ptr; }
-        PtrType operator->() const { ASSERT(m_ptr); return m_ptr; }
-
-        bool operator!() const { return !m_ptr; }
-
-        // This conversion operator allows implicit conversion to bool but not to other integer types.
-        typedef PtrType PassOwnPtr::*UnspecifiedBoolType;
-        operator UnspecifiedBoolType() const { return m_ptr ? &PassOwnPtr::m_ptr : 0; }
-
-        PassOwnPtr& operator=(const PassOwnPtr&) { COMPILE_ASSERT(!sizeof(T*), PassOwnPtr_should_never_be_assigned_to); return *this; }
-
-        template<typename U> friend PassOwnPtr<U> adoptPtr(U*);
-
-    private:
-        explicit PassOwnPtr(PtrType ptr) : m_ptr(ptr) { }
-
-        // We should never have two OwnPtrs for the same underlying object (otherwise we'll get
-        // double-destruction), so these equality operators should never be needed.
-        template<typename U> bool operator==(const PassOwnPtr<U>&) { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; }
-        template<typename U> bool operator!=(const PassOwnPtr<U>&) { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; }
-        template<typename U> bool operator==(const OwnPtr<U>&) { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; }
-        template<typename U> bool operator!=(const OwnPtr<U>&) { COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); return false; }
-
-        mutable PtrType m_ptr;
-    };
-
-    template<typename T> inline typename PassOwnPtr<T>::PtrType PassOwnPtr<T>::leakPtr() const
-    {
-        return std::exchange(m_ptr, nullptr);
-    }
-
-    template<typename T, typename U> inline bool operator==(const PassOwnPtr<T>& a, const PassOwnPtr<U>& b) 
-    {
-        return a.get() == b.get(); 
-    }
-
-    template<typename T, typename U> inline bool operator==(const PassOwnPtr<T>& a, const OwnPtr<U>& b) 
-    {
-        return a.get() == b.get(); 
-    }
-    
-    template<typename T, typename U> inline bool operator==(const OwnPtr<T>& a, const PassOwnPtr<U>& b) 
-    {
-        return a.get() == b.get(); 
-    }
-    
-    template<typename T, typename U> inline bool operator==(const PassOwnPtr<T>& a, U* b) 
-    {
-        return a.get() == b; 
-    }
-    
-    template<typename T, typename U> inline bool operator==(T* a, const PassOwnPtr<U>& b) 
-    {
-        return a == b.get(); 
-    }
-    
-    template<typename T, typename U> inline bool operator!=(const PassOwnPtr<T>& a, const PassOwnPtr<U>& b) 
-    {
-        return a.get() != b.get(); 
-    }
-    
-    template<typename T, typename U> inline bool operator!=(const PassOwnPtr<T>& a, const OwnPtr<U>& b) 
-    {
-        return a.get() != b.get(); 
-    }
-    
-    template<typename T, typename U> inline bool operator!=(const OwnPtr<T>& a, const PassOwnPtr<U>& b) 
-    {
-        return a.get() != b.get(); 
-    }
-    
-    template<typename T, typename U> inline bool operator!=(const PassOwnPtr<T>& a, U* b)
-    {
-        return a.get() != b; 
-    }
-    
-    template<typename T, typename U> inline bool operator!=(T* a, const PassOwnPtr<U>& b) 
-    {
-        return a != b.get(); 
-    }
-
-    template<typename T> inline PassOwnPtr<T> adoptPtr(T* ptr)
-    {
-        static_assert(!std::is_convertible<T*, RefCountedBase*>::value, "Do not use adoptPtr with RefCounted, use adoptRef!");
-        static_assert(!std::is_convertible<T*, ThreadSafeRefCountedBase*>::value, "Do not use adoptPtr with ThreadSafeRefCounted, use adoptRef!");
-
-        return PassOwnPtr<T>(ptr);
-    }
-
-    template<typename T, typename U> inline PassOwnPtr<T> static_pointer_cast(const PassOwnPtr<U>& p) 
-    {
-        return adoptPtr(static_cast<T*>(p.leakPtr()));
-    }
-
-    template <typename T> struct IsSmartPtr<PassOwnPtr<T>> {
-        static const bool value = true;
-    };
-
-} // namespace WTF
-
-using WTF::PassOwnPtr;
-using WTF::adoptPtr;
-using WTF::static_pointer_cast;
-
-#endif // WTF_PassOwnPtr_h
index 7614ec2..a82d0c4 100644 (file)
@@ -33,7 +33,6 @@
 #include <type_traits>
 #include <utility>
 #include <wtf/Assertions.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -55,7 +54,6 @@ struct SameSizeAsRefCounted {
 };
 #endif
 
-static_assert(sizeof(OwnPtr<int>) == sizeof(int*), "OwnPtr should stay small!");
 static_assert(sizeof(PassRefPtr<RefCounted<int>>) == sizeof(int*), "PassRefPtr should stay small!");
 static_assert(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), "RefCounted should stay small!");
 static_assert(sizeof(RefPtr<RefCounted<int>>) == sizeof(int*), "RefPtr should stay small!");
index a830e44..94db8ca 100644 (file)
@@ -21,7 +21,6 @@
 #ifndef WTF_VectorTraits_h
 #define WTF_VectorTraits_h
 
-#include <wtf/OwnPtr.h>
 #include <wtf/Ref.h>
 #include <wtf/RefPtr.h>
 #include <utility>
@@ -66,22 +65,13 @@ namespace WTF {
         static const bool canCompareWithMemcmp = true;
     };
 
-    // We know OwnPtr and RefPtr are simple enough that initializing to 0 and moving with memcpy
-    // (and then not destructing the original) will totally work
-    template<typename P>
-    struct VectorTraits<RefPtr<P>> : SimpleClassVectorTraits { };
+    // We know smart pointers are simple enough that initializing to 0 and moving with memcpy
+    // (and then not destructing the original) will work.
 
-    template<typename P>
-    struct VectorTraits<OwnPtr<P>> : SimpleClassVectorTraits { };
-
-    template<typename P>
-    struct VectorTraits<std::unique_ptr<P>> : SimpleClassVectorTraits { };
-
-    template<typename P>
-    struct VectorTraits<Ref<P>> : SimpleClassVectorTraits { };
-
-    template<>
-    struct VectorTraits<AtomicString> : SimpleClassVectorTraits { };
+    template<typename P> struct VectorTraits<RefPtr<P>> : SimpleClassVectorTraits { };
+    template<typename P> struct VectorTraits<std::unique_ptr<P>> : SimpleClassVectorTraits { };
+    template<typename P> struct VectorTraits<Ref<P>> : SimpleClassVectorTraits { };
+    template<> struct VectorTraits<AtomicString> : SimpleClassVectorTraits { };
 
     template<typename First, typename Second>
     struct VectorTraits<std::pair<First, Second>>
index cdd9527..b6e2e3b 100644 (file)
@@ -1,3 +1,94 @@
+2015-04-24  Darin Adler  <darin@apple.com>
+
+        Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
+        https://bugs.webkit.org/show_bug.cgi?id=128007
+
+        Reviewed by Anders Carlsson.
+
+        * PlatformEfl.cmake: Removed OwnPtrCairo source files.
+        * PlatformGTK.cmake: Ditto.
+        * PlatformWinCairo.cmake: Ditto.
+        * WebCore.vcxproj/WebCore.vcxproj: Ditto.
+        * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
+
+        * platform/CrossThreadCopier.cpp: Removed OwnPtr specialization.
+        * platform/CrossThreadCopier.h: Ditto.
+
+        * platform/ScrollAnimatorNone.cpp: Removed unneeded include.
+        * platform/ThreadGlobalData.cpp: Ditto.
+        * platform/ThreadGlobalData.h: Ditto.
+        * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: Ditto.
+
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        (WebCore::AVFWrapper::processNotification): Use unique_ptr.
+        (WebCore::AVFWrapper::notificationCallback): Use make_unique.
+        (WebCore::AVFWrapper::platformLayer): Ditto.
+
+        * platform/graphics/cairo/CairoUtilities.cpp:
+        (WebCore::appendPathToCairoContext): Use cairo_path_destroy directly
+        instead of a smart pointer; the code path is simple enough that it is
+        clear this way.
+
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::ImageBuffer::ImageBuffer): Use make_unique.
+        * platform/graphics/cairo/ImageBufferDataCairo.h: Use unique_ptr.
+
+        * platform/graphics/cairo/OwnPtrCairo.cpp: Removed.
+        * platform/graphics/cairo/OwnPtrCairo.h: Removed.
+
+        * platform/graphics/cairo/PathCairo.cpp:
+        (WebCore::Path::Path): Use cairo_path_destroy directly instead of a
+        smart pointer; the code path is simple enough that it is clear this way.
+        (WebCore::Path::operator=): Ditto.
+        (WebCore::Path::addPath): Ditto.
+        (WebCore::Path::apply): Ditto.
+        * platform/graphics/cairo/PlatformContextCairo.cpp:
+        (WebCore::PlatformContextCairo::clipForPatternFilling): Ditto.
+
+        * platform/graphics/freetype/FontCacheFreeType.cpp: Removed unneeded include.
+        * platform/graphics/glx/GLContextGLX.cpp: Ditto.
+
+        * platform/graphics/surfaces/egl/EGLSurface.cpp:
+        (WebCore::EGLOffScreenSurface::EGLOffScreenSurface): Use make_unique.
+
+        * platform/graphics/surfaces/glx/GLXConfigSelector.h:
+        (WebCore::GLXConfigSelector::findMatchingConfig): Use unique_ptr with X11Deleter.
+        (WebCore::GLXConfigSelector::findMatchingConfigWithVisualId): Ditto.
+        * platform/graphics/surfaces/glx/GLXSurface.cpp:
+        (WebCore::GLXTransportSurface::GLXTransportSurface): Ditto.
+        (WebCore::GLXOffScreenSurface::initialize): Ditto.
+
+        * platform/graphics/surfaces/glx/OwnPtrX11.h: Removed.
+
+        * platform/graphics/surfaces/glx/X11Helper.cpp:
+        (WebCore::X11Helper::createOffScreenWindow): Use unique_ptr with X11Deleter.
+        (WebCore::X11Helper::createPixmap): Ditto.
+
+        * platform/graphics/surfaces/glx/X11Helper.h: Added X11Deleter,
+        which can be used with unique_ptr to make it call XFree instead of delete.
+
+        * platform/graphics/win/FullScreenController.cpp: Use unique_ptr.
+        (FullScreenController::FullScreenController): Use make_unique.
+        (FullScreenController::enterFullScreen): Ditto.
+        * platform/graphics/win/FullScreenController.h: Use unique_ptr.
+
+        * platform/graphics/win/GraphicsContext3DWin.cpp: Removed unneeded includes.
+
+        * platform/graphics/win/WKCAImageQueue.cpp:
+        (WebCore::WKCAImageQueue::WKCAImageQueue): Use make_unique.
+        * platform/graphics/win/WKCAImageQueue.h: Use unique_ptr.
+
+        * platform/network/NetworkStorageSessionStub.cpp: Removed unneeded include.
+
+        * platform/network/ResourceHandleInternal.h: Use unique_ptr.
+
+        * platform/network/curl/MultipartHandle.cpp:
+        (WebCore::MultipartHandle::create): Deleted.
+        * platform/network/curl/MultipartHandle.h: Deleted the create function.
+
+        * platform/network/curl/ResourceHandleManager.cpp:
+        (WebCore::headerCallback): Use make_unique.
+
 2015-04-24  Per Arne Vollan  <peavo@outlook.com>
 
         [Win] Popup menu is not accessible.
index f71eb60..cf7d718 100644 (file)
@@ -119,7 +119,6 @@ list(APPEND WebCore_SOURCES
     platform/graphics/cairo/ImageBufferCairo.cpp
     platform/graphics/cairo/ImageCairo.cpp
     platform/graphics/cairo/IntRectCairo.cpp
-    platform/graphics/cairo/OwnPtrCairo.cpp
     platform/graphics/cairo/PathCairo.cpp
     platform/graphics/cairo/PatternCairo.cpp
     platform/graphics/cairo/PlatformContextCairo.cpp
index b81c9d5..d8b6d65 100644 (file)
@@ -78,7 +78,6 @@ list(APPEND WebCore_SOURCES
     platform/graphics/cairo/ImageBufferCairo.cpp
     platform/graphics/cairo/ImageCairo.cpp
     platform/graphics/cairo/IntRectCairo.cpp
-    platform/graphics/cairo/OwnPtrCairo.cpp
     platform/graphics/cairo/PathCairo.cpp
     platform/graphics/cairo/PatternCairo.cpp
     platform/graphics/cairo/PlatformContextCairo.cpp
index 4593d1e..78bb01a 100644 (file)
@@ -50,7 +50,6 @@ list(APPEND WebCore_SOURCES
     platform/graphics/cairo/ImageBufferCairo.cpp
     platform/graphics/cairo/ImageCairo.cpp
     platform/graphics/cairo/IntRectCairo.cpp
-    platform/graphics/cairo/OwnPtrCairo.cpp
     platform/graphics/cairo/PathCairo.cpp
     platform/graphics/cairo/PatternCairo.cpp
     platform/graphics/cairo/PlatformContextCairo.cpp
index ac81538..369f52b 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\platform\graphics\cairo\OwnPtrCairo.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\platform\graphics\cairo\PathCairo.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </CustomBuildStep>
-    <CustomBuildStep Include="..\platform\graphics\cairo\OwnPtrCairo.h">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </CustomBuildStep>
     <CustomBuildStep Include="..\platform\graphics\cairo\PlatformPathCairo.h">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
index 95c31e8..a031808 100644 (file)
     <ClCompile Include="..\platform\graphics\cairo\IntRectCairo.cpp">
       <Filter>platform\graphics\cairo</Filter>
     </ClCompile>
-    <ClCompile Include="..\platform\graphics\cairo\OwnPtrCairo.cpp">
-      <Filter>platform\graphics\cairo</Filter>
-    </ClCompile>
     <ClCompile Include="..\platform\graphics\cairo\PathCairo.cpp">
       <Filter>platform\graphics\cairo</Filter>
     </ClCompile>
     <CustomBuildStep Include="..\platform\graphics\cairo\GraphicsContextPlatformPrivateCairo.h">
       <Filter>platform\graphics\cairo</Filter>
     </CustomBuildStep>
-    <CustomBuildStep Include="..\platform\graphics\cairo\OwnPtrCairo.h">
-      <Filter>platform\graphics\cairo</Filter>
-    </CustomBuildStep>
     <CustomBuildStep Include="..\platform\graphics\cairo\PlatformPathCairo.h">
       <Filter>platform\graphics\cairo</Filter>
     </CustomBuildStep>
index 1b1ac13..2aa93ec 100644 (file)
@@ -179,18 +179,4 @@ COMPILE_ASSERT((std::is_same<
                   >::value),
                RawPointerRefCountedTest);
 
-// Verify that PassOwnPtr gets passed through.
-COMPILE_ASSERT((std::is_same<
-                  PassOwnPtr<float>,
-                  CrossThreadCopier<PassOwnPtr<float>>::Type
-                  >::value),
-               PassOwnPtrTest);
-
-// Verify that PassOwnPtr does not get passed through.
-COMPILE_ASSERT((std::is_same<
-                  int,
-                  CrossThreadCopier<OwnPtr<float>>::Type
-                  >::value),
-               OwnPtrTest);
-
 } // namespace WebCore
index 70f9243..d75059c 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <wtf/Assertions.h>
 #include <wtf/Forward.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Threading.h>
@@ -110,14 +109,6 @@ namespace WebCore {
         }
     };
 
-    template<typename T> struct CrossThreadCopierBase<false, false, PassOwnPtr<T>> {
-        typedef PassOwnPtr<T> Type;
-        static Type copy(Type ownPtr)
-        {
-            return ownPtr;
-        }
-    };
-
     template<> struct CrossThreadCopierBase<false, false, URL> {
         typedef URL Type;
         static Type copy(const URL&);
index d295d49..023a782 100644 (file)
@@ -41,7 +41,6 @@
 #include "ScrollbarTheme.h"
 #include <algorithm>
 #include <wtf/CurrentTime.h>
-#include <wtf/PassOwnPtr.h>
 
 using namespace std;
 
index 76d4b12..63bc5ab 100644 (file)
@@ -32,7 +32,6 @@
 #include "TextCodecICU.h"
 #include "ThreadTimers.h"
 #include <wtf/MainThread.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/ThreadSpecific.h>
 #include <wtf/Threading.h>
 #include <wtf/WTFThreadData.h>
index 1896fc2..570666b 100644 (file)
@@ -30,7 +30,6 @@
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
 #include <wtf/Noncopyable.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/text/StringHash.h>
 
 #include <wtf/ThreadSpecific.h>
index fe94d0c..81ed052 100644 (file)
@@ -27,7 +27,6 @@
 #define CDMSessionAVFoundationCF_h
 
 #include "CDMSession.h"
-#include <wtf/PassOwnPtr.h>
 #include <wtf/RetainPtr.h>
 
 #if HAVE(AVFOUNDATION_LOADER_DELEGATE) && ENABLE(ENCRYPTED_MEDIA_V2)
index cba27a5..e4addce 100644 (file)
@@ -189,7 +189,7 @@ private:
     mutable RetainPtr<CACFLayerRef> m_caVideoLayer;
     RefPtr<PlatformCALayer> m_videoLayerWrapper;
 
-    OwnPtr<LayerClient> m_layerClient;
+    std::unique_ptr<LayerClient> m_layerClient;
     COMPtr<IDirect3DDevice9Ex> m_d3dDevice;
 
     InbandTextTrackPrivateAVF* m_currentTextTrack;
@@ -1623,7 +1623,7 @@ void AVFWrapper::processNotification(void* context)
     if (!context)
         return;
 
-    OwnPtr<NotificationCallbackData> notificationData = adoptPtr(reinterpret_cast<NotificationCallbackData*>(context));
+    std::unique_ptr<NotificationCallbackData> notificationData { static_cast<NotificationCallbackData*>(context) };
 
     MutexLocker locker(mapLock());
     AVFWrapper* self = avfWrapperForCallbackContext(notificationData->m_context);
@@ -1673,9 +1673,9 @@ void AVFWrapper::notificationCallback(CFNotificationCenterRef, void* observer, C
     LOG(Media, "AVFWrapper::notificationCallback(if=%d) %s", reinterpret_cast<uintptr_t>(observer), notificationName);
 #endif
 
-    OwnPtr<NotificationCallbackData> notificationData = adoptPtr(new NotificationCallbackData(propertyName, observer));
+    auto notificationData = std::make_unique<NotificationCallbackData>(propertyName, observer);
 
-    dispatch_async_f(dispatch_get_main_queue(), notificationData.leakPtr(), processNotification);
+    dispatch_async_f(dispatch_get_main_queue(), notificationData.release(), processNotification);
 }
 
 void AVFWrapper::loadPlayableCompletionCallback(AVCFAssetRef, void* context)
@@ -1917,7 +1917,7 @@ PlatformLayer* AVFWrapper::platformLayer()
         return 0;
 
     // Create a PlatformCALayer so we can resize the video layer to match the element size.
-    m_layerClient = adoptPtr(new LayerClient(this));
+    m_layerClient = std::make_unique<LayerClient>(this);
     if (!m_layerClient)
         return 0;
 
index 2ea42f1..be97010 100644 (file)
@@ -34,7 +34,6 @@
 #include "FloatPoint.h"
 #include "FloatRect.h"
 #include "IntRect.h"
-#include "OwnPtrCairo.h"
 #include "Path.h"
 #include "PlatformPathCairo.h"
 #include "RefPtrCairo.h"
@@ -73,8 +72,9 @@ void setSourceRGBAFromColor(cairo_t* context, const Color& color)
 
 void appendPathToCairoContext(cairo_t* to, cairo_t* from)
 {
-    OwnPtr<cairo_path_t> cairoPath = adoptPtr(cairo_copy_path(from));
-    cairo_append_path(to, cairoPath.get());
+    auto cairoPath = cairo_copy_path(from);
+    cairo_append_path(to, cairoPath);
+    cairo_path_destroy(cairoPath);
 }
 
 void setPathOnCairoContext(cairo_t* to, cairo_t* from)
index d22c4ca..a335b05 100644 (file)
@@ -43,7 +43,6 @@
 #include <cairo.h>
 #include <runtime/JSCInlines.h>
 #include <runtime/TypedArrayInlines.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/Vector.h>
 #include <wtf/text/Base64.h>
 #include <wtf/text/WTFString.h>
@@ -119,7 +118,7 @@ ImageBuffer::ImageBuffer(const FloatSize& size, float /* resolutionScale */, Col
 
     RefPtr<cairo_t> cr = adoptRef(cairo_create(m_data.m_surface.get()));
     m_data.m_platformContext.setCr(cr.get());
-    m_data.m_context = adoptPtr(new GraphicsContext(&m_data.m_platformContext));
+    m_data.m_context = std::make_unique<GraphicsContext>(&m_data.m_platformContext);
     success = true;
 }
 
index cb89c79..d62f470 100644 (file)
@@ -50,7 +50,7 @@ public:
 
     RefPtr<cairo_surface_t> m_surface;
     PlatformContextCairo m_platformContext;
-    OwnPtr<GraphicsContext> m_context;
+    std::unique_ptr<GraphicsContext> m_context;
     IntSize m_size;
 
 #if ENABLE(ACCELERATED_2D_CANVAS)
diff --git a/Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp b/Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp
deleted file mode 100644 (file)
index e128afb..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2010 Collabora Ltd.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free
- *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "OwnPtrCairo.h"
-
-#if USE(CAIRO)
-
-#if USE(FREETYPE)
-#include <cairo-ft.h>
-#include <fontconfig/fcfreetype.h>
-#endif
-
-#include <cairo.h>
-
-namespace WTF {
-
-#if USE(FREETYPE)
-template <> void deleteOwnedPtr<FcObjectSet>(FcObjectSet* ptr)
-{
-    if (ptr)
-        FcObjectSetDestroy(ptr);
-}
-
-template <> void deleteOwnedPtr<FcFontSet>(FcFontSet* ptr)
-{
-    if (ptr)
-        FcFontSetDestroy(ptr);
-}
-#endif
-
-} // namespace WTF
-
-#endif // USE(CAIRO)
diff --git a/Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h b/Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h
deleted file mode 100644 (file)
index 2f6013b..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2010 Collabora Ltd.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free
- *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301 USA
- */
-
-#ifndef OwnPtrCairo_h
-#define OwnPtrCairo_h
-
-#if USE(CAIRO)
-
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
-
-#if USE(FREETYPE)
-typedef struct _FcObjectSet FcObjectSet;
-typedef struct _FcFontSet FcFontSet;
-#endif
-
-typedef struct cairo_path cairo_path_t;
-
-namespace WTF {
-
-#if USE(FREETYPE)
-template <> void deleteOwnedPtr<FcObjectSet>(FcObjectSet*);
-template <> void deleteOwnedPtr<FcFontSet>(FcFontSet*);
-#endif
-
-} // namespace WTF
-
-#endif // USE(CAIRO)
-
-#endif // OwnPtrCairo_h
index dcc2ef1..546ada6 100644 (file)
@@ -31,7 +31,6 @@
 #include "AffineTransform.h"
 #include "FloatRect.h"
 #include "GraphicsContext.h"
-#include "OwnPtrCairo.h"
 #include "PlatformPathCairo.h"
 #include "StrokeStyleApplier.h"
 #include <cairo.h>
@@ -59,8 +58,9 @@ Path::Path(const Path& other)
         return;
 
     cairo_t* cr = ensurePlatformPath()->context();
-    OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(other.platformPath()->context()));
-    cairo_append_path(cr, pathCopy.get());
+    auto pathCopy = cairo_copy_path(other.platformPath()->context());
+    cairo_append_path(cr, pathCopy);
+    cairo_path_destroy(pathCopy);
 }
 
 PlatformPathPtr Path::ensurePlatformPath()
@@ -83,8 +83,9 @@ Path& Path::operator=(const Path& other)
     } else {
         clear();
         cairo_t* cr = ensurePlatformPath()->context();
-        OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(other.platformPath()->context()));
-        cairo_append_path(cr, pathCopy.get());
+        auto pathCopy = cairo_copy_path(other.platformPath()->context());
+        cairo_append_path(cr, pathCopy);
+        cairo_path_destroy(pathCopy);
     }
 
     return *this;
@@ -323,11 +324,10 @@ void Path::addPath(const Path& path, const AffineTransform& transform)
     cairo_t* cr = path.platformPath()->context();
     cairo_save(cr);
     cairo_transform(cr, &matrix);
-    std::unique_ptr<cairo_path_t, void(*)(cairo_path_t*)> pathCopy(cairo_copy_path(cr), [](cairo_path_t* path) {
-        cairo_path_destroy(path);
-    });
+    auto pathCopy = cairo_copy_path(cr);
     cairo_restore(cr);
-    cairo_append_path(ensurePlatformPath()->context(), pathCopy.get());
+    cairo_append_path(ensurePlatformPath()->context(), pathCopy);
+    cairo_path_destroy(pathCopy);
 }
 
 void Path::closeSubpath()
@@ -396,7 +396,7 @@ void Path::apply(void* info, PathApplierFunction function) const
         return;
 
     cairo_t* cr = platformPath()->context();
-    OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(cr));
+    auto pathCopy = cairo_copy_path(cr);
     cairo_path_data_t* data;
     PathElement pelement;
     FloatPoint points[3];
@@ -428,6 +428,7 @@ void Path::apply(void* info, PathApplierFunction function) const
             break;
         }
     }
+    cairo_path_destroy(pathCopy);
 }
 
 void Path::transform(const AffineTransform& trans)
index b10ca0b..0cd25c9 100644 (file)
@@ -33,7 +33,6 @@
 #include "CairoUtilities.h"
 #include "Gradient.h"
 #include "GraphicsContext.h"
-#include "OwnPtrCairo.h"
 #include "Pattern.h"
 #include <cairo.h>
 
@@ -306,7 +305,7 @@ void PlatformContextCairo::clipForPatternFilling(const GraphicsContextState& sta
     ASSERT(state.fillPattern);
 
     // Hold current cairo path in a variable for restoring it after configuring the pattern clip rectangle.
-    OwnPtr<cairo_path_t> currentPath = adoptPtr(cairo_copy_path(m_cr.get()));
+    auto currentPath = cairo_copy_path(m_cr.get());
     cairo_new_path(m_cr.get());
 
     // Initialize clipping extent from current cairo clip extents, then shrink if needed according to pattern.
@@ -337,7 +336,8 @@ void PlatformContextCairo::clipForPatternFilling(const GraphicsContextState& sta
     }
 
     // Restoring cairo path.
-    cairo_append_path(m_cr.get(), currentPath.get());
+    cairo_append_path(m_cr.get(), currentPath);
+    cairo_path_destroy(currentPath);
 }
 
 } // namespace WebCore
index e483848..b232716 100644 (file)
@@ -23,7 +23,6 @@
 #include "FontCache.h"
 
 #include "Font.h"
-#include "OwnPtrCairo.h"
 #include "RefPtrCairo.h"
 #include "UTF16UChar32Iterator.h"
 #include <cairo-ft.h>
index 7890d8d..79c4a10 100644 (file)
@@ -24,7 +24,6 @@
 #include "OpenGLShims.h"
 #include <GL/glx.h>
 #include <cairo.h>
-#include <wtf/OwnPtr.h>
 
 #if ENABLE(ACCELERATED_2D_CANVAS)
 #include <cairo-gl.h>
index eae30cd..6c69502 100644 (file)
@@ -130,7 +130,7 @@ EGLOffScreenSurface::EGLOffScreenSurface(SurfaceAttributes surfaceAttributes)
     if (m_sharedDisplay == EGL_NO_DISPLAY)
         return;
 
-    m_configSelector = adoptPtr(new EGLConfigSelector(surfaceAttributes));
+    m_configSelector = std::make_unique<EGLConfigSelector>(surfaceAttributes);
 }
 
 EGLOffScreenSurface::~EGLOffScreenSurface()
index 8a6109a..5cdede5 100644 (file)
@@ -140,14 +140,13 @@ private:
     GLXFBConfig findMatchingConfig(const int attributes[], int depth = 32)
     {
         int numAvailableConfigs;
-        OwnPtrX11<GLXFBConfig> temp(glXChooseFBConfig(X11Helper::nativeDisplay(), DefaultScreen(X11Helper::nativeDisplay()), attributes, &numAvailableConfigs));
+        std::unique_ptr<GLXFBConfig[], X11Deleter> temp(glXChooseFBConfig(X11Helper::nativeDisplay(), DefaultScreen(X11Helper::nativeDisplay()), attributes, &numAvailableConfigs));
 
         if (!numAvailableConfigs || !temp.get())
             return 0;
 
-        OwnPtrX11<XVisualInfo> scopedVisualInfo;
         for (int i = 0; i < numAvailableConfigs; ++i) {
-            scopedVisualInfo = glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]);
+            std::unique_ptr<XVisualInfo, X11Deleter> scopedVisualInfo { glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]) };
             if (!scopedVisualInfo.get())
                 continue;
 
@@ -169,7 +168,7 @@ private:
         }
 
         // Did not find any visual supporting alpha, select the first available config.
-        scopedVisualInfo = glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[0]);
+        std::unique_ptr<XVisualInfo, X11Deleter> scopedVisualInfo { glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[0]) };
 
         if ((m_attributes & GLPlatformSurface::SupportAlpha) && (scopedVisualInfo->depth != 32))
             m_attributes &= ~GLPlatformSurface::SupportAlpha;
@@ -180,14 +179,13 @@ private:
     GLXFBConfig findMatchingConfigWithVisualId(const int attributes[], int depth, VisualID id)
     {
         int numAvailableConfigs;
-        OwnPtrX11<GLXFBConfig> temp(glXChooseFBConfig(X11Helper::nativeDisplay(), DefaultScreen(X11Helper::nativeDisplay()), attributes, &numAvailableConfigs));
+        std::unique_ptr<GLXFBConfig[], X11Deleter> temp(glXChooseFBConfig(X11Helper::nativeDisplay(), DefaultScreen(X11Helper::nativeDisplay()), attributes, &numAvailableConfigs));
 
         if (!numAvailableConfigs || !temp.get())
             return 0;
 
-        OwnPtrX11<XVisualInfo> scopedVisualInfo;
         for (int i = 0; i < numAvailableConfigs; ++i) {
-            scopedVisualInfo = glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]);
+            std::unique_ptr<XVisualInfo, X11Deleter> scopedVisualInfo { glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]) };
             if (!scopedVisualInfo.get())
                 continue;
 
index 2b35302..16a8e03 100644 (file)
@@ -67,7 +67,7 @@ GLXTransportSurface::GLXTransportSurface(const IntSize& size, SurfaceAttributes
     m_sharedDisplay = X11Helper::nativeDisplay();
     attributes |= GLPlatformSurface::DoubleBuffered;
     m_configSelector = std::make_unique<GLXConfigSelector>(attributes);
-    OwnPtrX11<XVisualInfo> visInfo(m_configSelector->visualInfo(m_configSelector->surfaceContextConfig()));
+    std::unique_ptr<XVisualInfo, X11Deleter> visInfo(m_configSelector->visualInfo(m_configSelector->surfaceContextConfig()));
 
     if (!visInfo.get()) {
         destroy();
@@ -145,7 +145,7 @@ void GLXOffScreenSurface::initialize(SurfaceAttributes attributes)
 
     m_configSelector = std::make_unique<GLXConfigSelector>(attributes);
 
-    OwnPtrX11<XVisualInfo> visualInfo(m_configSelector->visualInfo(m_configSelector->pixmapContextConfig()));
+    std::unique_ptr<XVisualInfo, X11Deleter> visualInfo(m_configSelector->visualInfo(m_configSelector->pixmapContextConfig()));
     X11Helper::createPixmap(&m_pixmap, *visualInfo.get());
 
     if (!m_pixmap) {
diff --git a/Source/WebCore/platform/graphics/surfaces/glx/OwnPtrX11.h b/Source/WebCore/platform/graphics/surfaces/glx/OwnPtrX11.h
deleted file mode 100644 (file)
index b877610..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2012 Intel Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef OwnPtrX11_h
-#define OwnPtrX11_h
-
-namespace WebCore {
-
-template<typename T>
-struct OwnPtrX11 {
-
-    OwnPtrX11() : m_xResource(0) { }
-    OwnPtrX11(T* xResource) : m_xResource(xResource) { }
-
-    ~OwnPtrX11()
-    {
-        if (m_xResource)
-            XFree(m_xResource);
-    }
-
-    OwnPtrX11& operator=(T* xResource)
-    {
-        if (m_xResource)
-            XFree(m_xResource);
-
-        m_xResource = xResource;
-        return *this;
-    }
-
-    operator T*() const { return m_xResource; }
-    T* operator->() const { return m_xResource; }
-    T* get() const { return m_xResource; }
-
-private:
-    OwnPtrX11(const OwnPtrX11&);
-    OwnPtrX11& operator=(const OwnPtrX11&);
-    static void* operator new (size_t);
-    static void operator delete (void*);
-    T* m_xResource;
-};
-
-}
-
-#endif
index 409a47f..4be62bb 100644 (file)
@@ -240,7 +240,7 @@ void X11Helper::createOffScreenWindow(uint32_t* handleId, const EGLint id, bool
     memset(&visualInfoTemplate, 0, sizeof(XVisualInfo));
     visualInfoTemplate.visualid = visualId;
     int matchingCount = 0;
-    OwnPtrX11<XVisualInfo> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount));
+    std::unique_ptr<XVisualInfo, X11Deleter> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount));
     XVisualInfo* foundVisual = 0;
 
     if (matchingVisuals) {
@@ -277,7 +277,7 @@ void X11Helper::createPixmap(Pixmap* handleId, const EGLint id, bool hasAlpha, c
     memset(&visualInfoTemplate, 0, sizeof(XVisualInfo));
     visualInfoTemplate.visualid = visualId;
     int matchingCount = 0;
-    OwnPtrX11<XVisualInfo> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount));
+    std::unique_ptr<XVisualInfo, X11Deleter> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount));
     XVisualInfo* foundVisual = 0;
     int requiredDepth = hasAlpha ? 32 : 24;
 
index a7aeb70..103f001 100644 (file)
@@ -27,7 +27,6 @@
 #define X11Helper_h
 
 #include "IntRect.h"
-#include "OwnPtrX11.h"
 
 #if USE(EGL)
 #include <opengl/GLDefs.h>
 
 namespace WebCore {
 
-class X11Helper {
+class X11Deleter {
+public:
+    template<typename T> void operator()(T* resource)
+    {
+        if (resource)
+            XFree(resource);
+    }
+};
 
+class X11Helper {
 public:
     static void createPixmap(Pixmap*, const XVisualInfo&, const IntSize& = IntSize(1, 1));
     static void createOffScreenWindow(uint32_t*, const XVisualInfo&, const IntSize& = IntSize(1, 1));
@@ -61,7 +68,6 @@ public:
 };
 
 class ScopedXPixmapCreationErrorHandler {
-
 public:
     ScopedXPixmapCreationErrorHandler();
     ~ScopedXPixmapCreationErrorHandler();
index c9e938c..6801c16 100644 (file)
@@ -36,7 +36,6 @@
 #include "MediaPlayerPrivateFullscreenWindow.h"
 #include "Timer.h"
 #include "WebCoreInstanceHandle.h"
-#include <wtf/PassOwnPtr.h>
 #include <wtf/RefPtr.h>
 
 using namespace WebCore;
@@ -60,8 +59,8 @@ public:
     
     FullScreenController* m_controller;
     FullScreenControllerClient* m_client;
-    OwnPtr<MediaPlayerPrivateFullscreenWindow> m_fullScreenWindow;
-    OwnPtr<MediaPlayerPrivateFullscreenWindow> m_backgroundWindow;
+    std::unique_ptr<MediaPlayerPrivateFullscreenWindow> m_fullScreenWindow;
+    std::unique_ptr<MediaPlayerPrivateFullscreenWindow> m_backgroundWindow;
     IntRect m_fullScreenFrame;
     IntRect m_originalFrame;
     HWND m_originalHost;
@@ -104,7 +103,7 @@ LRESULT FullScreenController::Private::fullscreenClientWndProc(HWND hwnd, UINT m
 }
 
 FullScreenController::FullScreenController(FullScreenControllerClient* client)
-    : m_private(adoptPtr(new FullScreenController::Private(this, client)))
+    : m_private(std::make_unique<Private>(this, client))
 {
     ASSERT_ARG(client, client);
 }
@@ -134,13 +133,13 @@ void FullScreenController::enterFullScreen()
     m_private->m_originalFrame = originalFrame;
 
     ASSERT(!m_private->m_backgroundWindow);
-    m_private->m_backgroundWindow = adoptPtr(new MediaPlayerPrivateFullscreenWindow(m_private.get()));
+    m_private->m_backgroundWindow = std::make_unique<MediaPlayerPrivateFullscreenWindow>(m_private.get());
     m_private->m_backgroundWindow->createWindow(0);
     ::AnimateWindow(m_private->m_backgroundWindow->hwnd(), kFullScreenAnimationDuration, AW_BLEND | AW_ACTIVATE);
 
     m_private->m_client->fullScreenClientWillEnterFullScreen();
     ASSERT(!m_private->m_fullScreenWindow);
-    m_private->m_fullScreenWindow = adoptPtr(new MediaPlayerPrivateFullscreenWindow(m_private.get()));
+    m_private->m_fullScreenWindow = std::make_unique<MediaPlayerPrivateFullscreenWindow>(m_private.get());
     ASSERT(m_private->m_fullScreenWindow);
     m_private->m_fullScreenWindow->createWindow(0);
 
index 76a880d..3177d9e 100644 (file)
@@ -28,7 +28,7 @@
 
 #if ENABLE(FULLSCREEN_API)
 
-#include <wtf/OwnPtr.h>
+#include <memory>
 
 namespace WebCore {
 
@@ -54,7 +54,7 @@ protected:
 
     class Private;
     friend class Private;
-    OwnPtr<FullScreenController::Private> m_private;
+    std::unique_ptr<FullScreenController::Private> m_private;
 };
 
 }
index 69dfc7f..7a5d7ba 100644 (file)
@@ -29,8 +29,6 @@
 #include "GraphicsContext3D.h"
 #include "GraphicsContext3DPrivate.h"
 #include <WebCore/PlatformCALayerWin.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 
 #if PLATFORM(WIN)
 #include <GLSLANG/ShaderLang.h>
index 622a364..2d20587 100644 (file)
@@ -28,7 +28,6 @@
 
 #include <CoreFoundation/CoreFoundation.h>
 #include <WebKitSystemInterface/WebKitSystemInterface.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/RetainPtr.h>
 
 namespace WebCore {
@@ -52,13 +51,13 @@ static void WKCAImageQueueRelease(CAImageQueueRef iq)
 }
 
 WKCAImageQueue::WKCAImageQueue(uint32_t width, uint32_t height, uint32_t capacity)
-    : m_private(adoptPtr(new WKCAImageQueuePrivate()))
+    : m_private(std::make_unique<WKCAImageQueuePrivate>())
 {
     m_private->m_imageQueue = adoptCF(wkCAImageQueueCreate(width, height, capacity));
 }
 
 WKCAImageQueue::WKCAImageQueue(const WKCAImageQueue& o)
-    : m_private(adoptPtr(new WKCAImageQueuePrivate()))
+    : m_private(std::make_unique<WKCAImageQueuePrivate>())
 {
     m_private->m_imageQueue = o.m_private->m_imageQueue;
 }
index 2560765..2760d61 100644 (file)
@@ -29,8 +29,8 @@
 typedef const void * CFTypeRef;
 typedef const struct __CFDictionary * CFDictionaryRef;
 
+#include <memory>
 #include <stdint.h>
-#include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
@@ -80,7 +80,7 @@ public:
 private:
     WKCAImageQueue(const WKCAImageQueue&);
     WKCAImageQueue& operator=(const WKCAImageQueue&);
-    OwnPtr<WKCAImageQueuePrivate> m_private;
+    std::unique_ptr<WKCAImageQueuePrivate> m_private;
 };
 
 }
index c7f0b43..d049294 100644 (file)
@@ -30,7 +30,6 @@
 #include "NetworkStorageSession.h"
 
 #include "NetworkingContext.h"
-#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
index 772466d..b0e0359 100644 (file)
@@ -31,7 +31,6 @@
 #include "ResourceRequest.h"
 #include "AuthenticationChallenge.h"
 #include "Timer.h"
-#include <wtf/OwnPtr.h>
 
 #if USE(CFNETWORK)
 #include "ResourceHandleCFURLConnectionDelegate.h"
@@ -163,7 +162,7 @@ namespace WebCore {
         unsigned m_sslErrors;
         Vector<char> m_postBytes;
 
-        OwnPtr<MultipartHandle> m_multipartHandle;
+        std::unique_ptr<MultipartHandle> m_multipartHandle;
 #endif
 #if USE(SOUP)
         GRefPtr<SoupMessage> m_soupMessage;
index e78050f..897f95c 100644 (file)
 
 namespace WebCore {
 
-PassOwnPtr<MultipartHandle> MultipartHandle::create(ResourceHandle* handle, const String& boundary)
-{
-    return adoptPtr(new MultipartHandle(handle, boundary));
-}
-
 bool MultipartHandle::extractBoundary(const String& contentType, String& boundary)
 {
     static const size_t length = strlen("boundary=");
index 9ab8562..bb0f0f6 100644 (file)
 
 #include "HTTPHeaderMap.h"
 #include "ResourceHandle.h"
-
-#include <wtf/OwnPtr.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
 class MultipartHandle {
-
 public:
-    static PassOwnPtr<MultipartHandle> create(ResourceHandle* handle, const String& boundary);
     static bool extractBoundary(const String& contentType, String& boundary);
 
     MultipartHandle(ResourceHandle* handle, const String& boundary)
index 33ab87b..fd8f58e 100644 (file)
@@ -515,7 +515,7 @@ static size_t headerCallback(char* ptr, size_t size, size_t nmemb, void* data)
             String boundary;
             bool parsed = MultipartHandle::extractBoundary(d->m_response.httpHeaderField(HTTPHeaderName::ContentType), boundary);
             if (parsed)
-                d->m_multipartHandle = MultipartHandle::create(job, boundary);
+                d->m_multipartHandle = std::make_unique<MultipartHandle>(job, boundary);
         }
 
 #if ENABLE(WEB_TIMING)
index 7d7a8c2..4fb6c42 100644 (file)
@@ -1,3 +1,13 @@
+2015-04-24  Darin Adler  <darin@apple.com>
+
+        Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
+        https://bugs.webkit.org/show_bug.cgi?id=128007
+
+        Reviewed by Anders Carlsson.
+
+        * NetworkProcess/cache/NetworkCacheEncoder.h: Added an include now
+        needed that was inherited from OwnPtr.h before.
+
 2015-04-24  Antti Koivisto  <antti@apple.com>
 
         Network Cache: Make path functions members
index 6f4ff13..25e8f12 100644 (file)
@@ -29,7 +29,7 @@
 #if ENABLE(NETWORK_CACHE)
 
 #include "NetworkCacheCoder.h"
-
+#include <wtf/HashFunctions.h>
 #include <wtf/StringHasher.h>
 #include <wtf/Vector.h>
 
index 3edb9a2..537f00a 100644 (file)
@@ -1,3 +1,29 @@
+2015-04-24  Darin Adler  <darin@apple.com>
+
+        Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
+        https://bugs.webkit.org/show_bug.cgi?id=128007
+
+        Reviewed by Anders Carlsson.
+
+        * DumpRenderTree/win/HistoryDelegate.h: Removed unneeded include.
+        * DumpRenderTree/win/UIDelegate.h: Ditto.
+
+        * TestWebKitAPI/Tests/WTF/HashMap.cpp: Removed OwnPtr-specific test cases.
+        * TestWebKitAPI/Tests/WTF/HashSet.cpp: Ditto.
+
+        * TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp: Removed unneeded include.
+
+        * TestWebKitAPI/Tests/WebKit2/UserMessage.cpp: Use unique_ptr.
+        (TestWebKitAPI::WebKit2UserMessageRoundTripTest::SetUp): Use make_unique.
+        * TestWebKitAPI/Tests/WebKit2/WillLoad.cpp: Ditto.
+        (TestWebKitAPI::WebKit2WillLoadTest::SetUp): Ditto.
+        * TestWebKitAPI/Tests/WebKit2Gtk/DOMDOMWindowTest.cpp:
+        (WebKitDOMDOMWindowTest::create): Ditto.
+        * TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
+        (documentLoadedCallback): Use a queue of DelayedSignal objects instead
+        of smart pointers to DelayedSIgnal objects.
+        (uriChangedCallback): Ditto.
+
 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
 
         [Mac] Unreviewed test fix.
index 236edd3..c854ae0 100644 (file)
@@ -27,7 +27,6 @@
 #define HistoryDelegate_h
 
 #include <WebKit/WebKit.h>
-#include <wtf/OwnPtr.h>
 
 class HistoryDelegate : public IWebHistoryDelegate {
 public:
index 7f4f93d..6e0fd4a 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <WebCore/COMPtr.h>
 #include <WebKit/WebKit.h>
-#include <wtf/OwnPtr.h>
 #include <windef.h>
 
 class DRTUndoManager;
index 236e469..a281f23 100644 (file)
@@ -30,8 +30,6 @@
 #include "RefLogger.h"
 #include <string>
 #include <wtf/HashMap.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/text/StringHash.h>
 
 namespace TestWebKitAPI {
@@ -174,101 +172,6 @@ TEST(WTF_HashMap, EfficientGetter)
     }
 }
 
-TEST(WTF_HashMap, OwnPtrKey)
-{
-    ConstructorDestructorCounter::TestingScope scope;
-
-    HashMap<OwnPtr<ConstructorDestructorCounter>, int> map;
-
-    OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
-    map.add(WTF::move(ownPtr), 2);
-
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
-
-    map.clear();
-    
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
-}
-
-TEST(WTF_HashMap, OwnPtrKey_FindUsingRawPointer)
-{
-    HashMap<OwnPtr<int>, int> map;
-
-    OwnPtr<int> ownPtr = adoptPtr(new int(5));
-    int* ptr = ownPtr.get();
-    map.add(WTF::move(ownPtr), 2);
-
-    auto it = map.find(ptr);
-    ASSERT_TRUE(it != map.end());
-    EXPECT_EQ(ptr, it->key.get());
-    EXPECT_EQ(2, it->value);
-}
-
-TEST(WTF_HashMap, OwnPtrKey_ContainsUsingRawPointer)
-{
-    HashMap<OwnPtr<int>, int> map;
-
-    OwnPtr<int> ownPtr = adoptPtr(new int(5));
-    int* ptr = ownPtr.get();
-    map.add(WTF::move(ownPtr), 2);
-
-    EXPECT_EQ(true, map.contains(ptr));
-}
-
-TEST(WTF_HashMap, OwnPtrKey_GetUsingRawPointer)
-{
-    HashMap<OwnPtr<int>, int> map;
-
-    OwnPtr<int> ownPtr = adoptPtr(new int(5));
-    int* ptr = ownPtr.get();
-    map.add(WTF::move(ownPtr), 2);
-
-    int value = map.get(ptr);
-    EXPECT_EQ(2, value);
-}
-
-TEST(WTF_HashMap, OwnPtrKey_RemoveUsingRawPointer)
-{
-    ConstructorDestructorCounter::TestingScope scope;
-
-    HashMap<OwnPtr<ConstructorDestructorCounter>, int> map;
-
-    OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
-    ConstructorDestructorCounter* ptr = ownPtr.get();
-    map.add(WTF::move(ownPtr), 2);
-
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
-
-    bool result = map.remove(ptr);
-    EXPECT_EQ(true, result);
-
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
-}
-
-TEST(WTF_HashMap, OwnPtrKey_TakeUsingRawPointer)
-{
-    ConstructorDestructorCounter::TestingScope scope;
-
-    HashMap<OwnPtr<ConstructorDestructorCounter>, int> map;
-
-    OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
-    ConstructorDestructorCounter* ptr = ownPtr.get();
-    map.add(WTF::move(ownPtr), 2);
-
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
-
-    int result = map.take(ptr);
-    EXPECT_EQ(2, result);
-
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
-}
-
 TEST(WTF_HashMap, UniquePtrKey)
 {
     ConstructorDestructorCounter::TestingScope scope;
index 3155bc0..ddb178c 100644 (file)
@@ -28,8 +28,6 @@
 #include "Counters.h"
 #include "MoveOnly.h"
 #include <wtf/HashSet.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 
 namespace TestWebKitAPI {
 
@@ -119,93 +117,6 @@ TEST(WTF_HashSet, MoveOnly)
         EXPECT_TRUE(secondSet.contains(MoveOnly(i + 1)));
 }
 
-TEST(WTF_HashSet, OwnPtrKey)
-{
-    ConstructorDestructorCounter::TestingScope scope;
-
-    HashSet<OwnPtr<ConstructorDestructorCounter>> set;
-
-    OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
-    set.add(WTF::move(ownPtr));
-
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
-
-    set.clear();
-    
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
-}
-
-TEST(WTF_HashSet, OwnPtrKey_FindUsingRawPointer)
-{
-    HashSet<OwnPtr<int>> set;
-
-    OwnPtr<int> ownPtr = adoptPtr(new int(5));
-    int* ptr = ownPtr.get();
-    set.add(WTF::move(ownPtr));
-
-    auto it = set.find(ptr);
-    ASSERT_TRUE(it != set.end());
-    EXPECT_EQ(ptr, it->get());
-    EXPECT_EQ(5, *it->get());
-}
-
-TEST(WTF_HashSet, OwnPtrKey_ContainsUsingRawPointer)
-{
-    HashSet<OwnPtr<int>> set;
-
-    OwnPtr<int> ownPtr = adoptPtr(new int(5));
-    int* ptr = ownPtr.get();
-    set.add(WTF::move(ownPtr));
-
-    EXPECT_EQ(true, set.contains(ptr));
-}
-
-TEST(WTF_HashSet, OwnPtrKey_RemoveUsingRawPointer)
-{
-    ConstructorDestructorCounter::TestingScope scope;
-
-    HashSet<OwnPtr<ConstructorDestructorCounter>> set;
-
-    OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
-    ConstructorDestructorCounter* ptr = ownPtr.get();
-    set.add(WTF::move(ownPtr));
-
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
-
-    bool result = set.remove(ptr);
-    EXPECT_EQ(true, result);
-
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
-}
-
-TEST(WTF_HashSet, OwnPtrKey_TakeUsingRawPointer)
-{
-    ConstructorDestructorCounter::TestingScope scope;
-
-    HashSet<OwnPtr<ConstructorDestructorCounter>> set;
-
-    OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
-    ConstructorDestructorCounter* ptr = ownPtr.get();
-    set.add(WTF::move(ownPtr));
-
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
-
-    auto result = set.take(ptr);
-    EXPECT_EQ(ptr, result.get());
-
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
-
-    result = nullptr;
-
-    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
-    EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
-}
 
 TEST(WTF_HashSet, UniquePtrKey)
 {
index b59a84c..ccdbc61 100644 (file)
@@ -29,7 +29,6 @@
 #include <WebCore/COMPtr.h>
 #include <WebKit/WebKit.h>
 #include <WebKit/WebKitCOMAPI.h>
-#include <wtf/PassOwnPtr.h>
 
 namespace TestWebKitAPI {
 
index 4f001a7..1e45250 100644 (file)
@@ -31,8 +31,6 @@
 
 #include "PlatformUtilities.h"
 #include "PlatformWebView.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 
 namespace TestWebKitAPI {
 
@@ -45,7 +43,7 @@ public:
     }
 
     WKRetainPtr<WKContextRef> context;
-    OwnPtr<PlatformWebView> webView;
+    std::unique_ptr<PlatformWebView> webView;
 
     WKRetainPtr<WKTypeRef> recievedBody;
 
@@ -95,7 +93,7 @@ public:
         context = adoptWK(Util::createContextForInjectedBundleTest("UserMessageTest"));
         setInjectedBundleClient(context.get(), this);
 
-        webView = adoptPtr(new PlatformWebView(context.get()));
+        webView = std::make_unique<PlatformWebView>(context.get());
         setPageLoaderClient(webView->page(), this);
 
         didFinishLoad = false;
index 74b2391..83d63ab 100644 (file)
@@ -31,8 +31,6 @@
 
 #include "PlatformUtilities.h"
 #include "PlatformWebView.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 
 namespace TestWebKitAPI {
 
@@ -44,7 +42,7 @@ public:
     }
 
     WKRetainPtr<WKContextRef> context;
-    OwnPtr<PlatformWebView> webView;
+    std::unique_ptr<PlatformWebView> webView;
 
     WKRetainPtr<WKStringRef> messageName;
     WKRetainPtr<WKTypeRef> messageBody;
@@ -74,7 +72,7 @@ public:
         context = adoptWK(Util::createContextForInjectedBundleTest("WillLoadTest"));
         setInjectedBundleClient(context.get(), this);
 
-        webView = adoptPtr(new PlatformWebView(context.get()));
+        webView = std::make_unique<PlatformWebView>(context.get());
 
         didReceiveMessage = false;
     }
index 2584c20..fc8cefb 100644 (file)
@@ -30,7 +30,7 @@ static gboolean clickedCallback(WebKitDOMDOMWindow*, WebKitDOMEvent*, WebKitDOMD
 
 class WebKitDOMDOMWindowTest : public WebProcessTest {
 public:
-    static PassOwnPtr<WebProcessTest> create() { return adoptPtr(new WebKitDOMDOMWindowTest()); }
+    static std::unique_ptr<WebProcessTest> create() { return std::make_unique<WebKitDOMDOMWindowTest>(); }
 
 private:
     guint64 webPageFromArgs(GVariant* args)
index 06c4e5e..5667fa8 100644 (file)
@@ -26,8 +26,6 @@
 #include <string.h>
 #include <webkit2/webkit-web-extension.h>
 #include <wtf/Deque.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/ProcessID.h>
 #include <wtf/gobject/GRefPtr.h>
 #include <wtf/gobject/GUniquePtr.h>
@@ -83,7 +81,7 @@ struct DelayedSignal {
     CString uri;
 };
 
-Deque<OwnPtr<DelayedSignal>> delayedSignalsQueue;
+Deque<DelayedSignal> delayedSignalsQueue;
 
 static void emitDocumentLoaded(GDBusConnection* connection)
 {
@@ -115,7 +113,7 @@ static void documentLoadedCallback(WebKitWebPage* webPage, WebKitWebExtension* e
     if (data)
         emitDocumentLoaded(G_DBUS_CONNECTION(data));
     else
-        delayedSignalsQueue.append(adoptPtr(new DelayedSignal(DocumentLoadedSignal)));
+        delayedSignalsQueue.append(DelayedSignal(DocumentLoadedSignal));
 }
 
 static void emitURIChanged(GDBusConnection* connection, const char* uri)
@@ -137,7 +135,7 @@ static void uriChangedCallback(WebKitWebPage* webPage, GParamSpec* pspec, WebKit
     if (data)
         emitURIChanged(G_DBUS_CONNECTION(data), webkit_web_page_get_uri(webPage));
     else
-        delayedSignalsQueue.append(adoptPtr(new DelayedSignal(URIChangedSignal, webkit_web_page_get_uri(webPage))));
+        delayedSignalsQueue.append(DelayedSignal(URIChangedSignal, webkit_web_page_get_uri(webPage)));
 }
 
 static gboolean sendRequestCallback(WebKitWebPage*, WebKitURIRequest* request, WebKitURIResponse* redirectResponse, gpointer)
@@ -330,13 +328,13 @@ static void busAcquiredCallback(GDBusConnection* connection, const char* name, g
 
     g_object_set_data(G_OBJECT(userData), "dbus-connection", connection);
     while (delayedSignalsQueue.size()) {
-        OwnPtr<DelayedSignal> delayedSignal = delayedSignalsQueue.takeFirst();
-        switch (delayedSignal->type) {
+        DelayedSignal delayedSignal = delayedSignalsQueue.takeFirst();
+        switch (delayedSignal.type) {
         case DocumentLoadedSignal:
             emitDocumentLoaded(connection);
             break;
         case URIChangedSignal:
-            emitURIChanged(connection, delayedSignal->uri.data());
+            emitURIChanged(connection, delayedSignal.uri.data());
             break;
         }
     }