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

Unified Diff: Source/wtf/DoubleBufferedDeque.h

Issue 1190483002: Remove WTF::DoubleBufferedDeque. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | « no previous file | Source/wtf/DoubleBufferedDequeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/DoubleBufferedDeque.h
diff --git a/Source/wtf/DoubleBufferedDeque.h b/Source/wtf/DoubleBufferedDeque.h
deleted file mode 100644
index 5343f00c7770b37326eabc4f8e00fe1eb0ced0a7..0000000000000000000000000000000000000000
--- a/Source/wtf/DoubleBufferedDeque.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef DoubleBufferedDeque_h
-#define DoubleBufferedDeque_h
-
-#include "wtf/Deque.h"
-#include "wtf/Noncopyable.h"
-
-namespace WTF {
-
-// A helper class for managing double buffered deques, typically where the client locks when appending or swapping.
-template <typename T> class DoubleBufferedDeque {
- WTF_MAKE_NONCOPYABLE(DoubleBufferedDeque);
-public:
- DoubleBufferedDeque()
- : m_activeIndex(0) { }
-
- void append(const T& value)
- {
- m_queue[m_activeIndex].append(value);
- }
-
- bool isEmpty() const
- {
- return m_queue[m_activeIndex].isEmpty();
- }
-
- Deque<T>& swapBuffers()
- {
- int oldIndex = m_activeIndex;
- m_activeIndex ^= 1;
- ASSERT(m_queue[m_activeIndex].isEmpty());
- return m_queue[oldIndex];
- }
-
-private:
- Deque<T> m_queue[2];
- int m_activeIndex;
-};
-
-} // namespace WTF
-
-using WTF::DoubleBufferedDeque;
-
-#endif // DoubleBufferedDeque_h
« no previous file with comments | « no previous file | Source/wtf/DoubleBufferedDequeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698