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

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

Issue 1436153002: Apply clang-format with Chromium-style without column limit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 b63cd06ac3cf31854aac68cb62c3b4642bbda983..7bcb27ffb5853f16f728ff3c5d62af39103129e9 100644
--- a/third_party/WebKit/Source/wtf/LinkedStack.h
+++ b/third_party/WebKit/Source/wtf/LinkedStack.h
@@ -38,83 +38,77 @@ 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();
-
- // This inner class used to be private but is now public on account of a
- // possible MSVC bug. It can be made private again if we get rid of
- // USING_FAST_MALLOC ever.
- class Node {
- USING_FAST_MALLOC(LinkedStack::Node);
- public:
- Node(const T&, PassOwnPtr<Node> next);
-
- T m_data;
- OwnPtr<Node> m_next;
- };
-
-private:
- OwnPtr<Node> m_head;
- size_t m_size;
+ 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();
+
+ // This inner class used to be private but is now public on account of a
+ // possible MSVC bug. It can be made private again if we get rid of
+ // USING_FAST_MALLOC ever.
+ class Node {
+ USING_FAST_MALLOC(LinkedStack::Node);
+
+ public:
+ Node(const T&, PassOwnPtr<Node> next);
+
+ T m_data;
+ OwnPtr<Node> m_next;
+ };
+
+ private:
+ 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