summaryrefslogtreecommitdiffstats
path: root/chrome/common/ref_counted_util.h
blob: 9eef8ded81f0c184d795fa0985054245e90ad432 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) 2011 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 CHROME_COMMON_REF_COUNTED_UTIL_H__
#define CHROME_COMMON_REF_COUNTED_UTIL_H__
#pragma once

#include "base/memory/ref_counted.h"
#include <vector>

// RefCountedVector is just a vector wrapped up with
// RefCountedThreadSafe.
template<class T>
class RefCountedVector
    : public base::RefCountedThreadSafe<RefCountedVector<T> > {
 public:
  RefCountedVector() {}
  explicit RefCountedVector(const std::vector<T>& initializer)
      : data(initializer) {}

  std::vector<T> data;

  DISALLOW_COPY_AND_ASSIGN(RefCountedVector<T>);
};

#endif  // CHROME_COMMON_REF_COUNTED_UTIL_H__