Changeset 183265 in webkit
- Timestamp:
- Apr 24, 2015 9:38:28 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 deleted
- 56 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r183250 r183265 1 2015-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 1 23 2015-04-23 Jer Noble <jer.noble@apple.com> 2 24 -
trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj
r183001 r183265 238 238 <ClInclude Include="..\wtf\NumberOfCores.h" /> 239 239 <ClInclude Include="..\wtf\OSRandomSource.h" /> 240 <ClInclude Include="..\wtf\OwnPtr.h" />241 <ClInclude Include="..\wtf\OwnPtrCommon.h" />242 240 <ClInclude Include="..\wtf\PackedIntVector.h" /> 243 241 <ClInclude Include="..\wtf\PageAllocation.h" /> … … 248 246 <ClInclude Include="..\wtf\ParallelJobsLibdispatch.h" /> 249 247 <ClInclude Include="..\wtf\ParallelJobsOpenMP.h" /> 250 <ClInclude Include="..\wtf\PassOwnPtr.h" />251 248 <ClInclude Include="..\wtf\PassRefPtr.h" /> 252 249 <ClInclude Include="..\wtf\Platform.h" /> -
trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters
r183001 r183265 529 529 <Filter>wtf</Filter> 530 530 </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>537 531 <ClInclude Include="..\wtf\PackedIntVector.h"> 538 532 <Filter>wtf</Filter> … … 557 551 </ClInclude> 558 552 <ClInclude Include="..\wtf\ParallelJobsOpenMP.h"> 559 <Filter>wtf</Filter>560 </ClInclude>561 <ClInclude Include="..\wtf\PassOwnPtr.h">562 553 <Filter>wtf</Filter> 563 554 </ClInclude> -
trunk/Source/WTF/WTF.xcodeproj/project.pbxproj
r183190 r183265 186 186 A8A473F9151A825B004123FF /* OSRandomSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472DA151A825B004123FF /* OSRandomSource.cpp */; }; 187 187 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 */; };190 188 A8A473FE151A825B004123FF /* PackedIntVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DF151A825B004123FF /* PackedIntVector.h */; }; 191 189 A8A473FF151A825B004123FF /* PageAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E0151A825B004123FF /* PageAllocation.h */; }; … … 195 193 A8A47405151A825B004123FF /* ParallelJobs.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E6151A825B004123FF /* ParallelJobs.h */; }; 196 194 A8A47408151A825B004123FF /* ParallelJobsLibdispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E9151A825B004123FF /* ParallelJobsLibdispatch.h */; }; 197 A8A4740B151A825B004123FF /* PassOwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472EC151A825B004123FF /* PassOwnPtr.h */; };198 195 A8A4740C151A825B004123FF /* PassRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472ED151A825B004123FF /* PassRefPtr.h */; }; 199 196 A8A47414151A825B004123FF /* RandomNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472FB151A825B004123FF /* RandomNumber.cpp */; }; … … 477 474 A8A472DA151A825B004123FF /* OSRandomSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSRandomSource.cpp; sourceTree = "<group>"; }; 478 475 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>"; };481 476 A8A472DF151A825B004123FF /* PackedIntVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PackedIntVector.h; sourceTree = "<group>"; }; 482 477 A8A472E0151A825B004123FF /* PageAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageAllocation.h; sourceTree = "<group>"; }; … … 486 481 A8A472E6151A825B004123FF /* ParallelJobs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelJobs.h; sourceTree = "<group>"; }; 487 482 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>"; };489 483 A8A472ED151A825B004123FF /* PassRefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PassRefPtr.h; sourceTree = "<group>"; }; 490 484 A8A472FB151A825B004123FF /* RandomNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RandomNumber.cpp; sourceTree = "<group>"; }; … … 796 790 A8A472DB151A825B004123FF /* OSRandomSource.h */, 797 791 1AFDE6521953B23D00C48FFA /* Optional.h */, 798 A8A472DD151A825B004123FF /* OwnPtr.h */,799 A8A472DE151A825B004123FF /* OwnPtrCommon.h */,800 792 A8A472DF151A825B004123FF /* PackedIntVector.h */, 801 793 A8A472E0151A825B004123FF /* PageAllocation.h */, … … 805 797 A8A472E6151A825B004123FF /* ParallelJobs.h */, 806 798 A8A472E9151A825B004123FF /* ParallelJobsLibdispatch.h */, 807 A8A472EC151A825B004123FF /* PassOwnPtr.h */,808 799 A8A472ED151A825B004123FF /* PassRefPtr.h */, 809 800 A876DBD7151816E500DADB95 /* Platform.h */, … … 1132 1123 A8A473F6151A825B004123FF /* OSAllocator.h in Headers */, 1133 1124 A8A473FA151A825B004123FF /* OSRandomSource.h in Headers */, 1134 A8A473FC151A825B004123FF /* OwnPtr.h in Headers */,1135 A8A473FD151A825B004123FF /* OwnPtrCommon.h in Headers */,1136 1125 0FB14E1B1810E1DC009B6B4D /* BagToHashMap.h in Headers */, 1137 1126 A8A473FE151A825B004123FF /* PackedIntVector.h in Headers */, … … 1141 1130 A8A47405151A825B004123FF /* ParallelJobs.h in Headers */, 1142 1131 A8A47408151A825B004123FF /* ParallelJobsLibdispatch.h in Headers */, 1143 A8A4740B151A825B004123FF /* PassOwnPtr.h in Headers */,1144 1132 A8A4740C151A825B004123FF /* PassRefPtr.h in Headers */, 1145 1133 A876DBD8151816E500DADB95 /* Platform.h in Headers */, -
trunk/Source/WTF/wtf/CMakeLists.txt
r183001 r183265 56 56 OSAllocator.h 57 57 OSRandomSource.h 58 OwnPtr.h59 OwnPtrCommon.h60 58 PageAllocation.h 61 59 PageBlock.h … … 65 63 ParallelJobsLibdispatch.h 66 64 ParallelJobsOpenMP.h 67 PassOwnPtr.h68 65 PassRefPtr.h 69 66 Platform.h -
trunk/Source/WTF/wtf/Forward.h
r178265 r183265 29 29 template<typename T> class LazyNeverDestroyed; 30 30 template<typename T> class NeverDestroyed; 31 template<typename T> class OwnPtr;32 template<typename T> class PassOwnPtr;33 31 template<typename T> class PassRefPtr; 34 32 template<typename T> class RefPtr; … … 66 64 using WTF::NeverDestroyed; 67 65 using WTF::OrdinalNumber; 68 using WTF::OwnPtr;69 using WTF::PassOwnPtr;70 66 using WTF::PassRefPtr; 71 67 using WTF::PrintStream; -
trunk/Source/WTF/wtf/HashTraits.h
r183063 r183265 30 30 31 31 class String; 32 33 template<typename T> class OwnPtr;34 32 35 33 template<typename T> struct HashTraits; … … 121 119 }; 122 120 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 132 121 template<typename P> struct HashTraits<RefPtr<P>> : SimpleClassHashTraits<RefPtr<P>> { 133 static P* emptyValue() { return 0; }122 static P* emptyValue() { return nullptr; } 134 123 135 124 typedef P* PeekType; -
trunk/Source/WTF/wtf/SizeLimits.cpp
r178722 r183265 34 34 #include <utility> 35 35 #include <wtf/Assertions.h> 36 #include <wtf/OwnPtr.h>37 36 #include <wtf/PassRefPtr.h> 38 37 #include <wtf/RefCounted.h> … … 56 55 #endif 57 56 58 static_assert(sizeof(OwnPtr<int>) == sizeof(int*), "OwnPtr should stay small!");59 57 static_assert(sizeof(PassRefPtr<RefCounted<int>>) == sizeof(int*), "PassRefPtr should stay small!"); 60 58 static_assert(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), "RefCounted should stay small!"); -
trunk/Source/WTF/wtf/VectorTraits.h
r169252 r183265 22 22 #define WTF_VectorTraits_h 23 23 24 #include <wtf/OwnPtr.h>25 24 #include <wtf/Ref.h> 26 25 #include <wtf/RefPtr.h> … … 67 66 }; 68 67 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. 73 70 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 { }; 85 75 86 76 template<typename First, typename Second> -
trunk/Source/WebCore/ChangeLog
r183262 r183265 1 2015-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 1 92 2015-04-24 Per Arne Vollan <peavo@outlook.com> 2 93 -
trunk/Source/WebCore/PlatformEfl.cmake
r182101 r183265 120 120 platform/graphics/cairo/ImageCairo.cpp 121 121 platform/graphics/cairo/IntRectCairo.cpp 122 platform/graphics/cairo/OwnPtrCairo.cpp123 122 platform/graphics/cairo/PathCairo.cpp 124 123 platform/graphics/cairo/PatternCairo.cpp -
trunk/Source/WebCore/PlatformGTK.cmake
r183012 r183265 79 79 platform/graphics/cairo/ImageCairo.cpp 80 80 platform/graphics/cairo/IntRectCairo.cpp 81 platform/graphics/cairo/OwnPtrCairo.cpp82 81 platform/graphics/cairo/PathCairo.cpp 83 82 platform/graphics/cairo/PatternCairo.cpp -
trunk/Source/WebCore/PlatformWinCairo.cmake
r182545 r183265 51 51 platform/graphics/cairo/ImageCairo.cpp 52 52 platform/graphics/cairo/IntRectCairo.cpp 53 platform/graphics/cairo/OwnPtrCairo.cpp54 53 platform/graphics/cairo/PathCairo.cpp 55 54 platform/graphics/cairo/PatternCairo.cpp -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r183160 r183265 8574 8574 </ClCompile> 8575 8575 <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">8586 8576 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 8587 8577 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> … … 20110 20100 </ClCompile> 20111 20101 <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">20122 20102 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 20123 20103 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r183160 r183265 1585 1585 <Filter>platform\graphics\cairo</Filter> 1586 1586 </ClCompile> 1587 <ClCompile Include="..\platform\graphics\cairo\OwnPtrCairo.cpp">1588 <Filter>platform\graphics\cairo</Filter>1589 </ClCompile>1590 1587 <ClCompile Include="..\platform\graphics\cairo\PathCairo.cpp"> 1591 1588 <Filter>platform\graphics\cairo</Filter> … … 15370 15367 </CustomBuildStep> 15371 15368 <CustomBuildStep Include="..\platform\graphics\cairo\GraphicsContextPlatformPrivateCairo.h"> 15372 <Filter>platform\graphics\cairo</Filter>15373 </CustomBuildStep>15374 <CustomBuildStep Include="..\platform\graphics\cairo\OwnPtrCairo.h">15375 15369 <Filter>platform\graphics\cairo</Filter> 15376 15370 </CustomBuildStep> -
trunk/Source/WebCore/platform/CrossThreadCopier.cpp
r165117 r183265 180 180 RawPointerRefCountedTest); 181 181 182 // Verify that PassOwnPtr gets passed through.183 COMPILE_ASSERT((std::is_same<184 PassOwnPtr<float>,185 CrossThreadCopier<PassOwnPtr<float>>::Type186 >::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>>::Type193 >::value),194 OwnPtrTest);195 196 182 } // namespace WebCore -
trunk/Source/WebCore/platform/CrossThreadCopier.h
r182866 r183265 34 34 #include <wtf/Assertions.h> 35 35 #include <wtf/Forward.h> 36 #include <wtf/PassOwnPtr.h>37 36 #include <wtf/PassRefPtr.h> 38 37 #include <wtf/RefPtr.h> … … 111 110 }; 112 111 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 121 112 template<> struct CrossThreadCopierBase<false, false, URL> { 122 113 typedef URL Type; -
trunk/Source/WebCore/platform/ScrollAnimatorNone.cpp
r180873 r183265 42 42 #include <algorithm> 43 43 #include <wtf/CurrentTime.h> 44 #include <wtf/PassOwnPtr.h>45 44 46 45 using namespace std; -
trunk/Source/WebCore/platform/ThreadGlobalData.cpp
r183234 r183265 33 33 #include "ThreadTimers.h" 34 34 #include <wtf/MainThread.h> 35 #include <wtf/PassOwnPtr.h>36 35 #include <wtf/ThreadSpecific.h> 37 36 #include <wtf/Threading.h> -
trunk/Source/WebCore/platform/ThreadGlobalData.h
r183186 r183265 31 31 #include <wtf/HashSet.h> 32 32 #include <wtf/Noncopyable.h> 33 #include <wtf/OwnPtr.h>34 33 #include <wtf/text/StringHash.h> 35 34 -
trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h
r174710 r183265 28 28 29 29 #include "CDMSession.h" 30 #include <wtf/PassOwnPtr.h>31 30 #include <wtf/RetainPtr.h> 32 31 -
trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
r181036 r183265 190 190 RefPtr<PlatformCALayer> m_videoLayerWrapper; 191 191 192 OwnPtr<LayerClient> m_layerClient;192 std::unique_ptr<LayerClient> m_layerClient; 193 193 COMPtr<IDirect3DDevice9Ex> m_d3dDevice; 194 194 … … 1624 1624 return; 1625 1625 1626 OwnPtr<NotificationCallbackData> notificationData = adoptPtr(reinterpret_cast<NotificationCallbackData*>(context));1626 std::unique_ptr<NotificationCallbackData> notificationData { static_cast<NotificationCallbackData*>(context) }; 1627 1627 1628 1628 MutexLocker locker(mapLock()); … … 1674 1674 #endif 1675 1675 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); 1679 1679 } 1680 1680 … … 1918 1918 1919 1919 // 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); 1921 1921 if (!m_layerClient) 1922 1922 return 0; -
trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp
r179398 r183265 35 35 #include "FloatRect.h" 36 36 #include "IntRect.h" 37 #include "OwnPtrCairo.h"38 37 #include "Path.h" 39 38 #include "PlatformPathCairo.h" … … 74 73 void appendPathToCairoContext(cairo_t* to, cairo_t* from) 75 74 { 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); 78 78 } 79 79 -
trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
r183234 r183265 44 44 #include <runtime/JSCInlines.h> 45 45 #include <runtime/TypedArrayInlines.h> 46 #include <wtf/PassOwnPtr.h>47 46 #include <wtf/Vector.h> 48 47 #include <wtf/text/Base64.h> … … 120 119 RefPtr<cairo_t> cr = adoptRef(cairo_create(m_data.m_surface.get())); 121 120 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); 123 122 success = true; 124 123 } -
trunk/Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h
r180342 r183265 51 51 RefPtr<cairo_surface_t> m_surface; 52 52 PlatformContextCairo m_platformContext; 53 OwnPtr<GraphicsContext> m_context;53 std::unique_ptr<GraphicsContext> m_context; 54 54 IntSize m_size; 55 55 -
trunk/Source/WebCore/platform/graphics/cairo/PathCairo.cpp
r183088 r183265 32 32 #include "FloatRect.h" 33 33 #include "GraphicsContext.h" 34 #include "OwnPtrCairo.h"35 34 #include "PlatformPathCairo.h" 36 35 #include "StrokeStyleApplier.h" … … 60 59 61 60 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); 64 64 } 65 65 … … 84 84 clear(); 85 85 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); 88 89 } 89 90 … … 324 325 cairo_save(cr); 325 326 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); 329 328 cairo_restore(cr); 330 cairo_append_path(ensurePlatformPath()->context(), pathCopy.get()); 329 cairo_append_path(ensurePlatformPath()->context(), pathCopy); 330 cairo_path_destroy(pathCopy); 331 331 } 332 332 … … 397 397 398 398 cairo_t* cr = platformPath()->context(); 399 OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(cr));399 auto pathCopy = cairo_copy_path(cr); 400 400 cairo_path_data_t* data; 401 401 PathElement pelement; … … 429 429 } 430 430 } 431 cairo_path_destroy(pathCopy); 431 432 } 432 433 -
trunk/Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp
r179398 r183265 34 34 #include "Gradient.h" 35 35 #include "GraphicsContext.h" 36 #include "OwnPtrCairo.h"37 36 #include "Pattern.h" 38 37 #include <cairo.h> … … 307 306 308 307 // 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()); 310 309 cairo_new_path(m_cr.get()); 311 310 … … 338 337 339 338 // 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); 341 341 } 342 342 -
trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp
r181348 r183265 24 24 25 25 #include "Font.h" 26 #include "OwnPtrCairo.h"27 26 #include "RefPtrCairo.h" 28 27 #include "UTF16UChar32Iterator.h" -
trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp
r177429 r183265 25 25 #include <GL/glx.h> 26 26 #include <cairo.h> 27 #include <wtf/OwnPtr.h>28 27 29 28 #if ENABLE(ACCELERATED_2D_CANVAS) -
trunk/Source/WebCore/platform/graphics/surfaces/egl/EGLSurface.cpp
r177429 r183265 131 131 return; 132 132 133 m_configSelector = adoptPtr(new EGLConfigSelector(surfaceAttributes));133 m_configSelector = std::make_unique<EGLConfigSelector>(surfaceAttributes); 134 134 } 135 135 -
trunk/Source/WebCore/platform/graphics/surfaces/glx/GLXConfigSelector.h
r163079 r183265 141 141 { 142 142 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)); 144 144 145 145 if (!numAvailableConfigs || !temp.get()) 146 146 return 0; 147 147 148 OwnPtrX11<XVisualInfo> scopedVisualInfo;149 148 for (int i = 0; i < numAvailableConfigs; ++i) { 150 s copedVisualInfo = glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]);149 std::unique_ptr<XVisualInfo, X11Deleter> scopedVisualInfo { glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]) }; 151 150 if (!scopedVisualInfo.get()) 152 151 continue; … … 170 169 171 170 // Did not find any visual supporting alpha, select the first available config. 172 s copedVisualInfo = glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[0]);171 std::unique_ptr<XVisualInfo, X11Deleter> scopedVisualInfo { glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[0]) }; 173 172 174 173 if ((m_attributes & GLPlatformSurface::SupportAlpha) && (scopedVisualInfo->depth != 32)) … … 181 180 { 182 181 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)); 184 183 185 184 if (!numAvailableConfigs || !temp.get()) 186 185 return 0; 187 186 188 OwnPtrX11<XVisualInfo> scopedVisualInfo;189 187 for (int i = 0; i < numAvailableConfigs; ++i) { 190 s copedVisualInfo = glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]);188 std::unique_ptr<XVisualInfo, X11Deleter> scopedVisualInfo { glXGetVisualFromFBConfig(X11Helper::nativeDisplay(), temp[i]) }; 191 189 if (!scopedVisualInfo.get()) 192 190 continue; -
trunk/Source/WebCore/platform/graphics/surfaces/glx/GLXSurface.cpp
r177429 r183265 68 68 attributes |= GLPlatformSurface::DoubleBuffered; 69 69 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())); 71 71 72 72 if (!visInfo.get()) { … … 146 146 m_configSelector = std::make_unique<GLXConfigSelector>(attributes); 147 147 148 OwnPtrX11<XVisualInfo> visualInfo(m_configSelector->visualInfo(m_configSelector->pixmapContextConfig()));148 std::unique_ptr<XVisualInfo, X11Deleter> visualInfo(m_configSelector->visualInfo(m_configSelector->pixmapContextConfig())); 149 149 X11Helper::createPixmap(&m_pixmap, *visualInfo.get()); 150 150 -
trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.cpp
r159772 r183265 241 241 visualInfoTemplate.visualid = visualId; 242 242 int matchingCount = 0; 243 OwnPtrX11<XVisualInfo> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount));243 std::unique_ptr<XVisualInfo, X11Deleter> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount)); 244 244 XVisualInfo* foundVisual = 0; 245 245 … … 278 278 visualInfoTemplate.visualid = visualId; 279 279 int matchingCount = 0; 280 OwnPtrX11<XVisualInfo> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount));280 std::unique_ptr<XVisualInfo, X11Deleter> matchingVisuals(XGetVisualInfo(nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount)); 281 281 XVisualInfo* foundVisual = 0; 282 282 int requiredDepth = hasAlpha ? 32 : 24; -
trunk/Source/WebCore/platform/graphics/surfaces/glx/X11Helper.h
r151227 r183265 28 28 29 29 #include "IntRect.h" 30 #include "OwnPtrX11.h"31 30 32 31 #if USE(EGL) … … 44 43 namespace WebCore { 45 44 45 class X11Deleter { 46 public: 47 template<typename T> void operator()(T* resource) 48 { 49 if (resource) 50 XFree(resource); 51 } 52 }; 53 46 54 class X11Helper { 47 48 55 public: 49 56 static void createPixmap(Pixmap*, const XVisualInfo&, const IntSize& = IntSize(1, 1)); … … 62 69 63 70 class ScopedXPixmapCreationErrorHandler { 64 65 71 public: 66 72 ScopedXPixmapCreationErrorHandler(); -
trunk/Source/WebCore/platform/graphics/win/FullScreenController.cpp
r183234 r183265 37 37 #include "Timer.h" 38 38 #include "WebCoreInstanceHandle.h" 39 #include <wtf/PassOwnPtr.h>40 39 #include <wtf/RefPtr.h> 41 40 … … 61 60 FullScreenController* m_controller; 62 61 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; 65 64 IntRect m_fullScreenFrame; 66 65 IntRect m_originalFrame; … … 105 104 106 105 FullScreenController::FullScreenController(FullScreenControllerClient* client) 107 : m_private( adoptPtr(new FullScreenController::Private(this, client)))106 : m_private(std::make_unique<Private>(this, client)) 108 107 { 109 108 ASSERT_ARG(client, client); … … 135 134 136 135 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()); 138 137 m_private->m_backgroundWindow->createWindow(0); 139 138 ::AnimateWindow(m_private->m_backgroundWindow->hwnd(), kFullScreenAnimationDuration, AW_BLEND | AW_ACTIVATE); … … 141 140 m_private->m_client->fullScreenClientWillEnterFullScreen(); 142 141 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()); 144 143 ASSERT(m_private->m_fullScreenWindow); 145 144 m_private->m_fullScreenWindow->createWindow(0); -
trunk/Source/WebCore/platform/graphics/win/FullScreenController.h
r165676 r183265 29 29 #if ENABLE(FULLSCREEN_API) 30 30 31 #include < wtf/OwnPtr.h>31 #include <memory> 32 32 33 33 namespace WebCore { … … 55 55 class Private; 56 56 friend class Private; 57 OwnPtr<FullScreenController::Private> m_private;57 std::unique_ptr<FullScreenController::Private> m_private; 58 58 }; 59 59 -
trunk/Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp
r180609 r183265 30 30 #include "GraphicsContext3DPrivate.h" 31 31 #include <WebCore/PlatformCALayerWin.h> 32 #include <wtf/OwnPtr.h>33 #include <wtf/PassOwnPtr.h>34 32 35 33 #if PLATFORM(WIN) -
trunk/Source/WebCore/platform/graphics/win/WKCAImageQueue.cpp
r163079 r183265 29 29 #include <CoreFoundation/CoreFoundation.h> 30 30 #include <WebKitSystemInterface/WebKitSystemInterface.h> 31 #include <wtf/PassOwnPtr.h>32 31 #include <wtf/RetainPtr.h> 33 32 … … 53 52 54 53 WKCAImageQueue::WKCAImageQueue(uint32_t width, uint32_t height, uint32_t capacity) 55 : m_private( adoptPtr(new WKCAImageQueuePrivate()))54 : m_private(std::make_unique<WKCAImageQueuePrivate>()) 56 55 { 57 56 m_private->m_imageQueue = adoptCF(wkCAImageQueueCreate(width, height, capacity)); … … 59 58 60 59 WKCAImageQueue::WKCAImageQueue(const WKCAImageQueue& o) 61 : m_private( adoptPtr(new WKCAImageQueuePrivate()))60 : m_private(std::make_unique<WKCAImageQueuePrivate>()) 62 61 { 63 62 m_private->m_imageQueue = o.m_private->m_imageQueue; -
trunk/Source/WebCore/platform/graphics/win/WKCAImageQueue.h
r163079 r183265 30 30 typedef const struct __CFDictionary * CFDictionaryRef; 31 31 32 #include <memory> 32 33 #include <stdint.h> 33 #include <wtf/OwnPtr.h>34 34 35 35 namespace WebCore { … … 81 81 WKCAImageQueue(const WKCAImageQueue&); 82 82 WKCAImageQueue& operator=(const WKCAImageQueue&); 83 OwnPtr<WKCAImageQueuePrivate> m_private;83 std::unique_ptr<WKCAImageQueuePrivate> m_private; 84 84 }; 85 85 -
trunk/Source/WebCore/platform/network/NetworkStorageSessionStub.cpp
r166506 r183265 31 31 32 32 #include "NetworkingContext.h" 33 #include <wtf/PassOwnPtr.h>34 33 35 34 namespace WebCore { -
trunk/Source/WebCore/platform/network/ResourceHandleInternal.h
r183234 r183265 32 32 #include "AuthenticationChallenge.h" 33 33 #include "Timer.h" 34 #include <wtf/OwnPtr.h>35 34 36 35 #if USE(CFNETWORK) … … 164 163 Vector<char> m_postBytes; 165 164 166 OwnPtr<MultipartHandle> m_multipartHandle;165 std::unique_ptr<MultipartHandle> m_multipartHandle; 167 166 #endif 168 167 #if USE(SOUP) -
trunk/Source/WebCore/platform/network/curl/MultipartHandle.cpp
r182795 r183265 38 38 namespace WebCore { 39 39 40 PassOwnPtr<MultipartHandle> MultipartHandle::create(ResourceHandle* handle, const String& boundary)41 {42 return adoptPtr(new MultipartHandle(handle, boundary));43 }44 45 40 bool MultipartHandle::extractBoundary(const String& contentType, String& boundary) 46 41 { -
trunk/Source/WebCore/platform/network/curl/MultipartHandle.h
r155633 r183265 29 29 #include "HTTPHeaderMap.h" 30 30 #include "ResourceHandle.h" 31 32 #include <wtf/OwnPtr.h>33 31 #include <wtf/Vector.h> 34 32 #include <wtf/text/WTFString.h> … … 37 35 38 36 class MultipartHandle { 39 40 37 public: 41 static PassOwnPtr<MultipartHandle> create(ResourceHandle* handle, const String& boundary);42 38 static bool extractBoundary(const String& contentType, String& boundary); 43 39 -
trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp
r177080 r183265 516 516 bool parsed = MultipartHandle::extractBoundary(d->m_response.httpHeaderField(HTTPHeaderName::ContentType), boundary); 517 517 if (parsed) 518 d->m_multipartHandle = MultipartHandle::create(job, boundary);518 d->m_multipartHandle = std::make_unique<MultipartHandle>(job, boundary); 519 519 } 520 520 -
trunk/Source/WebKit2/ChangeLog
r183263 r183265 1 2015-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 1 11 2015-04-24 Antti Koivisto <antti@apple.com> 2 12 -
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheEncoder.h
r181140 r183265 30 30 31 31 #include "NetworkCacheCoder.h" 32 32 #include <wtf/HashFunctions.h> 33 33 #include <wtf/StringHasher.h> 34 34 #include <wtf/Vector.h> -
trunk/Tools/ChangeLog
r183264 r183265 1 2015-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 1 27 2015-04-24 Brent Fulgham <bfulgham@apple.com> 2 28 -
trunk/Tools/DumpRenderTree/win/HistoryDelegate.h
r165676 r183265 28 28 29 29 #include <WebKit/WebKit.h> 30 #include <wtf/OwnPtr.h>31 30 32 31 class HistoryDelegate : public IWebHistoryDelegate { -
trunk/Tools/DumpRenderTree/win/UIDelegate.h
r172977 r183265 32 32 #include <WebCore/COMPtr.h> 33 33 #include <WebKit/WebKit.h> 34 #include <wtf/OwnPtr.h>35 34 #include <windef.h> 36 35 -
trunk/Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp
r181348 r183265 31 31 #include <string> 32 32 #include <wtf/HashMap.h> 33 #include <wtf/OwnPtr.h>34 #include <wtf/PassOwnPtr.h>35 33 #include <wtf/text/StringHash.h> 36 34 … … 175 173 } 176 174 177 TEST(WTF_HashMap, OwnPtrKey)175 TEST(WTF_HashMap, UniquePtrKey) 178 176 { 179 177 ConstructorDestructorCounter::TestingScope scope; 180 178 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); 185 183 186 184 EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount); … … 193 191 } 194 192 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); 193 TEST(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 216 TEST(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); 202 223 203 224 auto it = map.find(ptr); … … 207 228 } 208 229 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 327 230 TEST(WTF_HashMap, UniquePtrKey_ContainsUsingRawPointer) 328 231 { -
trunk/Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp
r181348 r183265 29 29 #include "MoveOnly.h" 30 30 #include <wtf/HashSet.h> 31 #include <wtf/OwnPtr.h>32 #include <wtf/PassOwnPtr.h>33 31 34 32 namespace TestWebKitAPI { … … 120 118 } 121 119 122 TEST(WTF_HashSet, OwnPtrKey) 120 121 TEST(WTF_HashSet, UniquePtrKey) 123 122 { 124 123 ConstructorDestructorCounter::TestingScope scope; 125 124 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)); 130 129 131 130 EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount); … … 133 132 134 133 set.clear(); 135 134 136 135 EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount); 137 136 EXPECT_EQ(1u, ConstructorDestructorCounter::destructionCount); 138 137 } 139 138 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));139 TEST(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)); 147 146 148 147 auto it = set.find(ptr); … … 152 151 } 153 152 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));153 TEST(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)); 161 160 162 161 EXPECT_EQ(true, set.contains(ptr)); 163 162 } 164 163 165 TEST(WTF_HashSet, OwnPtrKey_RemoveUsingRawPointer)164 TEST(WTF_HashSet, UniquePtrKey_RemoveUsingRawPointer) 166 165 { 167 166 ConstructorDestructorCounter::TestingScope scope; 168 167 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)); 174 173 175 174 EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount); … … 183 182 } 184 183 185 TEST(WTF_HashSet, OwnPtrKey_TakeUsingRawPointer)184 TEST(WTF_HashSet, UniquePtrKey_TakeUsingRawPointer) 186 185 { 187 186 ConstructorDestructorCounter::TestingScope scope; 188 187 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)); 194 193 195 194 EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount); … … 201 200 EXPECT_EQ(1u, ConstructorDestructorCounter::constructionCount); 202 201 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);291 202 292 203 result = nullptr; -
trunk/Tools/TestWebKitAPI/Tests/WebKit/win/WebViewDestruction.cpp
r174471 r183265 30 30 #include <WebKit/WebKit.h> 31 31 #include <WebKit/WebKitCOMAPI.h> 32 #include <wtf/PassOwnPtr.h>33 32 34 33 namespace TestWebKitAPI { -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/UserMessage.cpp
r177506 r183265 32 32 #include "PlatformUtilities.h" 33 33 #include "PlatformWebView.h" 34 #include <wtf/OwnPtr.h>35 #include <wtf/PassOwnPtr.h>36 34 37 35 namespace TestWebKitAPI { … … 46 44 47 45 WKRetainPtr<WKContextRef> context; 48 OwnPtr<PlatformWebView> webView;46 std::unique_ptr<PlatformWebView> webView; 49 47 50 48 WKRetainPtr<WKTypeRef> recievedBody; … … 96 94 setInjectedBundleClient(context.get(), this); 97 95 98 webView = adoptPtr(new PlatformWebView(context.get()));96 webView = std::make_unique<PlatformWebView>(context.get()); 99 97 setPageLoaderClient(webView->page(), this); 100 98 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/WillLoad.cpp
r177506 r183265 32 32 #include "PlatformUtilities.h" 33 33 #include "PlatformWebView.h" 34 #include <wtf/OwnPtr.h>35 #include <wtf/PassOwnPtr.h>36 34 37 35 namespace TestWebKitAPI { … … 45 43 46 44 WKRetainPtr<WKContextRef> context; 47 OwnPtr<PlatformWebView> webView;45 std::unique_ptr<PlatformWebView> webView; 48 46 49 47 WKRetainPtr<WKStringRef> messageName; … … 75 73 setInjectedBundleClient(context.get(), this); 76 74 77 webView = adoptPtr(new PlatformWebView(context.get()));75 webView = std::make_unique<PlatformWebView>(context.get()); 78 76 79 77 didReceiveMessage = false; -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMDOMWindowTest.cpp
r165746 r183265 31 31 class WebKitDOMDOMWindowTest : public WebProcessTest { 32 32 public: 33 static PassOwnPtr<WebProcessTest> create() { return adoptPtr(new WebKitDOMDOMWindowTest()); }33 static std::unique_ptr<WebProcessTest> create() { return std::make_unique<WebKitDOMDOMWindowTest>(); } 34 34 35 35 private: -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp
r180214 r183265 27 27 #include <webkit2/webkit-web-extension.h> 28 28 #include <wtf/Deque.h> 29 #include <wtf/OwnPtr.h>30 #include <wtf/PassOwnPtr.h>31 29 #include <wtf/ProcessID.h> 32 30 #include <wtf/gobject/GRefPtr.h> … … 84 82 }; 85 83 86 Deque< OwnPtr<DelayedSignal>> delayedSignalsQueue;84 Deque<DelayedSignal> delayedSignalsQueue; 87 85 88 86 static void emitDocumentLoaded(GDBusConnection* connection) … … 116 114 emitDocumentLoaded(G_DBUS_CONNECTION(data)); 117 115 else 118 delayedSignalsQueue.append( adoptPtr(new DelayedSignal(DocumentLoadedSignal)));116 delayedSignalsQueue.append(DelayedSignal(DocumentLoadedSignal)); 119 117 } 120 118 … … 138 136 emitURIChanged(G_DBUS_CONNECTION(data), webkit_web_page_get_uri(webPage)); 139 137 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))); 141 139 } 142 140 … … 331 329 g_object_set_data(G_OBJECT(userData), "dbus-connection", connection); 332 330 while (delayedSignalsQueue.size()) { 333 OwnPtr<DelayedSignal>delayedSignal = delayedSignalsQueue.takeFirst();334 switch (delayedSignal ->type) {331 DelayedSignal delayedSignal = delayedSignalsQueue.takeFirst(); 332 switch (delayedSignal.type) { 335 333 case DocumentLoadedSignal: 336 334 emitDocumentLoaded(connection); 337 335 break; 338 336 case URIChangedSignal: 339 emitURIChanged(connection, delayedSignal ->uri.data());337 emitURIChanged(connection, delayedSignal.uri.data()); 340 338 break; 341 339 }
Note: See TracChangeset
for help on using the changeset viewer.