Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Unified Diff: third_party/WebKit/Source/wtf/TerminatedArray.h

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/SizeLimits.cpp ('k') | third_party/WebKit/Source/wtf/ThreadingPthreads.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))));
}
};
« no previous file with comments | « third_party/WebKit/Source/wtf/SizeLimits.cpp ('k') | third_party/WebKit/Source/wtf/ThreadingPthreads.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698