| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef RefVector_h | 5 #ifndef RefVector_h |
| 6 #define RefVector_h | 6 #define RefVector_h |
| 7 | 7 |
| 8 #include "wtf/RefCounted.h" | 8 #include "platform/wtf/RefCounted.h" |
| 9 #include "wtf/RefPtr.h" | 9 #include "platform/wtf/RefPtr.h" |
| 10 #include "wtf/Vector.h" | 10 #include "platform/wtf/Vector.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 template <typename T> | 14 template <typename T> |
| 15 class RefVector : public RefCounted<RefVector<T>> { | 15 class RefVector : public RefCounted<RefVector<T>> { |
| 16 public: | 16 public: |
| 17 static PassRefPtr<RefVector> create() { return adoptRef(new RefVector<T>); } | 17 static PassRefPtr<RefVector> create() { return adoptRef(new RefVector<T>); } |
| 18 static PassRefPtr<RefVector> create(const Vector<T>& vector) { | 18 static PassRefPtr<RefVector> create(const Vector<T>& vector) { |
| 19 return adoptRef(new RefVector<T>(vector)); | 19 return adoptRef(new RefVector<T>(vector)); |
| 20 } | 20 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 private: | 39 private: |
| 40 Vector<T> m_vector; | 40 Vector<T> m_vector; |
| 41 RefVector() {} | 41 RefVector() {} |
| 42 RefVector(const Vector<T>& vector) : m_vector(vector) {} | 42 RefVector(const Vector<T>& vector) : m_vector(vector) {} |
| 43 RefVector(Vector<T>&& vector) : m_vector(vector) {} | 43 RefVector(Vector<T>&& vector) : m_vector(vector) {} |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 } // namespace blink | 46 } // namespace blink |
| 47 | 47 |
| 48 #endif // RefVector_h | 48 #endif // RefVector_h |
| OLD | NEW |