Chromium Code Reviews| Index: base/memory/ref_counted_memory.h |
| diff --git a/base/memory/ref_counted_memory.h b/base/memory/ref_counted_memory.h |
| index fd5e8a0b8fc51c05598ab861c52dbed6248d76c3..fa6eafa72ead0f350852bff903bd13bfa66e66ce 100644 |
| --- a/base/memory/ref_counted_memory.h |
| +++ b/base/memory/ref_counted_memory.h |
| @@ -113,6 +113,26 @@ class BASE_EXPORT RefCountedString : public RefCountedMemory { |
| DISALLOW_COPY_AND_ASSIGN(RefCountedString); |
| }; |
| +// An implementation of RefCountedMemory, that holds a chunk of memory |
|
brettw
2013/11/21 23:29:50
Grammar: no comma before "that"
|
| +// previously allocated with malloc or calloc, and that therefore must be freed |
| +// using free(). |
| +class BASE_EXPORT RefCountedMallocedMemory : public base::RefCountedMemory { |
| + public: |
| + RefCountedMallocedMemory(void* data, size_t length); |
| + |
| + // Overridden from RefCountedMemory: |
| + virtual const unsigned char* front() const OVERRIDE; |
| + virtual size_t size() const OVERRIDE; |
| + |
| + private: |
| + virtual ~RefCountedMallocedMemory(); |
| + |
| + unsigned char* data_; |
| + size_t length_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(RefCountedMallocedMemory); |
| +}; |
| + |
| } // namespace base |
| #endif // BASE_MEMORY_REF_COUNTED_MEMORY_H_ |