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

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

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/LinkedHashSet.h ('k') | third_party/WebKit/Source/wtf/ListHashSet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/LinkedStack.h
diff --git a/third_party/WebKit/Source/wtf/LinkedStack.h b/third_party/WebKit/Source/wtf/LinkedStack.h
index 3350c2176924671efe775c2fdc38e588c16b853e..63bbbde72a9a6d98b8ca187db3935048c00e07cb 100644
--- a/third_party/WebKit/Source/wtf/LinkedStack.h
+++ b/third_party/WebKit/Source/wtf/LinkedStack.h
@@ -32,8 +32,7 @@
#define LinkedStack_h
#include "wtf/Allocator.h"
-#include "wtf/PtrUtil.h"
-#include <memory>
+#include "wtf/OwnPtr.h"
namespace WTF {
@@ -46,7 +45,7 @@ public:
// Iterative cleanup to prevent stack overflow problems.
~LinkedStack()
{
- std::unique_ptr<Node> ptr = m_head.release();
+ OwnPtr<Node> ptr = m_head.release();
while (ptr)
ptr = ptr->m_next.release();
}
@@ -63,18 +62,18 @@ private:
class Node {
USING_FAST_MALLOC(LinkedStack::Node);
public:
- Node(const T&, std::unique_ptr<Node> next);
+ Node(const T&, PassOwnPtr<Node> next);
T m_data;
- std::unique_ptr<Node> m_next;
+ OwnPtr<Node> m_next;
};
- std::unique_ptr<Node> m_head;
+ OwnPtr<Node> m_head;
size_t m_size;
};
template <typename T>
-LinkedStack<T>::Node::Node(const T& data, std::unique_ptr<Node> next)
+LinkedStack<T>::Node::Node(const T& data, PassOwnPtr<Node> next)
: m_data(data)
, m_next(next)
{
@@ -89,7 +88,7 @@ inline bool LinkedStack<T>::isEmpty()
template <typename T>
inline void LinkedStack<T>::push(const T& data)
{
- m_head = wrapUnique(new Node(data, m_head.release()));
+ m_head = adoptPtr(new Node(data, m_head.release()));
++m_size;
}
« no previous file with comments | « third_party/WebKit/Source/wtf/LinkedHashSet.h ('k') | third_party/WebKit/Source/wtf/ListHashSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698