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

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

Issue 1611343002: wtf reformat test Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pydent Created 4 years, 11 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 07ef63c45e1d147667ac3d3a33af97923bbc3cc8..74def5b18ceeab9e22daab672f4bec099476dcb2 100644
--- a/third_party/WebKit/Source/wtf/LinkedStack.h
+++ b/third_party/WebKit/Source/wtf/LinkedStack.h
@@ -38,83 +38,75 @@ namespace WTF {
template <typename T>
class LinkedStack {
- USING_FAST_MALLOC(LinkedStack);
-public:
- LinkedStack() : m_size(0) { }
-
- // Iterative cleanup to prevent stack overflow problems.
- ~LinkedStack()
- {
- OwnPtr<Node> ptr = m_head.release();
- while (ptr)
- ptr = ptr->m_next.release();
- }
-
- bool isEmpty();
-
- void push(const T&);
- const T& peek();
- void pop();
-
- size_t size();
-
-private:
- class Node {
- USING_FAST_MALLOC(LinkedStack::Node);
- public:
- Node(const T&, PassOwnPtr<Node> next);
-
- T m_data;
- OwnPtr<Node> m_next;
- };
+ USING_FAST_MALLOC(LinkedStack);
+
+ public:
+ LinkedStack() : m_size(0) {}
+
+ // Iterative cleanup to prevent stack overflow problems.
+ ~LinkedStack() {
+ OwnPtr<Node> ptr = m_head.release();
+ while (ptr)
+ ptr = ptr->m_next.release();
+ }
+
+ bool isEmpty();
+
+ void push(const T&);
+ const T& peek();
+ void pop();
+
+ size_t size();
+
+ private:
+ class Node {
+ USING_FAST_MALLOC(LinkedStack::Node);
+
+ public:
+ Node(const T&, PassOwnPtr<Node> next);
+
+ T m_data;
+ OwnPtr<Node> m_next;
+ };
#if COMPILER(MSVC)
- friend struct ::WTF::OwnedPtrDeleter<Node>;
+ friend struct ::WTF::OwnedPtrDeleter<Node>;
#endif
- OwnPtr<Node> m_head;
- size_t m_size;
+ OwnPtr<Node> m_head;
+ size_t m_size;
};
template <typename T>
LinkedStack<T>::Node::Node(const T& data, PassOwnPtr<Node> next)
- : m_data(data)
- , m_next(next)
-{
-}
+ : m_data(data), m_next(next) {}
template <typename T>
-inline bool LinkedStack<T>::isEmpty()
-{
- return !m_head;
+inline bool LinkedStack<T>::isEmpty() {
+ return !m_head;
}
template <typename T>
-inline void LinkedStack<T>::push(const T& data)
-{
- m_head = adoptPtr(new Node(data, m_head.release()));
- ++m_size;
+inline void LinkedStack<T>::push(const T& data) {
+ m_head = adoptPtr(new Node(data, m_head.release()));
+ ++m_size;
}
template <typename T>
-inline const T& LinkedStack<T>::peek()
-{
- return m_head->m_data;
+inline const T& LinkedStack<T>::peek() {
+ return m_head->m_data;
}
template <typename T>
-inline void LinkedStack<T>::pop()
-{
- ASSERT(m_head && m_size);
- m_head = m_head->m_next.release();
- --m_size;
+inline void LinkedStack<T>::pop() {
+ ASSERT(m_head && m_size);
+ m_head = m_head->m_next.release();
+ --m_size;
}
template <typename T>
-inline size_t LinkedStack<T>::size()
-{
- return m_size;
+inline size_t LinkedStack<T>::size() {
+ return m_size;
}
-
}
using WTF::LinkedStack;
« 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