OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 BASE_VALUES_UTIL_H_ | 5 #ifndef BASE_VALUES_UTIL_H_ |
6 #define BASE_VALUES_UTIL_H_ | 6 #define BASE_VALUES_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 | 11 |
12 class RefCountedList : public base::RefCountedThreadSafe<RefCountedList> { | 12 class RefCountedList : public base::RefCountedThreadSafe<RefCountedList> { |
13 public: | 13 public: |
14 // Takes ownership of |list|. | 14 // Takes ownership of |list|. |
15 explicit RefCountedList(ListValue* list); | 15 explicit RefCountedList(ListValue* list); |
16 virtual ~RefCountedList(); | 16 virtual ~RefCountedList(); |
17 | 17 |
18 virtual ListValue* Get() { | 18 virtual ListValue* Get(); |
19 return list_; | |
20 } | |
21 | 19 |
22 private: | 20 private: |
23 ListValue* list_; | 21 ListValue* list_; |
24 | 22 |
25 DISALLOW_COPY_AND_ASSIGN(RefCountedList); | 23 DISALLOW_COPY_AND_ASSIGN(RefCountedList); |
26 }; | 24 }; |
27 | 25 |
28 #endif // BASE_VALUES_UTIL_H_ | 26 #endif // BASE_VALUES_UTIL_H_ |
OLD | NEW |