1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_COMMON_REF_COUNTED_UTIL_H__ 6 #define CHROME_COMMON_REF_COUNTED_UTIL_H__ 7 #pragma once 8 9 #include "base/memory/ref_counted.h" 10 #include <vector> 11 12 // RefCountedVector is just a vector wrapped up with 13 // RefCountedThreadSafe. 14 template<class T> 15 class RefCountedVector 16 : public base::RefCountedThreadSafe<RefCountedVector<T> > { 17 public: 18 RefCountedVector() {} 19 explicit RefCountedVector(const std::vector<T>& initializer) 20 : data(initializer) {} 21 22 std::vector<T> data; 23 24 DISALLOW_COPY_AND_ASSIGN(RefCountedVector<T>); 25 }; 26 27 #endif // CHROME_COMMON_REF_COUNTED_UTIL_H__ 28