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 NET_BASE_IO_BUFFER_H_ | 5 #ifndef NET_BASE_IO_BUFFER_H_ |
6 #define NET_BASE_IO_BUFFER_H_ | 6 #define NET_BASE_IO_BUFFER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // |offset| moves the |data_| pointer, allowing "seeking" in the data. | 196 // |offset| moves the |data_| pointer, allowing "seeking" in the data. |
197 void set_offset(int offset); | 197 void set_offset(int offset); |
198 int offset() { return offset_; } | 198 int offset() { return offset_; } |
199 | 199 |
200 int RemainingCapacity(); | 200 int RemainingCapacity(); |
201 char* StartOfBuffer(); | 201 char* StartOfBuffer(); |
202 | 202 |
203 private: | 203 private: |
204 virtual ~GrowableIOBuffer(); | 204 virtual ~GrowableIOBuffer(); |
205 | 205 |
206 scoped_ptr_malloc<char> real_data_; | 206 scoped_ptr<char, base::FreeDeleter> real_data_; |
207 int capacity_; | 207 int capacity_; |
208 int offset_; | 208 int offset_; |
209 }; | 209 }; |
210 | 210 |
211 // This versions allows a pickle to be used as the storage for a write-style | 211 // This versions allows a pickle to be used as the storage for a write-style |
212 // operation, avoiding an extra data copy. | 212 // operation, avoiding an extra data copy. |
213 class NET_EXPORT PickledIOBuffer : public IOBuffer { | 213 class NET_EXPORT PickledIOBuffer : public IOBuffer { |
214 public: | 214 public: |
215 PickledIOBuffer(); | 215 PickledIOBuffer(); |
216 | 216 |
(...skipping 18 matching lines...) Expand all Loading... |
235 public: | 235 public: |
236 explicit WrappedIOBuffer(const char* data); | 236 explicit WrappedIOBuffer(const char* data); |
237 | 237 |
238 protected: | 238 protected: |
239 virtual ~WrappedIOBuffer(); | 239 virtual ~WrappedIOBuffer(); |
240 }; | 240 }; |
241 | 241 |
242 } // namespace net | 242 } // namespace net |
243 | 243 |
244 #endif // NET_BASE_IO_BUFFER_H_ | 244 #endif // NET_BASE_IO_BUFFER_H_ |
OLD | NEW |