| Index: third_party/WebKit/Source/wtf/TerminatedArray.h
|
| diff --git a/third_party/WebKit/Source/wtf/TerminatedArray.h b/third_party/WebKit/Source/wtf/TerminatedArray.h
|
| index 24c0ac4a6ce9809f64f04b5f0a7a7bc3d40889d6..43f3f095b62dbd474a689e17572be28e7f30048c 100644
|
| --- a/third_party/WebKit/Source/wtf/TerminatedArray.h
|
| +++ b/third_party/WebKit/Source/wtf/TerminatedArray.h
|
| @@ -5,8 +5,9 @@
|
| #define TerminatedArray_h
|
|
|
| #include "wtf/Allocator.h"
|
| -#include "wtf/OwnPtr.h"
|
| +#include "wtf/PtrUtil.h"
|
| #include "wtf/allocator/Partitions.h"
|
| +#include <memory>
|
|
|
| namespace WTF {
|
|
|
| @@ -66,7 +67,7 @@ public:
|
| return count;
|
| }
|
|
|
| - // Match Allocator semantics to be able to use OwnPtr<TerminatedArray>.
|
| + // Match Allocator semantics to be able to use std::unique_ptr<TerminatedArray>.
|
| void operator delete(void* p) { ::WTF::Partitions::fastFree(p); }
|
|
|
| private:
|
| @@ -74,8 +75,8 @@ private:
|
| // of TerminateArray and manage their lifetimes.
|
| struct Allocator {
|
| STATIC_ONLY(Allocator);
|
| - using PassPtr = PassOwnPtr<TerminatedArray>;
|
| - using Ptr = OwnPtr<TerminatedArray>;
|
| + using PassPtr = std::unique_ptr<TerminatedArray>;
|
| + using Ptr = std::unique_ptr<TerminatedArray>;
|
|
|
| static PassPtr release(Ptr& ptr)
|
| {
|
| @@ -84,12 +85,12 @@ private:
|
|
|
| static PassPtr create(size_t capacity)
|
| {
|
| - return adoptPtr(static_cast<TerminatedArray*>(WTF::Partitions::fastMalloc(capacity * sizeof(T), WTF_HEAP_PROFILER_TYPE_NAME(T))));
|
| + return wrapUnique(static_cast<TerminatedArray*>(WTF::Partitions::fastMalloc(capacity * sizeof(T), WTF_HEAP_PROFILER_TYPE_NAME(T))));
|
| }
|
|
|
| static PassPtr resize(Ptr ptr, size_t capacity)
|
| {
|
| - return adoptPtr(static_cast<TerminatedArray*>(WTF::Partitions::fastRealloc(ptr.leakPtr(), capacity * sizeof(T), WTF_HEAP_PROFILER_TYPE_NAME(T))));
|
| + return wrapUnique(static_cast<TerminatedArray*>(WTF::Partitions::fastRealloc(ptr.release(), capacity * sizeof(T), WTF_HEAP_PROFILER_TYPE_NAME(T))));
|
| }
|
| };
|
|
|
|
|