Changeset 183265 in webkit


Ignore:
Timestamp:
Apr 24, 2015 9:38:28 AM (9 years ago)
Author:
Darin Adler
Message:

Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
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.

Location:
trunk
Files:
6 deleted
56 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r183250 r183265  
     12015-04-24  Darin Adler  <darin@apple.com>
     2
     3        Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
     4        https://bugs.webkit.org/show_bug.cgi?id=128007
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * WTF.vcxproj/WTF.vcxproj: Removed OwnPtr source files.
     9        * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
     10        * WTF.xcodeproj/project.pbxproj: Ditto.
     11        * wtf/CMakeLists.txt: Ditto.
     12
     13        * wtf/Forward.h: Removed OwnPtr and PassOwnPtr.
     14        * wtf/HashTraits.h: Ditto.
     15
     16        * wtf/OwnPtr.h: Removed.
     17        * wtf/OwnPtrCommon.h: Removed.
     18        * wtf/PassOwnPtr.h: Removed.
     19
     20        * wtf/SizeLimits.cpp: Removed OwnPtr.
     21        * wtf/VectorTraits.h: Removed OwnPtr specialization.
     22
    1232015-04-23  Jer Noble  <jer.noble@apple.com>
    224
  • trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj

    r183001 r183265  
    238238    <ClInclude Include="..\wtf\NumberOfCores.h" />
    239239    <ClInclude Include="..\wtf\OSRandomSource.h" />
    240     <ClInclude Include="..\wtf\OwnPtr.h" />
    241     <ClInclude Include="..\wtf\OwnPtrCommon.h" />
    242240    <ClInclude Include="..\wtf\PackedIntVector.h" />
    243241    <ClInclude Include="..\wtf\PageAllocation.h" />
     
    248246    <ClInclude Include="..\wtf\ParallelJobsLibdispatch.h" />
    249247    <ClInclude Include="..\wtf\ParallelJobsOpenMP.h" />
    250     <ClInclude Include="..\wtf\PassOwnPtr.h" />
    251248    <ClInclude Include="..\wtf\PassRefPtr.h" />
    252249    <ClInclude Include="..\wtf\Platform.h" />
  • trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters

    r183001 r183265  
    529529      <Filter>wtf</Filter>
    530530    </ClInclude>
    531     <ClInclude Include="..\wtf\OwnPtr.h">
    532       <Filter>wtf</Filter>
    533     </ClInclude>
    534     <ClInclude Include="..\wtf\OwnPtrCommon.h">
    535       <Filter>wtf</Filter>
    536     </ClInclude>
    537531    <ClInclude Include="..\wtf\PackedIntVector.h">
    538532      <Filter>wtf</Filter>
     
    557551    </ClInclude>
    558552    <ClInclude Include="..\wtf\ParallelJobsOpenMP.h">
    559       <Filter>wtf</Filter>
    560     </ClInclude>
    561     <ClInclude Include="..\wtf\PassOwnPtr.h">
    562553      <Filter>wtf</Filter>
    563554    </ClInclude>
  • trunk/Source/WTF/WTF.xcodeproj/project.pbxproj

    r183190 r183265  
    186186                A8A473F9151A825B004123FF /* OSRandomSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472DA151A825B004123FF /* OSRandomSource.cpp */; };
    187187                A8A473FA151A825B004123FF /* OSRandomSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DB151A825B004123FF /* OSRandomSource.h */; };
    188                 A8A473FC151A825B004123FF /* OwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DD151A825B004123FF /* OwnPtr.h */; };
    189                 A8A473FD151A825B004123FF /* OwnPtrCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DE151A825B004123FF /* OwnPtrCommon.h */; };
    190188                A8A473FE151A825B004123FF /* PackedIntVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DF151A825B004123FF /* PackedIntVector.h */; };
    191189                A8A473FF151A825B004123FF /* PageAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E0151A825B004123FF /* PageAllocation.h */; };
     
    195193                A8A47405151A825B004123FF /* ParallelJobs.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E6151A825B004123FF /* ParallelJobs.h */; };
    196194                A8A47408151A825B004123FF /* ParallelJobsLibdispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E9151A825B004123FF /* ParallelJobsLibdispatch.h */; };
    197                 A8A4740B151A825B004123FF /* PassOwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472EC151A825B004123FF /* PassOwnPtr.h */; };
    198195                A8A4740C151A825B004123FF /* PassRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472ED151A825B004123FF /* PassRefPtr.h */; };
    199196                A8A47414151A825B004123FF /* RandomNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472FB151A825B004123FF /* RandomNumber.cpp */; };
     
    477474                A8A472DA151A825B004123FF /* OSRandomSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSRandomSource.cpp; sourceTree = "<group>"; };
    478475                A8A472DB151A825B004123FF /* OSRandomSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSRandomSource.h; sourceTree = "<group>"; };
    479                 A8A472DD151A825B004123FF /* OwnPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnPtr.h; sourceTree = "<group>"; };
    480                 A8A472DE151A825B004123FF /* OwnPtrCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnPtrCommon.h; sourceTree = "<group>"; };
    481476                A8A472DF151A825B004123FF /* PackedIntVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PackedIntVector.h; sourceTree = "<group>"; };
    482477                A8A472E0151A825B004123FF /* PageAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageAllocation.h; sourceTree = "<group>"; };
     
    486481                A8A472E6151A825B004123FF /* ParallelJobs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelJobs.h; sourceTree = "<group>"; };
    487482                A8A472E9151A825B004123FF /* ParallelJobsLibdispatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelJobsLibdispatch.h; sourceTree = "<group>"; };
    488                 A8A472EC151A825B004123FF /* PassOwnPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PassOwnPtr.h; sourceTree = "<group>"; };
    489483                A8A472ED151A825B004123FF /* PassRefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PassRefPtr.h; sourceTree = "<group>"; };
    490484                A8A472FB151A825B004123FF /* RandomNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RandomNumber.cpp; sourceTree = "<group>"; };
     
    796790                                A8A472DB151A825B004123FF /* OSRandomSource.h */,
    797791                                1AFDE6521953B23D00C48FFA /* Optional.h */,
    798                                 A8A472DD151A825B004123FF /* OwnPtr.h */,
    799                                 A8A472DE151A825B004123FF /* OwnPtrCommon.h */,
    800792                                A8A472DF151A825B004123FF /* PackedIntVector.h */,
    801793                                A8A472E0151A825B004123FF /* PageAllocation.h */,
     
    805797                                A8A472E6151A825B004123FF /* ParallelJobs.h */,
    806798                                A8A472E9151A825B004123FF /* ParallelJobsLibdispatch.h */,
    807                                 A8A472EC151A825B004123FF /* PassOwnPtr.h */,
    808799                                A8A472ED151A825B004123FF /* PassRefPtr.h */,
    809800                                A876DBD7151816E500DADB95 /* Platform.h */,
     
    11321123                                A8A473F6151A825B004123FF /* OSAllocator.h in Headers */,
    11331124                                A8A473FA151A825B004123FF /* OSRandomSource.h in Headers */,
    1134                                 A8A473FC151A825B004123FF /* OwnPtr.h in Headers */,
    1135                                 A8A473FD151A825B004123FF /* OwnPtrCommon.h in Headers */,
    11361125                                0FB14E1B1810E1DC009B6B4D /* BagToHashMap.h in Headers */,
    11371126                                A8A473FE151A825B004123FF /* PackedIntVector.h in Headers */,
     
    11411130                                A8A47405151A825B004123FF /* ParallelJobs.h in Headers */,
    11421131                                A8A47408151A825B004123FF /* ParallelJobsLibdispatch.h in Headers */,
    1143                                 A8A4740B151A825B004123FF /* PassOwnPtr.h in Headers */,
    11441132                                A8A4740C151A825B004123FF /* PassRefPtr.h in Headers */,
    11451133                                A876DBD8151816E500DADB95 /* Platform.h in Headers */,
  • trunk/Source/WTF/wtf/CMakeLists.txt

    r183001 r183265  
    5656    OSAllocator.h
    5757    OSRandomSource.h
    58     OwnPtr.h
    59     OwnPtrCommon.h
    6058    PageAllocation.h
    6159    PageBlock.h
     
    6563    ParallelJobsLibdispatch.h
    6664    ParallelJobsOpenMP.h
    67     PassOwnPtr.h
    6865    PassRefPtr.h
    6966    Platform.h
  • trunk/Source/WTF/wtf/Forward.h

    r178265 r183265  
    2929template<typename T> class LazyNeverDestroyed;
    3030template<typename T> class NeverDestroyed;
    31 template<typename T> class OwnPtr;
    32 template<typename T> class PassOwnPtr;
    3331template<typename T> class PassRefPtr;
    3432template<typename T> class RefPtr;
     
    6664using WTF::NeverDestroyed;
    6765using WTF::OrdinalNumber;
    68 using WTF::OwnPtr;
    69 using WTF::PassOwnPtr;
    7066using WTF::PassRefPtr;
    7167using WTF::PrintStream;
  • trunk/Source/WTF/wtf/HashTraits.h

    r183063 r183265  
    3030
    3131class String;
    32 
    33 template<typename T> class OwnPtr;
    3432
    3533template<typename T> struct HashTraits;
     
    121119};
    122120
    123 template<typename T> struct HashTraits<OwnPtr<T>> : SimpleClassHashTraits<OwnPtr<T>> {
    124     typedef std::nullptr_t EmptyValueType;
    125     static EmptyValueType emptyValue() { return nullptr; }
    126 
    127     typedef T* PeekType;
    128     static T* peek(const OwnPtr<T>& value) { return value.get(); }
    129     static T* peek(std::nullptr_t) { return nullptr; }
    130 };
    131 
    132121template<typename P> struct HashTraits<RefPtr<P>> : SimpleClassHashTraits<RefPtr<P>> {
    133     static P* emptyValue() { return 0; }
     122    static P* emptyValue() { return nullptr; }
    134123
    135124    typedef P* PeekType;
  • trunk/Source/WTF/wtf/SizeLimits.cpp

    r178722 r183265  
    3434#include <utility>
    3535#include <wtf/Assertions.h>
    36 #include <wtf/OwnPtr.h>
    3736#include <wtf/PassRefPtr.h>
    3837#include <wtf/RefCounted.h>
     
    5655#endif
    5756
    58 static_assert(sizeof(OwnPtr<int>) == sizeof(int*), "OwnPtr should stay small!");
    5957static_assert(sizeof(PassRefPtr<RefCounted<int>>) == sizeof(int*), "PassRefPtr should stay small!");
    6058static_assert(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), "RefCounted should stay small!");
  • trunk/Source/WTF/wtf/VectorTraits.h

    r169252 r183265  
    2222#define WTF_VectorTraits_h
    2323
    24 #include <wtf/OwnPtr.h>
    2524#include <wtf/Ref.h>
    2625#include <wtf/RefPtr.h>
     
    6766    };
    6867
    69     // We know OwnPtr and RefPtr are simple enough that initializing to 0 and moving with memcpy
    70     // (and then not destructing the original) will totally work
    71     template<typename P>
    72     struct VectorTraits<RefPtr<P>> : SimpleClassVectorTraits { };
     68    // We know smart pointers are simple enough that initializing to 0 and moving with memcpy
     69    // (and then not destructing the original) will work.
    7370
    74     template<typename P>
    75     struct VectorTraits<OwnPtr<P>> : SimpleClassVectorTraits { };
    76 
    77     template<typename P>
    78     struct VectorTraits<std::unique_ptr<P>> : SimpleClassVectorTraits { };
    79 
    80     template<typename P>
    81     struct VectorTraits<Ref<P>> : SimpleClassVectorTraits { };
    82 
    83     template<>
    84     struct VectorTraits<AtomicString> : SimpleClassVectorTraits { };
     71    template<typename P> struct VectorTraits<RefPtr<P>> : SimpleClassVectorTraits { };
     72    template<typename P> struct VectorTraits<std::unique_ptr<P>> : SimpleClassVectorTraits { };
     73    template<typename P> struct VectorTraits<Ref<P>> : SimpleClassVectorTraits { };
     74    template<> struct VectorTraits<AtomicString> : SimpleClassVectorTraits { };
    8575
    8676    template<typename First, typename Second>
  • trunk/Source/WebCore/ChangeLog

    r183262 r183265  
     12015-04-24  Darin Adler  <darin@apple.com>
     2
     3        Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
     4        https://bugs.webkit.org/show_bug.cgi?id=128007
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * PlatformEfl.cmake: Removed OwnPtrCairo source files.
     9        * PlatformGTK.cmake: Ditto.
     10        * PlatformWinCairo.cmake: Ditto.
     11        * WebCore.vcxproj/WebCore.vcxproj: Ditto.
     12        * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
     13
     14        * platform/CrossThreadCopier.cpp: Removed OwnPtr specialization.
     15        * platform/CrossThreadCopier.h: Ditto.
     16
     17        * platform/ScrollAnimatorNone.cpp: Removed unneeded include.
     18        * platform/ThreadGlobalData.cpp: Ditto.
     19        * platform/ThreadGlobalData.h: Ditto.
     20        * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: Ditto.
     21
     22        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
     23        (WebCore::AVFWrapper::processNotification): Use unique_ptr.
     24        (WebCore::AVFWrapper::notificationCallback): Use make_unique.
     25        (WebCore::AVFWrapper::platformLayer): Ditto.
     26
     27        * platform/graphics/cairo/CairoUtilities.cpp:
     28        (WebCore::appendPathToCairoContext): Use cairo_path_destroy directly
     29        instead of a smart pointer; the code path is simple enough that it is
     30        clear this way.
     31
     32        * platform/graphics/cairo/ImageBufferCairo.cpp:
     33        (WebCore::ImageBuffer::ImageBuffer): Use make_unique.
     34        * platform/graphics/cairo/ImageBufferDataCairo.h: Use unique_ptr.
     35
     36        * platform/graphics/cairo/OwnPtrCairo.cpp: Removed.
     37        * platform/graphics/cairo/OwnPtrCairo.h: Removed.
     38
     39        * platform/graphics/cairo/PathCairo.cpp:
     40        (WebCore::Path::Path): Use cairo_path_destroy directly instead of a
     41        smart pointer; the code path is simple enough that it is clear this way.
     42        (WebCore::Path::operator=): Ditto.
     43        (WebCore::Path::addPath): Ditto.
     44        (WebCore::Path::apply): Ditto.
     45        * platform/graphics/cairo/PlatformContextCairo.cpp:
     46        (WebCore::PlatformContextCairo::clipForPatternFilling): Ditto.
     47
     48        * platform/graphics/freetype/FontCacheFreeType.cpp: Removed unneeded include.
     49        * platform/graphics/glx/GLContextGLX.cpp: Ditto.
     50
     51        * platform/graphics/surfaces/egl/EGLSurface.cpp:
     52        (WebCore::EGLOffScreenSurface::EGLOffScreenSurface): Use make_unique.
     53
     54        * platform/graphics/surfaces/glx/GLXConfigSelector.h:
     55        (WebCore::GLXConfigSelector::findMatchingConfig): Use unique_ptr with X11Deleter.
     56        (WebCore::GLXConfigSelector::findMatchingConfigWithVisualId): Ditto.
     57        * platform/graphics/surfaces/glx/GLXSurface.cpp:
     58        (WebCore::GLXTransportSurface::GLXTransportSurface): Ditto.
     59        (WebCore::GLXOffScreenSurface::initialize): Ditto.
     60
     61        * platform/graphics/surfaces/glx/OwnPtrX11.h: Removed.
     62
     63        * platform/graphics/surfaces/glx/X11Helper.cpp:
     64        (WebCore::X11Helper::createOffScreenWindow): Use unique_ptr with X11Deleter.
     65        (WebCore::X11Helper::createPixmap): Ditto.
     66
     67        * platform/graphics/surfaces/glx/X11Helper.h: Added X11Deleter,
     68        which can be used with unique_ptr to make it call XFree instead of delete.
     69
     70        * platform/graphics/win/FullScreenController.cpp: Use unique_ptr.
     71        (FullScreenController::FullScreenController): Use make_unique.
     72        (FullScreenController::enterFullScreen): Ditto.
     73        * platform/graphics/win/FullScreenController.h: Use unique_ptr.
     74
     75        * platform/graphics/win/GraphicsContext3DWin.cpp: Removed unneeded includes.
     76
     77        * platform/graphics/win/WKCAImageQueue.cpp:
     78        (WebCore::WKCAImageQueue::WKCAImageQueue): Use make_unique.
     79        * platform/graphics/win/WKCAImageQueue.h: Use unique_ptr.
     80
     81        * platform/network/NetworkStorageSessionStub.cpp: Removed unneeded include.
     82
     83        * platform/network/ResourceHandleInternal.h: Use unique_ptr.
     84
     85        * platform/network/curl/MultipartHandle.cpp:
     86        (WebCore::MultipartHandle::create): Deleted.
     87        * platform/network/curl/MultipartHandle.h: Deleted the create function.
     88
     89        * platform/network/curl/ResourceHandleManager.cpp:
     90        (WebCore::headerCallback): Use make_unique.
     91
    1922015-04-24  Per Arne Vollan  <peavo@outlook.com>
    293
  • trunk/Source/WebCore/PlatformEfl.cmake

    r182101 r183265  
    120120    platform/graphics/cairo/ImageCairo.cpp
    121121    platform/graphics/cairo/IntRectCairo.cpp
    122     platform/graphics/cairo/OwnPtrCairo.cpp
    123122    platform/graphics/cairo/PathCairo.cpp
    124123    platform/graphics/cairo/PatternCairo.cpp
  • trunk/Source/WebCore/PlatformGTK.cmake

    r183012 r183265  
    7979    platform/graphics/cairo/ImageCairo.cpp
    8080    platform/graphics/cairo/IntRectCairo.cpp
    81     platform/graphics/cairo/OwnPtrCairo.cpp
    8281    platform/graphics/cairo/PathCairo.cpp
    8382    platform/graphics/cairo/PatternCairo.cpp
  • trunk/Source/WebCore/PlatformWinCairo.cmake

    r182545 r183265  
    5151    platform/graphics/cairo/ImageCairo.cpp
    5252    platform/graphics/cairo/IntRectCairo.cpp
    53     platform/graphics/cairo/OwnPtrCairo.cpp
    5453    platform/graphics/cairo/PathCairo.cpp
    5554    platform/graphics/cairo/PatternCairo.cpp
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r183160 r183265  
    85748574    </ClCompile>
    85758575    <ClCompile Include="..\platform\graphics\cairo\IntRectCairo.cpp">
    8576       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    8577       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    8578       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
    8579       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
    8580       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
    8581       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    8582       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
    8583       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
    8584     </ClCompile>
    8585     <ClCompile Include="..\platform\graphics\cairo\OwnPtrCairo.cpp">
    85868576      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    85878577      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
     
    2011020100    </ClCompile>
    2011120101    <CustomBuildStep Include="..\platform\graphics\cairo\GraphicsContextPlatformPrivateCairo.h">
    20112       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    20113       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    20114       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
    20115       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
    20116       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
    20117       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    20118       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
    20119       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
    20120     </CustomBuildStep>
    20121     <CustomBuildStep Include="..\platform\graphics\cairo\OwnPtrCairo.h">
    2012220102      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    2012320103      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

    r183160 r183265  
    15851585      <Filter>platform\graphics\cairo</Filter>
    15861586    </ClCompile>
    1587     <ClCompile Include="..\platform\graphics\cairo\OwnPtrCairo.cpp">
    1588       <Filter>platform\graphics\cairo</Filter>
    1589     </ClCompile>
    15901587    <ClCompile Include="..\platform\graphics\cairo\PathCairo.cpp">
    15911588      <Filter>platform\graphics\cairo</Filter>
     
    1537015367    </CustomBuildStep>
    1537115368    <CustomBuildStep Include="..\platform\graphics\cairo\GraphicsContextPlatformPrivateCairo.h">
    15372       <Filter>platform\graphics\cairo</Filter>
    15373     </CustomBuildStep>
    15374     <CustomBuildStep Include="..\platform\graphics\cairo\OwnPtrCairo.h">
    1537515369      <Filter>platform\graphics\cairo</Filter>
    1537615370    </CustomBuildStep>
  • trunk/Source/WebCore/platform/CrossThreadCopier.cpp

    r165117 r183265  
    180180               RawPointerRefCountedTest);
    181181
    182 // Verify that PassOwnPtr gets passed through.
    183 COMPILE_ASSERT((std::is_same<
    184                   PassOwnPtr<float>,
    185                   CrossThreadCopier<PassOwnPtr<float>>::Type
    186                   >::value),
    187                PassOwnPtrTest);
    188 
    189 // Verify that PassOwnPtr does not get passed through.
    190 COMPILE_ASSERT((std::is_same<
    191                   int,
    192                   CrossThreadCopier<OwnPtr<float>>::Type
    193                   >::value),
    194                OwnPtrTest);
    195 
    196182} // namespace WebCore
  • trunk/Source/WebCore/platform/CrossThreadCopier.h

    r182866 r183265  
    3434#include <wtf/Assertions.h>
    3535#include <wtf/Forward.h>
    36 #include <wtf/PassOwnPtr.h>
    3736#include <wtf/PassRefPtr.h>
    3837#include <wtf/RefPtr.h>
     
    111110    };
    112111
    113     template<typename T> struct CrossThreadCopierBase<false, false, PassOwnPtr<T>> {
    114         typedef PassOwnPtr<T> Type;
    115         static Type copy(Type ownPtr)
    116         {
    117             return ownPtr;
    118         }
    119     };
    120 
    121112    template<> struct CrossThreadCopierBase<false, false, URL> {
    122113        typedef URL Type;
  • trunk/Source/WebCore/platform/ScrollAnimatorNone.cpp

    r180873 r183265  
    4242#include <algorithm>
    4343#include <wtf/CurrentTime.h>
    44 #include <wtf/PassOwnPtr.h>
    4544
    4645using namespace std;
  • trunk/Source/WebCore/platform/ThreadGlobalData.cpp

    r183234 r183265  
    3333#include "ThreadTimers.h"
    3434#include <wtf/MainThread.h>
    35 #include <wtf/PassOwnPtr.h>
    3635#include <wtf/ThreadSpecific.h>
    3736#include <wtf/Threading.h>
  • trunk/Source/WebCore/platform/ThreadGlobalData.h

    r183186 r183265  
    3131#include <wtf/HashSet.h>
    3232#include <wtf/Noncopyable.h>
    33 #include <wtf/OwnPtr.h>
    3433#include <wtf/text/StringHash.h>
    3534
  • trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h

    r174710 r183265  
    2828
    2929#include "CDMSession.h"
    30 #include <wtf/PassOwnPtr.h>
    3130#include <wtf/RetainPtr.h>
    3231
  • trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp

    r181036 r183265  
    190190    RefPtr<PlatformCALayer> m_videoLayerWrapper;
    191191
    192     OwnPtr<LayerClient> m_layerClient;
     192    std::unique_ptr<LayerClient> m_layerClient;
    193193    COMPtr<IDirect3DDevice9Ex> m_d3dDevice;
    194194
     
    16241624        return;
    16251625
    1626     OwnPtr<NotificationCallbackData> notificationData = adoptPtr(reinterpret_cast<NotificationCallbackData*>(context));
     1626    std::unique_ptr<NotificationCallbackData> notificationData { static_cast<NotificationCallbackData*>(context) };
    16271627
    16281628    MutexLocker locker(mapLock());
     
    16741674#endif
    16751675
    1676     OwnPtr<NotificationCallbackData> notificationData = adoptPtr(new NotificationCallbackData(propertyName, observer));
    1677 
    1678     dispatch_async_f(dispatch_get_main_queue(), notificationData.leakPtr(), processNotification);
     1676    auto notificationData = std::make_unique<NotificationCallbackData>(propertyName, observer);
     1677
     1678    dispatch_async_f(dispatch_get_main_queue(), notificationData.release(), processNotification);
    16791679}
    16801680
     
    19181918
    19191919    // Create a PlatformCALayer so we can resize the video layer to match the element size.
    1920     m_layerClient = adoptPtr(new LayerClient(this));
     1920    m_layerClient = std::make_unique<LayerClient>(this);
    19211921    if (!m_layerClient)
    19221922        return 0;
  • trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp

    r179398 r183265  
    3535#include "FloatRect.h"
    3636#include "IntRect.h"
    37 #include "OwnPtrCairo.h"
    3837#include "Path.h"
    3938#include "PlatformPathCairo.h"
     
    7473void appendPathToCairoContext(cairo_t* to, cairo_t* from)
    7574{
    76     OwnPtr<cairo_path_t> cairoPath = adoptPtr(cairo_copy_path(from));
    77     cairo_append_path(to, cairoPath.get());
     75    auto cairoPath = cairo_copy_path(from);
     76    cairo_append_path(to, cairoPath);
     77    cairo_path_destroy(cairoPath);
    7878}
    7979
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r183234 r183265  
    4444#include <runtime/JSCInlines.h>
    4545#include <runtime/TypedArrayInlines.h>
    46 #include <wtf/PassOwnPtr.h>
    4746#include <wtf/Vector.h>
    4847#include <wtf/text/Base64.h>
     
    120119    RefPtr<cairo_t> cr = adoptRef(cairo_create(m_data.m_surface.get()));
    121120    m_data.m_platformContext.setCr(cr.get());
    122     m_data.m_context = adoptPtr(new GraphicsContext(&m_data.m_platformContext));
     121    m_data.m_context = std::make_unique<GraphicsContext>(&m_data.m_platformContext);
    123122    success = true;
    124123}
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h

    r180342 r183265  
    5151    RefPtr<cairo_surface_t> m_surface;
    5252    PlatformContextCairo m_platformContext;
    53     OwnPtr<GraphicsContext> m_context;
     53    std::unique_ptr<GraphicsContext> m_context;
    5454    IntSize m_size;
    5555
  • trunk/Source/WebCore/platform/graphics/cairo/PathCairo.cpp

    r183088 r183265  
    3232#include "FloatRect.h"
    3333#include "GraphicsContext.h"
    34 #include "OwnPtrCairo.h"
    3534#include "PlatformPathCairo.h"
    3635#include "StrokeStyleApplier.h"
     
    6059
    6160    cairo_t* cr = ensurePlatformPath()->context();
    62     OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(other.platformPath()->context()));
    63     cairo_append_path(cr, pathCopy.get());
     61    auto pathCopy = cairo_copy_path(other.platformPath()->context());
     62    cairo_append_path(cr, pathCopy);
     63    cairo_path_destroy(pathCopy);
    6464}
    6565
     
    8484        clear();
    8585        cairo_t* cr = ensurePlatformPath()->context();
    86         OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(other.platformPath()->context()));
    87         cairo_append_path(cr, pathCopy.get());
     86        auto pathCopy = cairo_copy_path(other.platformPath()->context());
     87        cairo_append_path(cr, pathCopy);
     88        cairo_path_destroy(pathCopy);
    8889    }
    8990
     
    324325    cairo_save(cr);
    325326    cairo_transform(cr, &matrix);
    326     std::unique_ptr<cairo_path_t, void(*)(cairo_path_t*)> pathCopy(cairo_copy_path(cr), [](cairo_path_t* path) {
    327         cairo_path_destroy(path);
    328     });
     327    auto pathCopy = cairo_copy_path(cr);
    329328    cairo_restore(cr);
    330     cairo_append_path(ensurePlatformPath()->context(), pathCopy.get());
     329    cairo_append_path(ensurePlatformPath()->context(), pathCopy);
     330    cairo_path_destroy(pathCopy);
    331331}
    332332
     
    397397
    398398    cairo_t* cr = platformPath()->context();
    399     OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(cr));
     399    auto pathCopy = cairo_copy_path(cr);
    400400    cairo_path_data_t* data;
    401401    PathElement pelement;
     
    429429        }
    430430    }
     431    cairo_path_destroy(pathCopy);
    431432}
    432433
  • trunk/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp

    r179398 r183265  
    3434#include "Gradient.h"
    3535#include "GraphicsContext.h"
    36 #include "OwnPtrCairo.h"
    3736#include "Pattern.h"
    3837#include <cairo.h>
     
    307306
    308307    // Hold current cairo path in a variable for restoring it after configuring the pattern clip rectangle.
    309     OwnPtr<cairo_path_t> currentPath = adoptPtr(cairo_copy_path(m_cr.get()));
     308    auto currentPath = cairo_copy_path(m_cr.get());
    310309    cairo_new_path(m_cr.get());
    311310
     
    338337
    339338    // Restoring cairo path.
    340     cairo_append_path(m_cr.get(), currentPath.get());
     339    cairo_append_path(m_cr.get(), currentPath);
     340    cairo_path_destroy(currentPath);
    341341}
    342342
  • trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp

    r181348 r183265  
    2424
    2525#include "Font.h"
    26 #include "OwnPtrCairo.h"
    2726#include "RefPtrCairo.h"
    2827#include "UTF16UChar32Iterator.h"
  • trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp

    r177429 r183265  
    2525#include <GL/glx.h>
    2626#include <cairo.h>
    27 #include <wtf/OwnPtr.h>
    2827
    2928#if ENABLE(ACCELERATED_2D_CANVAS)
  • trunk/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp

    r177429 r183265  
    131131        return;
    132132
    133     m_configSelector = adoptPtr(new EGLConfigSelector(surfaceAttributes));
     133    m_configSelector = std::make_unique<EGLConfigSelector>(surfaceAttributes);
    134134}
    135135
  • trunk/Source/WebCore/platform/graphics/surfaces/glx/GLXConfigSelector.h

    r163079 r183265  
    141141    {
    142142        int numAvailableConfigs;
    143         OwnPtrX11<GLXFBConfig> temp(glXChooseFBConfig(X11Helper::nativeDisplay(), DefaultScreen(X11Helper::nativeDisplay()), attributes, &numAvailableConfigs));
     143        std::unique_ptr<GLXFBConfig[], X11Deleter> temp(glXChooseFBConfig(X11Helper::nativeDisplay(), DefaultScreen(X11Helper::nativeDisplay()), attributes, &numAvailableConfigs));
    144144
    145145        if (!numAvailableConfigs || !temp.get())
    146146            return 0;
    147147
    148         OwnPtrX11<XVisualInfo> scopedVisualInfo;
    149148        for (int i = 0; i < numAvailableConfigs; ++i) {
    150             scopedVisualInfo = glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]);
     149            std::unique_ptr<XVisualInfo, X11Deleter> scopedVisualInfo { glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]) };
    151150            if (!scopedVisualInfo.get())
    152151                continue;
     
    170169
    171170        // Did not find any visual supporting alpha, select the first available config.
    172         scopedVisualInfo = glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[0]);
     171        std::unique_ptr<XVisualInfo, X11Deleter> scopedVisualInfo { glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[0]) };
    173172
    174173        if ((m_attributes & GLPlatformSurface::SupportAlpha) && (scopedVisualInfo->depth != 32))
     
    181180    {
    182181        int numAvailableConfigs;
    183         OwnPtrX11<GLXFBConfig> temp(glXChooseFBConfig(X11Helper::nativeDisplay(), DefaultScreen(X11Helper::nativeDisplay()), attributes, &numAvailableConfigs));
     182        std::unique_ptr<GLXFBConfig[], X11Deleter> temp(glXChooseFBConfig(X11Helper::nativeDisplay(), DefaultScreen(X11Helper::nativeDisplay()), attributes, &numAvailableConfigs));
    184183
    185184        if (!numAvailableConfigs || !temp.get())
    186185            return 0;
    187186
    188         OwnPtrX11<XVisualInfo> scopedVisualInfo;
    189187        for (int i = 0; i < numAvailableConfigs; ++i) {
    190             scopedVisualInfo = glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]);
     188            std::unique_ptr<XVisualInfo, X11Deleter> scopedVisualInfo { glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]) };
    191189            if (!scopedVisualInfo.get())
    192190                continue;
  • trunk/Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp

    r177429 r183265  
    6868    attributes |= GLPlatformSurface::DoubleBuffered;
    6969    m_configSelector = std::make_unique<GLXConfigSelector>(attributes);
    70     OwnPtrX11<XVisualInfo> visInfo(m_configSelector->visualInfo(m_configSelector->surfaceContextConfig()));
     70    std::unique_ptr<XVisualInfo, X11Deleter> visInfo(m_configSelector->visualInfo(m_configSelector->surfaceContextConfig()));
    7171
    7272    if (!visInfo.get()) {
     
    146146    m_configSelector = std::make_unique<GLXConfigSelector>(attributes);
    147147
    148     OwnPtrX11<XVisualInfo> visualInfo(m_configSelector->visualInfo(m_configSelector->pixmapContextConfig()));
     148    std::unique_ptr<XVisualInfo, X11Deleter> visualInfo(m_configSelector->visualInfo(m_configSelector->pixmapContextConfig()));
    149149    X11Helper::createPixmap(&m_pixmap, *visualInfo.get());
    150150
  • trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.cpp

    r159772 r183265  
    241241    visualInfoTemplate.visualid = visualId;
    242242    int matchingCount = 0;
    243     OwnPtrX11<XVisualInfo> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount));
     243    std::unique_ptr<XVisualInfo, X11Deleter> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount));
    244244    XVisualInfo* foundVisual = 0;
    245245
     
    278278    visualInfoTemplate.visualid = visualId;
    279279    int matchingCount = 0;
    280     OwnPtrX11<XVisualInfo> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount));
     280    std::unique_ptr<XVisualInfo, X11Deleter> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount));
    281281    XVisualInfo* foundVisual = 0;
    282282    int requiredDepth = hasAlpha ? 32 : 24;
  • trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.h

    r151227 r183265  
    2828
    2929#include "IntRect.h"
    30 #include "OwnPtrX11.h"
    3130
    3231#if USE(EGL)
     
    4443namespace WebCore {
    4544
     45class X11Deleter {
     46public:
     47    template<typename T> void operator()(T* resource)
     48    {
     49        if (resource)
     50            XFree(resource);
     51    }
     52};
     53
    4654class X11Helper {
    47 
    4855public:
    4956    static void createPixmap(Pixmap*, const XVisualInfo&, const IntSize& = IntSize(1, 1));
     
    6269
    6370class ScopedXPixmapCreationErrorHandler {
    64 
    6571public:
    6672    ScopedXPixmapCreationErrorHandler();
  • trunk/Source/WebCore/platform/graphics/win/FullScreenController.cpp

    r183234 r183265  
    3737#include "Timer.h"
    3838#include "WebCoreInstanceHandle.h"
    39 #include <wtf/PassOwnPtr.h>
    4039#include <wtf/RefPtr.h>
    4140
     
    6160    FullScreenController* m_controller;
    6261    FullScreenControllerClient* m_client;
    63     OwnPtr<MediaPlayerPrivateFullscreenWindow> m_fullScreenWindow;
    64     OwnPtr<MediaPlayerPrivateFullscreenWindow> m_backgroundWindow;
     62    std::unique_ptr<MediaPlayerPrivateFullscreenWindow> m_fullScreenWindow;
     63    std::unique_ptr<MediaPlayerPrivateFullscreenWindow> m_backgroundWindow;
    6564    IntRect m_fullScreenFrame;
    6665    IntRect m_originalFrame;
     
    105104
    106105FullScreenController::FullScreenController(FullScreenControllerClient* client)
    107     : m_private(adoptPtr(new FullScreenController::Private(this, client)))
     106    : m_private(std::make_unique<Private>(this, client))
    108107{
    109108    ASSERT_ARG(client, client);
     
    135134
    136135    ASSERT(!m_private->m_backgroundWindow);
    137     m_private->m_backgroundWindow = adoptPtr(new MediaPlayerPrivateFullscreenWindow(m_private.get()));
     136    m_private->m_backgroundWindow = std::make_unique<MediaPlayerPrivateFullscreenWindow>(m_private.get());
    138137    m_private->m_backgroundWindow->createWindow(0);
    139138    ::AnimateWindow(m_private->m_backgroundWindow->hwnd(), kFullScreenAnimationDuration, AW_BLEND | AW_ACTIVATE);
     
    141140    m_private->m_client->fullScreenClientWillEnterFullScreen();
    142141    ASSERT(!m_private->m_fullScreenWindow);
    143     m_private->m_fullScreenWindow = adoptPtr(new MediaPlayerPrivateFullscreenWindow(m_private.get()));
     142    m_private->m_fullScreenWindow = std::make_unique<MediaPlayerPrivateFullscreenWindow>(m_private.get());
    144143    ASSERT(m_private->m_fullScreenWindow);
    145144    m_private->m_fullScreenWindow->createWindow(0);
  • trunk/Source/WebCore/platform/graphics/win/FullScreenController.h

    r165676 r183265  
    2929#if ENABLE(FULLSCREEN_API)
    3030
    31 #include <wtf/OwnPtr.h>
     31#include <memory>
    3232
    3333namespace WebCore {
     
    5555    class Private;
    5656    friend class Private;
    57     OwnPtr<FullScreenController::Private> m_private;
     57    std::unique_ptr<FullScreenController::Private> m_private;
    5858};
    5959
  • trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp

    r180609 r183265  
    3030#include "GraphicsContext3DPrivate.h"
    3131#include <WebCore/PlatformCALayerWin.h>
    32 #include <wtf/OwnPtr.h>
    33 #include <wtf/PassOwnPtr.h>
    3432
    3533#if PLATFORM(WIN)
  • trunk/Source/WebCore/platform/graphics/win/WKCAImageQueue.cpp

    r163079 r183265  
    2929#include <CoreFoundation/CoreFoundation.h>
    3030#include <WebKitSystemInterface/WebKitSystemInterface.h>
    31 #include <wtf/PassOwnPtr.h>
    3231#include <wtf/RetainPtr.h>
    3332
     
    5352
    5453WKCAImageQueue::WKCAImageQueue(uint32_t width, uint32_t height, uint32_t capacity)
    55     : m_private(adoptPtr(new WKCAImageQueuePrivate()))
     54    : m_private(std::make_unique<WKCAImageQueuePrivate>())
    5655{
    5756    m_private->m_imageQueue = adoptCF(wkCAImageQueueCreate(width, height, capacity));
     
    5958
    6059WKCAImageQueue::WKCAImageQueue(const WKCAImageQueue& o)
    61     : m_private(adoptPtr(new WKCAImageQueuePrivate()))
     60    : m_private(std::make_unique<WKCAImageQueuePrivate>())
    6261{
    6362    m_private->m_imageQueue = o.m_private->m_imageQueue;
  • trunk/Source/WebCore/platform/graphics/win/WKCAImageQueue.h

    r163079 r183265  
    3030typedef const struct __CFDictionary * CFDictionaryRef;
    3131
     32#include <memory>
    3233#include <stdint.h>
    33 #include <wtf/OwnPtr.h>
    3434
    3535namespace WebCore {
     
    8181    WKCAImageQueue(const WKCAImageQueue&);
    8282    WKCAImageQueue& operator=(const WKCAImageQueue&);
    83     OwnPtr<WKCAImageQueuePrivate> m_private;
     83    std::unique_ptr<WKCAImageQueuePrivate> m_private;
    8484};
    8585
  • trunk/Source/WebCore/platform/network/NetworkStorageSessionStub.cpp

    r166506 r183265  
    3131
    3232#include "NetworkingContext.h"
    33 #include <wtf/PassOwnPtr.h>
    3433
    3534namespace WebCore {
  • trunk/Source/WebCore/platform/network/ResourceHandleInternal.h

    r183234 r183265  
    3232#include "AuthenticationChallenge.h"
    3333#include "Timer.h"
    34 #include <wtf/OwnPtr.h>
    3534
    3635#if USE(CFNETWORK)
     
    164163        Vector<char> m_postBytes;
    165164
    166         OwnPtr<MultipartHandle> m_multipartHandle;
     165        std::unique_ptr<MultipartHandle> m_multipartHandle;
    167166#endif
    168167#if USE(SOUP)
  • trunk/Source/WebCore/platform/network/curl/MultipartHandle.cpp

    r182795 r183265  
    3838namespace WebCore {
    3939
    40 PassOwnPtr<MultipartHandle> MultipartHandle::create(ResourceHandle* handle, const String& boundary)
    41 {
    42     return adoptPtr(new MultipartHandle(handle, boundary));
    43 }
    44 
    4540bool MultipartHandle::extractBoundary(const String& contentType, String& boundary)
    4641{
  • trunk/Source/WebCore/platform/network/curl/MultipartHandle.h

    r155633 r183265  
    2929#include "HTTPHeaderMap.h"
    3030#include "ResourceHandle.h"
    31 
    32 #include <wtf/OwnPtr.h>
    3331#include <wtf/Vector.h>
    3432#include <wtf/text/WTFString.h>
     
    3735
    3836class MultipartHandle {
    39 
    4037public:
    41     static PassOwnPtr<MultipartHandle> create(ResourceHandle* handle, const String& boundary);
    4238    static bool extractBoundary(const String& contentType, String& boundary);
    4339
  • trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp

    r177080 r183265  
    516516            bool parsed = MultipartHandle::extractBoundary(d->m_response.httpHeaderField(HTTPHeaderName::ContentType), boundary);
    517517            if (parsed)
    518                 d->m_multipartHandle = MultipartHandle::create(job, boundary);
     518                d->m_multipartHandle = std::make_unique<MultipartHandle>(job, boundary);
    519519        }
    520520
  • trunk/Source/WebKit2/ChangeLog

    r183263 r183265  
     12015-04-24  Darin Adler  <darin@apple.com>
     2
     3        Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
     4        https://bugs.webkit.org/show_bug.cgi?id=128007
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * NetworkProcess/cache/NetworkCacheEncoder.h: Added an include now
     9        needed that was inherited from OwnPtr.h before.
     10
    1112015-04-24  Antti Koivisto  <antti@apple.com>
    212
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheEncoder.h

    r181140 r183265  
    3030
    3131#include "NetworkCacheCoder.h"
    32 
     32#include <wtf/HashFunctions.h>
    3333#include <wtf/StringHasher.h>
    3434#include <wtf/Vector.h>
  • trunk/Tools/ChangeLog

    r183264 r183265  
     12015-04-24  Darin Adler  <darin@apple.com>
     2
     3        Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
     4        https://bugs.webkit.org/show_bug.cgi?id=128007
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * DumpRenderTree/win/HistoryDelegate.h: Removed unneeded include.
     9        * DumpRenderTree/win/UIDelegate.h: Ditto.
     10
     11        * TestWebKitAPI/Tests/WTF/HashMap.cpp: Removed OwnPtr-specific test cases.
     12        * TestWebKitAPI/Tests/WTF/HashSet.cpp: Ditto.
     13
     14        * TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp: Removed unneeded include.
     15
     16        * TestWebKitAPI/Tests/WebKit2/UserMessage.cpp: Use unique_ptr.
     17        (TestWebKitAPI::WebKit2UserMessageRoundTripTest::SetUp): Use make_unique.
     18        * TestWebKitAPI/Tests/WebKit2/WillLoad.cpp: Ditto.
     19        (TestWebKitAPI::WebKit2WillLoadTest::SetUp): Ditto.
     20        * TestWebKitAPI/Tests/WebKit2Gtk/DOMDOMWindowTest.cpp:
     21        (WebKitDOMDOMWindowTest::create): Ditto.
     22        * TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
     23        (documentLoadedCallback): Use a queue of DelayedSignal objects instead
     24        of smart pointers to DelayedSIgnal objects.
     25        (uriChangedCallback): Ditto.
     26
    1272015-04-24  Brent Fulgham  <bfulgham@apple.com>
    228
  • trunk/Tools/DumpRenderTree/win/HistoryDelegate.h

    r165676 r183265  
    2828
    2929#include <WebKit/WebKit.h>
    30 #include <wtf/OwnPtr.h>
    3130
    3231class HistoryDelegate : public IWebHistoryDelegate {
  • trunk/Tools/DumpRenderTree/win/UIDelegate.h

    r172977 r183265  
    3232#include <WebCore/COMPtr.h>
    3333#include <WebKit/WebKit.h>
    34 #include <wtf/OwnPtr.h>
    3534#include <windef.h>
    3635
  • trunk/Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp

    r181348 r183265  
    3131#include <string>
    3232#include <wtf/HashMap.h>
    33 #include <wtf/OwnPtr.h>
    34 #include <wtf/PassOwnPtr.h>
    3533#include <wtf/text/StringHash.h>
    3634
     
    175173}
    176174
    177 TEST(WTF_HashMap, OwnPtrKey)
     175TEST(WTF_HashMap, UniquePtrKey)
    178176{
    179177    ConstructorDestructorCounter::TestingScope scope;
    180178
    181     HashMap<OwnPtr<ConstructorDestructorCounter>, int> map;
    182 
    183     OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
    184     map.add(WTF::move(ownPtr), 2);
     179    HashMap<std::unique_ptr<ConstructorDestructorCounter>, int> map;
     180
     181    auto uniquePtr = std::make_unique<ConstructorDestructorCounter>();
     182    map.add(WTF::move(uniquePtr), 2);
    185183
    186184    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
     
    193191}
    194192
    195 TEST(WTF_HashMap, OwnPtrKey_FindUsingRawPointer)
    196 {
    197     HashMap<OwnPtr<int>, int> map;
    198 
    199     OwnPtr<int> ownPtr = adoptPtr(new int(5));
    200     int* ptr = ownPtr.get();
    201     map.add(WTF::move(ownPtr), 2);
     193TEST(WTF_HashMap, UniquePtrKey_CustomDeleter)
     194{
     195    ConstructorDestructorCounter::TestingScope constructorDestructorCounterScope;
     196    DeleterCounter<ConstructorDestructorCounter>::TestingScope deleterCounterScope;
     197
     198    HashMap<std::unique_ptr<ConstructorDestructorCounter, DeleterCounter<ConstructorDestructorCounter>>, int> map;
     199
     200    std::unique_ptr<ConstructorDestructorCounter, DeleterCounter<ConstructorDestructorCounter>> uniquePtr(new ConstructorDestructorCounter(), DeleterCounter<ConstructorDestructorCounter>());
     201    map.add(WTF::move(uniquePtr), 2);
     202
     203    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
     204    EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
     205
     206    EXPECT_EQ(0u, DeleterCounter<ConstructorDestructorCounter>::deleterCount);
     207
     208    map.clear();
     209   
     210    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
     211    EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
     212
     213    EXPECT_EQ(1u, DeleterCounter<ConstructorDestructorCounter>::deleterCount);
     214}
     215
     216TEST(WTF_HashMap, UniquePtrKey_FindUsingRawPointer)
     217{
     218    HashMap<std::unique_ptr<int>, int> map;
     219
     220    auto uniquePtr = std::make_unique<int>(5);
     221    int* ptr = uniquePtr.get();
     222    map.add(WTF::move(uniquePtr), 2);
    202223
    203224    auto it = map.find(ptr);
     
    207228}
    208229
    209 TEST(WTF_HashMap, OwnPtrKey_ContainsUsingRawPointer)
    210 {
    211     HashMap<OwnPtr<int>, int> map;
    212 
    213     OwnPtr<int> ownPtr = adoptPtr(new int(5));
    214     int* ptr = ownPtr.get();
    215     map.add(WTF::move(ownPtr), 2);
    216 
    217     EXPECT_EQ(true, map.contains(ptr));
    218 }
    219 
    220 TEST(WTF_HashMap, OwnPtrKey_GetUsingRawPointer)
    221 {
    222     HashMap<OwnPtr<int>, int> map;
    223 
    224     OwnPtr<int> ownPtr = adoptPtr(new int(5));
    225     int* ptr = ownPtr.get();
    226     map.add(WTF::move(ownPtr), 2);
    227 
    228     int value = map.get(ptr);
    229     EXPECT_EQ(2, value);
    230 }
    231 
    232 TEST(WTF_HashMap, OwnPtrKey_RemoveUsingRawPointer)
    233 {
    234     ConstructorDestructorCounter::TestingScope scope;
    235 
    236     HashMap<OwnPtr<ConstructorDestructorCounter>, int> map;
    237 
    238     OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
    239     ConstructorDestructorCounter* ptr = ownPtr.get();
    240     map.add(WTF::move(ownPtr), 2);
    241 
    242     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    243     EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
    244 
    245     bool result = map.remove(ptr);
    246     EXPECT_EQ(true, result);
    247 
    248     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    249     EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
    250 }
    251 
    252 TEST(WTF_HashMap, OwnPtrKey_TakeUsingRawPointer)
    253 {
    254     ConstructorDestructorCounter::TestingScope scope;
    255 
    256     HashMap<OwnPtr<ConstructorDestructorCounter>, int> map;
    257 
    258     OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
    259     ConstructorDestructorCounter* ptr = ownPtr.get();
    260     map.add(WTF::move(ownPtr), 2);
    261 
    262     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    263     EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
    264 
    265     int result = map.take(ptr);
    266     EXPECT_EQ(2, result);
    267 
    268     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    269     EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
    270 }
    271 
    272 TEST(WTF_HashMap, UniquePtrKey)
    273 {
    274     ConstructorDestructorCounter::TestingScope scope;
    275 
    276     HashMap<std::unique_ptr<ConstructorDestructorCounter>, int> map;
    277 
    278     auto uniquePtr = std::make_unique<ConstructorDestructorCounter>();
    279     map.add(WTF::move(uniquePtr), 2);
    280 
    281     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    282     EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
    283 
    284     map.clear();
    285    
    286     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    287     EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
    288 }
    289 
    290 TEST(WTF_HashMap, UniquePtrKey_CustomDeleter)
    291 {
    292     ConstructorDestructorCounter::TestingScope constructorDestructorCounterScope;
    293     DeleterCounter<ConstructorDestructorCounter>::TestingScope deleterCounterScope;
    294 
    295     HashMap<std::unique_ptr<ConstructorDestructorCounter, DeleterCounter<ConstructorDestructorCounter>>, int> map;
    296 
    297     std::unique_ptr<ConstructorDestructorCounter, DeleterCounter<ConstructorDestructorCounter>> uniquePtr(new ConstructorDestructorCounter(), DeleterCounter<ConstructorDestructorCounter>());
    298     map.add(WTF::move(uniquePtr), 2);
    299 
    300     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    301     EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
    302 
    303     EXPECT_EQ(0u, DeleterCounter<ConstructorDestructorCounter>::deleterCount);
    304 
    305     map.clear();
    306    
    307     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    308     EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
    309 
    310     EXPECT_EQ(1u, DeleterCounter<ConstructorDestructorCounter>::deleterCount);
    311 }
    312 
    313 TEST(WTF_HashMap, UniquePtrKey_FindUsingRawPointer)
    314 {
    315     HashMap<std::unique_ptr<int>, int> map;
    316 
    317     auto uniquePtr = std::make_unique<int>(5);
    318     int* ptr = uniquePtr.get();
    319     map.add(WTF::move(uniquePtr), 2);
    320 
    321     auto it = map.find(ptr);
    322     ASSERT_TRUE(it != map.end());
    323     EXPECT_EQ(ptr, it->key.get());
    324     EXPECT_EQ(2, it->value);
    325 }
    326 
    327230TEST(WTF_HashMap, UniquePtrKey_ContainsUsingRawPointer)
    328231{
  • trunk/Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp

    r181348 r183265  
    2929#include "MoveOnly.h"
    3030#include <wtf/HashSet.h>
    31 #include <wtf/OwnPtr.h>
    32 #include <wtf/PassOwnPtr.h>
    3331
    3432namespace TestWebKitAPI {
     
    120118}
    121119
    122 TEST(WTF_HashSet, OwnPtrKey)
     120
     121TEST(WTF_HashSet, UniquePtrKey)
    123122{
    124123    ConstructorDestructorCounter::TestingScope scope;
    125124
    126     HashSet<OwnPtr<ConstructorDestructorCounter>> set;
    127 
    128     OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
    129     set.add(WTF::move(ownPtr));
     125    HashSet<std::unique_ptr<ConstructorDestructorCounter>> set;
     126
     127    auto uniquePtr = std::make_unique<ConstructorDestructorCounter>();
     128    set.add(WTF::move(uniquePtr));
    130129
    131130    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
     
    133132
    134133    set.clear();
    135    
     134
    136135    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    137136    EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
    138137}
    139138
    140 TEST(WTF_HashSet, OwnPtrKey_FindUsingRawPointer)
    141 {
    142     HashSet<OwnPtr<int>> set;
    143 
    144     OwnPtr<int> ownPtr = adoptPtr(new int(5));
    145     int* ptr = ownPtr.get();
    146     set.add(WTF::move(ownPtr));
     139TEST(WTF_HashSet, UniquePtrKey_FindUsingRawPointer)
     140{
     141    HashSet<std::unique_ptr<int>> set;
     142
     143    auto uniquePtr = std::make_unique<int>(5);
     144    int* ptr = uniquePtr.get();
     145    set.add(WTF::move(uniquePtr));
    147146
    148147    auto it = set.find(ptr);
     
    152151}
    153152
    154 TEST(WTF_HashSet, OwnPtrKey_ContainsUsingRawPointer)
    155 {
    156     HashSet<OwnPtr<int>> set;
    157 
    158     OwnPtr<int> ownPtr = adoptPtr(new int(5));
    159     int* ptr = ownPtr.get();
    160     set.add(WTF::move(ownPtr));
     153TEST(WTF_HashSet, UniquePtrKey_ContainsUsingRawPointer)
     154{
     155    HashSet<std::unique_ptr<int>> set;
     156
     157    auto uniquePtr = std::make_unique<int>(5);
     158    int* ptr = uniquePtr.get();
     159    set.add(WTF::move(uniquePtr));
    161160
    162161    EXPECT_EQ(true, set.contains(ptr));
    163162}
    164163
    165 TEST(WTF_HashSet, OwnPtrKey_RemoveUsingRawPointer)
     164TEST(WTF_HashSet, UniquePtrKey_RemoveUsingRawPointer)
    166165{
    167166    ConstructorDestructorCounter::TestingScope scope;
    168167
    169     HashSet<OwnPtr<ConstructorDestructorCounter>> set;
    170 
    171     OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
    172     ConstructorDestructorCounter* ptr = ownPtr.get();
    173     set.add(WTF::move(ownPtr));
     168    HashSet<std::unique_ptr<ConstructorDestructorCounter>> set;
     169
     170    auto uniquePtr = std::make_unique<ConstructorDestructorCounter>();
     171    ConstructorDestructorCounter* ptr = uniquePtr.get();
     172    set.add(WTF::move(uniquePtr));
    174173
    175174    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
     
    183182}
    184183
    185 TEST(WTF_HashSet, OwnPtrKey_TakeUsingRawPointer)
     184TEST(WTF_HashSet, UniquePtrKey_TakeUsingRawPointer)
    186185{
    187186    ConstructorDestructorCounter::TestingScope scope;
    188187
    189     HashSet<OwnPtr<ConstructorDestructorCounter>> set;
    190 
    191     OwnPtr<ConstructorDestructorCounter> ownPtr = adoptPtr(new ConstructorDestructorCounter);
    192     ConstructorDestructorCounter* ptr = ownPtr.get();
    193     set.add(WTF::move(ownPtr));
     188    HashSet<std::unique_ptr<ConstructorDestructorCounter>> set;
     189
     190    auto uniquePtr = std::make_unique<ConstructorDestructorCounter>();
     191    ConstructorDestructorCounter* ptr = uniquePtr.get();
     192    set.add(WTF::move(uniquePtr));
    194193
    195194    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
     
    201200    EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    202201    EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
    203 
    204     result = nullptr;
    205 
    206     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    207     EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
    208 }
    209 
    210 TEST(WTF_HashSet, UniquePtrKey)
    211 {
    212     ConstructorDestructorCounter::TestingScope scope;
    213 
    214     HashSet<std::unique_ptr<ConstructorDestructorCounter>> set;
    215 
    216     auto uniquePtr = std::make_unique<ConstructorDestructorCounter>();
    217     set.add(WTF::move(uniquePtr));
    218 
    219     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    220     EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
    221 
    222     set.clear();
    223 
    224     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    225     EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
    226 }
    227 
    228 TEST(WTF_HashSet, UniquePtrKey_FindUsingRawPointer)
    229 {
    230     HashSet<std::unique_ptr<int>> set;
    231 
    232     auto uniquePtr = std::make_unique<int>(5);
    233     int* ptr = uniquePtr.get();
    234     set.add(WTF::move(uniquePtr));
    235 
    236     auto it = set.find(ptr);
    237     ASSERT_TRUE(it != set.end());
    238     EXPECT_EQ(ptr, it->get());
    239     EXPECT_EQ(5, *it->get());
    240 }
    241 
    242 TEST(WTF_HashSet, UniquePtrKey_ContainsUsingRawPointer)
    243 {
    244     HashSet<std::unique_ptr<int>> set;
    245 
    246     auto uniquePtr = std::make_unique<int>(5);
    247     int* ptr = uniquePtr.get();
    248     set.add(WTF::move(uniquePtr));
    249 
    250     EXPECT_EQ(true, set.contains(ptr));
    251 }
    252 
    253 TEST(WTF_HashSet, UniquePtrKey_RemoveUsingRawPointer)
    254 {
    255     ConstructorDestructorCounter::TestingScope scope;
    256 
    257     HashSet<std::unique_ptr<ConstructorDestructorCounter>> set;
    258 
    259     auto uniquePtr = std::make_unique<ConstructorDestructorCounter>();
    260     ConstructorDestructorCounter* ptr = uniquePtr.get();
    261     set.add(WTF::move(uniquePtr));
    262 
    263     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    264     EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
    265 
    266     bool result = set.remove(ptr);
    267     EXPECT_EQ(true, result);
    268 
    269     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    270     EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount);
    271 }
    272 
    273 TEST(WTF_HashSet, UniquePtrKey_TakeUsingRawPointer)
    274 {
    275     ConstructorDestructorCounter::TestingScope scope;
    276 
    277     HashSet<std::unique_ptr<ConstructorDestructorCounter>> set;
    278 
    279     auto uniquePtr = std::make_unique<ConstructorDestructorCounter>();
    280     ConstructorDestructorCounter* ptr = uniquePtr.get();
    281     set.add(WTF::move(uniquePtr));
    282 
    283     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    284     EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
    285 
    286     auto result = set.take(ptr);
    287     EXPECT_EQ(ptr, result.get());
    288 
    289     EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount);
    290     EXPECT_EQ(0u, ConstructorDestructorCounter::destructionCount);
    291202   
    292203    result = nullptr;
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp

    r174471 r183265  
    3030#include <WebKit/WebKit.h>
    3131#include <WebKit/WebKitCOMAPI.h>
    32 #include <wtf/PassOwnPtr.h>
    3332
    3433namespace TestWebKitAPI {
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2/UserMessage.cpp

    r177506 r183265  
    3232#include "PlatformUtilities.h"
    3333#include "PlatformWebView.h"
    34 #include <wtf/OwnPtr.h>
    35 #include <wtf/PassOwnPtr.h>
    3634
    3735namespace TestWebKitAPI {
     
    4644
    4745    WKRetainPtr<WKContextRef> context;
    48     OwnPtr<PlatformWebView> webView;
     46    std::unique_ptr<PlatformWebView> webView;
    4947
    5048    WKRetainPtr<WKTypeRef> recievedBody;
     
    9694        setInjectedBundleClient(context.get(), this);
    9795
    98         webView = adoptPtr(new PlatformWebView(context.get()));
     96        webView = std::make_unique<PlatformWebView>(context.get());
    9997        setPageLoaderClient(webView->page(), this);
    10098
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2/WillLoad.cpp

    r177506 r183265  
    3232#include "PlatformUtilities.h"
    3333#include "PlatformWebView.h"
    34 #include <wtf/OwnPtr.h>
    35 #include <wtf/PassOwnPtr.h>
    3634
    3735namespace TestWebKitAPI {
     
    4543
    4644    WKRetainPtr<WKContextRef> context;
    47     OwnPtr<PlatformWebView> webView;
     45    std::unique_ptr<PlatformWebView> webView;
    4846
    4947    WKRetainPtr<WKStringRef> messageName;
     
    7573        setInjectedBundleClient(context.get(), this);
    7674
    77         webView = adoptPtr(new PlatformWebView(context.get()));
     75        webView = std::make_unique<PlatformWebView>(context.get());
    7876
    7977        didReceiveMessage = false;
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMDOMWindowTest.cpp

    r165746 r183265  
    3131class WebKitDOMDOMWindowTest : public WebProcessTest {
    3232public:
    33     static PassOwnPtr<WebProcessTest> create() { return adoptPtr(new WebKitDOMDOMWindowTest()); }
     33    static std::unique_ptr<WebProcessTest> create() { return std::make_unique<WebKitDOMDOMWindowTest>(); }
    3434
    3535private:
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp

    r180214 r183265  
    2727#include <webkit2/webkit-web-extension.h>
    2828#include <wtf/Deque.h>
    29 #include <wtf/OwnPtr.h>
    30 #include <wtf/PassOwnPtr.h>
    3129#include <wtf/ProcessID.h>
    3230#include <wtf/gobject/GRefPtr.h>
     
    8482};
    8583
    86 Deque<OwnPtr<DelayedSignal>> delayedSignalsQueue;
     84Deque<DelayedSignal> delayedSignalsQueue;
    8785
    8886static void emitDocumentLoaded(GDBusConnection* connection)
     
    116114        emitDocumentLoaded(G_DBUS_CONNECTION(data));
    117115    else
    118         delayedSignalsQueue.append(adoptPtr(new DelayedSignal(DocumentLoadedSignal)));
     116        delayedSignalsQueue.append(DelayedSignal(DocumentLoadedSignal));
    119117}
    120118
     
    138136        emitURIChanged(G_DBUS_CONNECTION(data), webkit_web_page_get_uri(webPage));
    139137    else
    140         delayedSignalsQueue.append(adoptPtr(new DelayedSignal(URIChangedSignal, webkit_web_page_get_uri(webPage))));
     138        delayedSignalsQueue.append(DelayedSignal(URIChangedSignal, webkit_web_page_get_uri(webPage)));
    141139}
    142140
     
    331329    g_object_set_data(G_OBJECT(userData), "dbus-connection", connection);
    332330    while (delayedSignalsQueue.size()) {
    333         OwnPtr<DelayedSignal> delayedSignal = delayedSignalsQueue.takeFirst();
    334         switch (delayedSignal->type) {
     331        DelayedSignal delayedSignal = delayedSignalsQueue.takeFirst();
     332        switch (delayedSignal.type) {
    335333        case DocumentLoadedSignal:
    336334            emitDocumentLoaded(connection);
    337335            break;
    338336        case URIChangedSignal:
    339             emitURIChanged(connection, delayedSignal->uri.data());
     337            emitURIChanged(connection, delayedSignal.uri.data());
    340338            break;
    341339        }
Note: See TracChangeset for help on using the changeset viewer.