Index: third_party/WebKit/Source/wtf/Deque.h |
diff --git a/third_party/WebKit/Source/wtf/Deque.h b/third_party/WebKit/Source/wtf/Deque.h |
index 19a19fa14394ed6e2fd6602216a08ba19e7eef80..852fdd38a914dd53a4f341be894593540a5a9fa6 100644 |
--- a/third_party/WebKit/Source/wtf/Deque.h |
+++ b/third_party/WebKit/Source/wtf/Deque.h |
@@ -52,13 +52,15 @@ public: |
typedef std::reverse_iterator<const_iterator> const_reverse_iterator; |
Deque(); |
- Deque(const Deque<T, inlineCapacity, Allocator>&); |
+ Deque(const Deque&); |
Deque& operator=(const Deque&); |
+ Deque(Deque&&); |
+ Deque& operator=(Deque&&); |
void finalize(); |
void finalizeGarbageCollectedObject() { finalize(); } |
- void swap(Deque<T, inlineCapacity, Allocator>&); |
+ void swap(Deque&); |
size_t size() const { return m_start <= m_end ? m_end - m_start : m_end + m_buffer.capacity() - m_start; } |
bool isEmpty() const { return m_start == m_end; } |
@@ -110,6 +112,12 @@ public: |
template <typename VisitorDispatcher> void trace(VisitorDispatcher); |
+ static_assert(!std::is_polymorphic<T>::value || !VectorTraits<T>::canInitializeWithMemset, "Cannot initialize with memset if there is a vtable"); |
+#if ENABLE(OILPAN) |
+ static_assert(Allocator::isGarbageCollected || !AllowsOnlyPlacementNew<T>::value || !NeedsTracing<T>::value, "Cannot put DISALLOW_NEW_EXCEPT_PLACEMENT_NEW objects that have trace methods into an off-heap Deque"); |
+#endif |
+ static_assert(Allocator::isGarbageCollected || !IsPointerToGarbageCollectedType<T>::value, "Cannot put raw pointers to garbage-collected classes into a Deque. Use HeapDeque<Member<T>> instead."); |
+ |
private: |
friend class DequeIteratorBase<T, inlineCapacity, Allocator>; |
@@ -237,15 +245,10 @@ inline Deque<T, inlineCapacity, Allocator>::Deque() |
: m_start(0) |
, m_end(0) |
{ |
- static_assert(!std::is_polymorphic<T>::value || !VectorTraits<T>::canInitializeWithMemset, "Cannot initialize with memset if there is a vtable"); |
-#if ENABLE(OILPAN) |
- static_assert(Allocator::isGarbageCollected || !AllowsOnlyPlacementNew<T>::value || !NeedsTracing<T>::value, "Cannot put DISALLOW_NEW_EXCEPT_PLACEMENT_NEW objects that have trace methods into an off-heap Deque"); |
-#endif |
- static_assert(Allocator::isGarbageCollected || !IsPointerToGarbageCollectedType<T>::value, "Cannot put raw pointers to garbage-collected classes into a Deque. Use HeapDeque<Member<T>> instead."); |
} |
template <typename T, size_t inlineCapacity, typename Allocator> |
-inline Deque<T, inlineCapacity, Allocator>::Deque(const Deque<T, inlineCapacity, Allocator>& other) |
+inline Deque<T, inlineCapacity, Allocator>::Deque(const Deque& other) |
: m_buffer(other.m_buffer.capacity()) |
, m_start(other.m_start) |
, m_end(other.m_end) |
@@ -268,6 +271,21 @@ inline Deque<T, inlineCapacity, Allocator>& Deque<T, inlineCapacity, Allocator>: |
} |
template <typename T, size_t inlineCapacity, typename Allocator> |
+inline Deque<T, inlineCapacity, Allocator>::Deque(Deque&& other) |
+ : m_start(0) |
+ , m_end(0) |
+{ |
+ swap(other); |
+} |
+ |
+template <typename T, size_t inlineCapacity, typename Allocator> |
+inline Deque<T, inlineCapacity, Allocator>& Deque<T, inlineCapacity, Allocator>::operator=(Deque&& other) |
+{ |
+ swap(other); |
+ return *this; |
+} |
+ |
+template <typename T, size_t inlineCapacity, typename Allocator> |
inline void Deque<T, inlineCapacity, Allocator>::destroyAll() |
{ |
if (m_start <= m_end) { |