Title: [156128] trunk/Source/WTF
Revision
156128
Author
[email protected]
Date
2013-09-19 16:03:44 -0700 (Thu, 19 Sep 2013)

Log Message

Remove OwnArrayPtr
https://bugs.webkit.org/show_bug.cgi?id=121612

Reviewed by Anders Carlsson.

* GNUmakefile.list.am:
* WTF.pro:
* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/Assertions.cpp:
* wtf/CMakeLists.txt:
* wtf/DateMath.h:
* wtf/FastBitVector.h:
* wtf/Forward.h:
* wtf/OwnArrayPtr.h: Removed.
* wtf/VectorTraits.h:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (156127 => 156128)


--- trunk/Source/WTF/ChangeLog	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/ChangeLog	2013-09-19 23:03:44 UTC (rev 156128)
@@ -1,3 +1,23 @@
+2013-09-19  Sam Weinig  <[email protected]>
+
+        Remove OwnArrayPtr
+        https://bugs.webkit.org/show_bug.cgi?id=121612
+
+        Reviewed by Anders Carlsson.
+
+        * GNUmakefile.list.am:
+        * WTF.pro:
+        * WTF.vcxproj/WTF.vcxproj:
+        * WTF.vcxproj/WTF.vcxproj.filters:
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/Assertions.cpp:
+        * wtf/CMakeLists.txt:
+        * wtf/DateMath.h:
+        * wtf/FastBitVector.h:
+        * wtf/Forward.h:
+        * wtf/OwnArrayPtr.h: Removed.
+        * wtf/VectorTraits.h:
+
 2013-09-19  Daniel Bates  <[email protected]>
 
         Substitute return type void for bool in function declaration for WTF::initializeWebThread()

Modified: trunk/Source/WTF/GNUmakefile.list.am (156127 => 156128)


--- trunk/Source/WTF/GNUmakefile.list.am	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/GNUmakefile.list.am	2013-09-19 23:03:44 UTC (rev 156128)
@@ -102,7 +102,6 @@
     Source/WTF/wtf/OSAllocatorWin.cpp \
     Source/WTF/wtf/OSRandomSource.cpp \
     Source/WTF/wtf/OSRandomSource.h \
-    Source/WTF/wtf/OwnArrayPtr.h \
     Source/WTF/wtf/OwnPtr.h \
     Source/WTF/wtf/OwnPtrCommon.h \
     Source/WTF/wtf/PackedIntVector.h \

Modified: trunk/Source/WTF/WTF.pro (156127 => 156128)


--- trunk/Source/WTF/WTF.pro	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/WTF.pro	2013-09-19 23:03:44 UTC (rev 156128)
@@ -90,7 +90,6 @@
     RAMSize.h \
     OSAllocator.h \
     OSRandomSource.h \
-    OwnArrayPtr.h \
     OwnPtr.h \
     OwnPtrCommon.h \
     PackedIntVector.h \

Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj (156127 => 156128)


--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj	2013-09-19 23:03:44 UTC (rev 156128)
@@ -190,7 +190,6 @@
     <ClInclude Include="..\wtf\Noncopyable.h" />
     <ClInclude Include="..\wtf\NumberOfCores.h" />
     <ClInclude Include="..\wtf\OSRandomSource.h" />
-    <ClInclude Include="..\wtf\OwnArrayPtr.h" />
     <ClInclude Include="..\wtf\OwnPtr.h" />
     <ClInclude Include="..\wtf\OwnPtrCommon.h" />
     <ClInclude Include="..\wtf\PackedIntVector.h" />

Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters (156127 => 156128)


--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters	2013-09-19 23:03:44 UTC (rev 156128)
@@ -491,9 +491,6 @@
     <ClInclude Include="..\wtf\OSRandomSource.h">
       <Filter>wtf</Filter>
     </ClInclude>
-    <ClInclude Include="..\wtf\OwnArrayPtr.h">
-      <Filter>wtf</Filter>
-    </ClInclude>
     <ClInclude Include="..\wtf\OwnPtr.h">
       <Filter>wtf</Filter>
     </ClInclude>

Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (156127 => 156128)


--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2013-09-19 23:03:44 UTC (rev 156128)
@@ -162,7 +162,6 @@
 		A8A473F7151A825B004123FF /* OSAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472D8151A825B004123FF /* OSAllocatorPosix.cpp */; };
 		A8A473F9151A825B004123FF /* OSRandomSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472DA151A825B004123FF /* OSRandomSource.cpp */; };
 		A8A473FA151A825B004123FF /* OSRandomSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DB151A825B004123FF /* OSRandomSource.h */; };
-		A8A473FB151A825B004123FF /* OwnArrayPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DC151A825B004123FF /* OwnArrayPtr.h */; };
 		A8A473FC151A825B004123FF /* OwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DD151A825B004123FF /* OwnPtr.h */; };
 		A8A473FD151A825B004123FF /* OwnPtrCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DE151A825B004123FF /* OwnPtrCommon.h */; };
 		A8A473FE151A825B004123FF /* PackedIntVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DF151A825B004123FF /* PackedIntVector.h */; };
@@ -430,7 +429,6 @@
 		A8A472D8151A825B004123FF /* OSAllocatorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSAllocatorPosix.cpp; sourceTree = "<group>"; };
 		A8A472DA151A825B004123FF /* OSRandomSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSRandomSource.cpp; sourceTree = "<group>"; };
 		A8A472DB151A825B004123FF /* OSRandomSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSRandomSource.h; sourceTree = "<group>"; };
-		A8A472DC151A825B004123FF /* OwnArrayPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnArrayPtr.h; sourceTree = "<group>"; };
 		A8A472DD151A825B004123FF /* OwnPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnPtr.h; sourceTree = "<group>"; };
 		A8A472DE151A825B004123FF /* OwnPtrCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnPtrCommon.h; sourceTree = "<group>"; };
 		A8A472DF151A825B004123FF /* PackedIntVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PackedIntVector.h; sourceTree = "<group>"; };
@@ -701,7 +699,6 @@
 				A8A472D8151A825B004123FF /* OSAllocatorPosix.cpp */,
 				A8A472DA151A825B004123FF /* OSRandomSource.cpp */,
 				A8A472DB151A825B004123FF /* OSRandomSource.h */,
-				A8A472DC151A825B004123FF /* OwnArrayPtr.h */,
 				A8A472DD151A825B004123FF /* OwnPtr.h */,
 				A8A472DE151A825B004123FF /* OwnPtrCommon.h */,
 				A8A472DF151A825B004123FF /* PackedIntVector.h */,
@@ -995,7 +992,6 @@
 				7E29C33E15FFD79B00516D61 /* ObjcRuntimeExtras.h in Headers */,
 				A8A473F6151A825B004123FF /* OSAllocator.h in Headers */,
 				A8A473FA151A825B004123FF /* OSRandomSource.h in Headers */,
-				A8A473FB151A825B004123FF /* OwnArrayPtr.h in Headers */,
 				A8A473FC151A825B004123FF /* OwnPtr.h in Headers */,
 				A8A473FD151A825B004123FF /* OwnPtrCommon.h in Headers */,
 				A8A473FE151A825B004123FF /* PackedIntVector.h in Headers */,

Modified: trunk/Source/WTF/wtf/Assertions.cpp (156127 => 156128)


--- trunk/Source/WTF/wtf/Assertions.cpp	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/wtf/Assertions.cpp	2013-09-19 23:03:44 UTC (rev 156128)
@@ -35,7 +35,7 @@
 #include "Assertions.h"
 
 #include "Compiler.h"
-#include <wtf/OwnArrayPtr.h>
+#include <wtf/StdLibExtras.h>
 #include <wtf/StringExtras.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
@@ -166,7 +166,7 @@
 {
     size_t prefixLength = strlen(prefix);
     size_t formatLength = strlen(format);
-    OwnArrayPtr<char> formatWithPrefix = adoptArrayPtr(new char[prefixLength + formatLength + 1]);
+    auto formatWithPrefix = std::make_unique<char[]>(prefixLength + formatLength + 1);
     memcpy(formatWithPrefix.get(), prefix, prefixLength);
     memcpy(formatWithPrefix.get() + prefixLength, format, formatLength);
     formatWithPrefix[prefixLength + formatLength] = 0;
@@ -182,7 +182,7 @@
         return;
     }
 
-    OwnArrayPtr<char> formatWithNewline = adoptArrayPtr(new char[formatLength + 2]);
+    auto formatWithNewline = std::make_unique<char[]>(formatLength + 2);
     memcpy(formatWithNewline.get(), format, formatLength);
     formatWithNewline[formatLength] = '\n';
     formatWithNewline[formatLength + 1] = 0;

Modified: trunk/Source/WTF/wtf/CMakeLists.txt (156127 => 156128)


--- trunk/Source/WTF/wtf/CMakeLists.txt	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/wtf/CMakeLists.txt	2013-09-19 23:03:44 UTC (rev 156128)
@@ -59,7 +59,6 @@
     RAMSize.h
     OSAllocator.h
     OSRandomSource.h
-    OwnArrayPtr.h
     OwnPtr.h
     OwnPtrCommon.h
     PageAllocation.h

Modified: trunk/Source/WTF/wtf/DateMath.h (156127 => 156128)


--- trunk/Source/WTF/wtf/DateMath.h	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/wtf/DateMath.h	2013-09-19 23:03:44 UTC (rev 156128)
@@ -49,7 +49,6 @@
 #include <time.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/Noncopyable.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WTF {

Modified: trunk/Source/WTF/wtf/FastBitVector.h (156127 => 156128)


--- trunk/Source/WTF/wtf/FastBitVector.h	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/wtf/FastBitVector.h	2013-09-19 23:03:44 UTC (rev 156128)
@@ -27,7 +27,6 @@
 #define FastBitVector_h
 
 #include <wtf/FastMalloc.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/StdLibExtras.h>
 
 namespace WTF {
@@ -171,7 +170,7 @@
 private:
     size_t arrayLength() const { return (m_numBits + 31) >> 5; }
     
-    uint32_t* m_array; // No, this can't be an OwnArrayPtr.
+    uint32_t* m_array; // No, this can't be an std::unique_ptr<uint32_t[]>.
     size_t m_numBits;
 };
 

Modified: trunk/Source/WTF/wtf/Forward.h (156127 => 156128)


--- trunk/Source/WTF/wtf/Forward.h	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/wtf/Forward.h	2013-09-19 23:03:44 UTC (rev 156128)
@@ -26,7 +26,6 @@
 namespace WTF {
 
     template<typename T> class Function;
-    template<typename T> class OwnArrayPtr;
     template<typename T> class OwnPtr;
     template<typename T> class PassOwnPtr;
     template<typename T> class PassRefPtr;
@@ -49,7 +48,6 @@
 }
 
 using WTF::Function;
-using WTF::OwnArrayPtr;
 using WTF::OwnPtr;
 using WTF::PassOwnPtr;
 using WTF::PassRefPtr;

Deleted: trunk/Source/WTF/wtf/OwnArrayPtr.h (156127 => 156128)


--- trunk/Source/WTF/wtf/OwnArrayPtr.h	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/wtf/OwnArrayPtr.h	2013-09-19 23:03:44 UTC (rev 156128)
@@ -1,148 +0,0 @@
-/*
- *  Copyright (C) 2006, 2010, 2013 Apple Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this library; see the file COPYING.LIB.  If not, write to
- *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef WTF_OwnArrayPtr_h
-#define WTF_OwnArrayPtr_h
-
-#include <wtf/Assertions.h>
-#include <wtf/Noncopyable.h>
-#include <algorithm>
-#include <cstddef>
-
-namespace WTF {
-
-template<typename T> inline void deleteOwnedArrayPtr(T*);
-
-template <typename T> class OwnArrayPtr {
-public:
-    typedef T* PtrType;
-
-    OwnArrayPtr() : m_ptr(nullptr) { }
-    OwnArrayPtr(std::nullptr_t) : m_ptr(nullptr) { }
-    OwnArrayPtr(OwnArrayPtr&&);
-
-    ~OwnArrayPtr() { deleteOwnedArrayPtr(m_ptr); }
-
-    PtrType get() const { return m_ptr; }
-
-    void clear();
-    PtrType leakPtr() WARN_UNUSED_RETURN;
-
-    T& operator*() const { ASSERT(m_ptr); return *m_ptr; }
-    PtrType operator->() const { ASSERT(m_ptr); return m_ptr; }
-
-    T& operator[](std::ptrdiff_t i) const { ASSERT(m_ptr); ASSERT(i >= 0); return m_ptr[i]; }
-
-    bool operator!() const { return !m_ptr; }
-
-    // This conversion operator allows implicit conversion to bool but not to other integer types.
-    typedef T* OwnArrayPtr::*UnspecifiedBoolType;
-    operator UnspecifiedBoolType() const { return m_ptr ? &OwnArrayPtr::m_ptr : 0; }
-
-    OwnArrayPtr& operator=(std::nullptr_t) { clear(); return *this; }
-    OwnArrayPtr& operator=(OwnArrayPtr&&);
-
-    void swap(OwnArrayPtr& o) { std::swap(m_ptr, o.m_ptr); }
-
-private:
-    template<typename U> friend OwnArrayPtr<U> adoptArrayPtr(U*);
-    explicit OwnArrayPtr(PtrType ptr) : m_ptr(ptr) { }
-
-    PtrType m_ptr;
-};
-
-template<typename T>
-inline OwnArrayPtr<T>::OwnArrayPtr(OwnArrayPtr&& other)
-    : m_ptr(other.leakPtr())
-{
-}
-
-template<typename T>
-inline void OwnArrayPtr<T>::clear()
-{
-    PtrType ptr = m_ptr;
-    m_ptr = 0;
-    deleteOwnedArrayPtr(ptr);
-}
-
-template<typename T>
-inline typename OwnArrayPtr<T>::PtrType OwnArrayPtr<T>::leakPtr()
-{
-    PtrType ptr = m_ptr;
-    m_ptr = 0;
-    return ptr;
-}
-
-template<typename T>
-inline OwnArrayPtr<T>& OwnArrayPtr<T>::operator=(OwnArrayPtr&& other)
-{
-    auto ptr = std::move(other);
-    swap(ptr);
-    return *this;
-}
-
-template <typename T> inline void swap(OwnArrayPtr<T>& a, OwnArrayPtr<T>& b)
-{
-    a.swap(b);
-}
-
-template<typename T, typename U> inline bool operator==(const OwnArrayPtr<T>& a, U* b)
-{
-    return a.get() == b; 
-}
-
-template<typename T, typename U> inline bool operator==(T* a, const OwnArrayPtr<U>& b) 
-{
-    return a == b.get(); 
-}
-
-template<typename T, typename U> inline bool operator!=(const OwnArrayPtr<T>& a, U* b)
-{
-    return a.get() != b; 
-}
-
-template<typename T, typename U> inline bool operator!=(T* a, const OwnArrayPtr<U>& b)
-{
-    return a != b.get(); 
-}
-
-template <typename T> inline T* getPtr(const OwnArrayPtr<T>& p)
-{
-    return p.get();
-}
-
-template<typename T> inline OwnArrayPtr<T> adoptArrayPtr(T* ptr)
-{
-    return OwnArrayPtr<T>(ptr);
-}
-
-template<typename T> inline void deleteOwnedArrayPtr(T* ptr)
-{
-    static_assert(sizeof(T) > 0, "deleteOwnedArrayPtr can not delete incomplete types");
-
-    delete[] ptr;
-}
-
-} // namespace WTF
-
-using WTF::OwnArrayPtr;
-using WTF::adoptArrayPtr;
-
-#endif // WTF_OwnArrayPtr_h

Modified: trunk/Source/WTF/wtf/VectorTraits.h (156127 => 156128)


--- trunk/Source/WTF/wtf/VectorTraits.h	2013-09-19 23:02:38 UTC (rev 156127)
+++ trunk/Source/WTF/wtf/VectorTraits.h	2013-09-19 23:03:44 UTC (rev 156128)
@@ -21,7 +21,6 @@
 #ifndef WTF_VectorTraits_h
 #define WTF_VectorTraits_h
 
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/Ref.h>
 #include <wtf/RefPtr.h>
@@ -71,7 +70,7 @@
         static const bool canCompareWithMemcmp = true;
     };
 
-    // we know OwnPtr and RefPtr are simple enough that initializing to 0 and moving with memcpy
+    // We know OwnPtr and RefPtr are simple enough that initializing to 0 and moving with memcpy
     // (and then not destructing the original) will totally work
     template<typename P>
     struct VectorTraits<RefPtr<P> > : SimpleClassVectorTraits { };
@@ -80,9 +79,6 @@
     struct VectorTraits<OwnPtr<P> > : SimpleClassVectorTraits { };
 
     template<typename P>
-    struct VectorTraits<OwnArrayPtr<P> > : SimpleClassVectorTraits { };
-
-    template<typename P>
     struct VectorTraits<Ref<P> > : SimpleClassVectorTraits { };
 
     template<>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to