ref_counted_util.h revision 3345a6884c488ff3a535c2c9acdd33d74b37e311
1// Copyright (c) 2006-2008 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/ref_counted.h" 10#include <vector> 11 12// RefCountedVector is just a vector wrapped up with 13// RefCountedThreadSafe. 14template<class T> 15class 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