| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MEMORY_REF_COUNTED_MEMORY_H_ | 5 #ifndef BASE_MEMORY_REF_COUNTED_MEMORY_H_ |
| 6 #define BASE_MEMORY_REF_COUNTED_MEMORY_H_ | 6 #define BASE_MEMORY_REF_COUNTED_MEMORY_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 #include <vector> | 11 #include <vector> |
| 10 | 12 |
| 11 #include "base/base_export.h" | 13 #include "base/base_export.h" |
| 12 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 14 | 17 |
| 15 namespace base { | 18 namespace base { |
| 16 | 19 |
| 17 // A generic interface to memory. This object is reference counted because one | 20 // A generic interface to memory. This object is reference counted because one |
| 18 // of its two subclasses own the data they carry, and we need to have | 21 // of its two subclasses own the data they carry, and we need to have |
| 19 // heterogeneous containers of these two types of memory. | 22 // heterogeneous containers of these two types of memory. |
| 20 class BASE_EXPORT RefCountedMemory | 23 class BASE_EXPORT RefCountedMemory |
| 21 : public base::RefCountedThreadSafe<RefCountedMemory> { | 24 : public base::RefCountedThreadSafe<RefCountedMemory> { |
| 22 public: | 25 public: |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 140 |
| 138 unsigned char* data_; | 141 unsigned char* data_; |
| 139 size_t length_; | 142 size_t length_; |
| 140 | 143 |
| 141 DISALLOW_COPY_AND_ASSIGN(RefCountedMallocedMemory); | 144 DISALLOW_COPY_AND_ASSIGN(RefCountedMallocedMemory); |
| 142 }; | 145 }; |
| 143 | 146 |
| 144 } // namespace base | 147 } // namespace base |
| 145 | 148 |
| 146 #endif // BASE_MEMORY_REF_COUNTED_MEMORY_H_ | 149 #endif // BASE_MEMORY_REF_COUNTED_MEMORY_H_ |
| OLD | NEW |