Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Side by Side Diff: base/memory/ref_counted_memory.h

Issue 1550963002: Remove RefCountedMallocedMemory, it's not used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/memory/ref_counted_memory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 std::string& data() { return data_; } 117 std::string& data() { return data_; }
118 118
119 private: 119 private:
120 ~RefCountedString() override; 120 ~RefCountedString() override;
121 121
122 std::string data_; 122 std::string data_;
123 123
124 DISALLOW_COPY_AND_ASSIGN(RefCountedString); 124 DISALLOW_COPY_AND_ASSIGN(RefCountedString);
125 }; 125 };
126 126
127 // An implementation of RefCountedMemory that holds a chunk of memory
128 // previously allocated with malloc or calloc, and that therefore must be freed
129 // using free().
130 class BASE_EXPORT RefCountedMallocedMemory : public base::RefCountedMemory {
131 public:
132 RefCountedMallocedMemory(void* data, size_t length);
133
134 // Overridden from RefCountedMemory:
135 const unsigned char* front() const override;
136 size_t size() const override;
137
138 private:
139 ~RefCountedMallocedMemory() override;
140
141 unsigned char* data_;
142 size_t length_;
143
144 DISALLOW_COPY_AND_ASSIGN(RefCountedMallocedMemory);
145 };
146
147 } // namespace base 127 } // namespace base
148 128
149 #endif // BASE_MEMORY_REF_COUNTED_MEMORY_H_ 129 #endif // BASE_MEMORY_REF_COUNTED_MEMORY_H_
OLDNEW
« no previous file with comments | « no previous file | base/memory/ref_counted_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698