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

Unified Diff: third_party/WebKit/Source/wtf/VectorTraits.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/VectorTest.cpp ('k') | third_party/WebKit/Source/wtf/WTFThreadData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/VectorTraits.h
diff --git a/third_party/WebKit/Source/wtf/VectorTraits.h b/third_party/WebKit/Source/wtf/VectorTraits.h
index 04e0e68ee8abf9554357347cb094902d6cb3e1e3..e085ec4ac73414825745afa887497351ddf0f1fc 100644
--- a/third_party/WebKit/Source/wtf/VectorTraits.h
+++ b/third_party/WebKit/Source/wtf/VectorTraits.h
@@ -21,9 +21,9 @@
#ifndef WTF_VectorTraits_h
#define WTF_VectorTraits_h
-#include "wtf/OwnPtr.h"
#include "wtf/RefPtr.h"
#include "wtf/TypeTraits.h"
+#include <memory>
#include <type_traits>
#include <utility>
@@ -68,23 +68,23 @@ struct SimpleClassVectorTraits : VectorTraitsBase<T> {
static const bool canCompareWithMemcmp = true;
};
-// We know OwnPtr and RefPtr are simple enough that initializing to 0 and moving
+// We know std::unique_ptr 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<RefPtr<P>> {};
template <typename P>
-struct VectorTraits<OwnPtr<P>> : SimpleClassVectorTraits<OwnPtr<P>> {
- // OwnPtr -> PassOwnPtr has a very particular structure that tricks the
+struct VectorTraits<std::unique_ptr<P>> : SimpleClassVectorTraits<std::unique_ptr<P>> {
+ // std::unique_ptr -> std::unique_ptr has a very particular structure that tricks the
// normal type traits into thinking that the class is "trivially copyable".
static const bool canCopyWithMemcpy = false;
};
static_assert(VectorTraits<RefPtr<int>>::canInitializeWithMemset, "inefficient RefPtr Vector");
static_assert(VectorTraits<RefPtr<int>>::canMoveWithMemcpy, "inefficient RefPtr Vector");
static_assert(VectorTraits<RefPtr<int>>::canCompareWithMemcmp, "inefficient RefPtr Vector");
-static_assert(VectorTraits<OwnPtr<int>>::canInitializeWithMemset, "inefficient OwnPtr Vector");
-static_assert(VectorTraits<OwnPtr<int>>::canMoveWithMemcpy, "inefficient OwnPtr Vector");
-static_assert(VectorTraits<OwnPtr<int>>::canCompareWithMemcmp, "inefficient OwnPtr Vector");
+static_assert(VectorTraits<std::unique_ptr<int>>::canInitializeWithMemset, "inefficient std::unique_ptr Vector");
+static_assert(VectorTraits<std::unique_ptr<int>>::canMoveWithMemcpy, "inefficient std::unique_ptr Vector");
+static_assert(VectorTraits<std::unique_ptr<int>>::canCompareWithMemcmp, "inefficient std::unique_ptr Vector");
template <typename First, typename Second>
struct VectorTraits<std::pair<First, Second>> {
« no previous file with comments | « third_party/WebKit/Source/wtf/VectorTest.cpp ('k') | third_party/WebKit/Source/wtf/WTFThreadData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698