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

Side by Side Diff: net/base/io_buffer.h

Issue 1149113006: Move Pickle to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « ipc/param_traits_read_macros.h ('k') | net/cert/signed_certificate_timestamp.h » ('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 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 int capacity_; 218 int capacity_;
219 int offset_; 219 int offset_;
220 }; 220 };
221 221
222 // This versions allows a pickle to be used as the storage for a write-style 222 // This versions allows a pickle to be used as the storage for a write-style
223 // operation, avoiding an extra data copy. 223 // operation, avoiding an extra data copy.
224 class NET_EXPORT PickledIOBuffer : public IOBuffer { 224 class NET_EXPORT PickledIOBuffer : public IOBuffer {
225 public: 225 public:
226 PickledIOBuffer(); 226 PickledIOBuffer();
227 227
228 Pickle* pickle() { return &pickle_; } 228 base::Pickle* pickle() { return &pickle_; }
229 229
230 // Signals that we are done writing to the pickle and we can use it for a 230 // Signals that we are done writing to the pickle and we can use it for a
231 // write-style IO operation. 231 // write-style IO operation.
232 void Done(); 232 void Done();
233 233
234 private: 234 private:
235 ~PickledIOBuffer() override; 235 ~PickledIOBuffer() override;
236 236
237 Pickle pickle_; 237 base::Pickle pickle_;
238 }; 238 };
239 239
240 // This class allows the creation of a temporary IOBuffer that doesn't really 240 // This class allows the creation of a temporary IOBuffer that doesn't really
241 // own the underlying buffer. Please use this class only as a last resort. 241 // own the underlying buffer. Please use this class only as a last resort.
242 // A good example is the buffer for a synchronous operation, where we can be 242 // A good example is the buffer for a synchronous operation, where we can be
243 // sure that nobody is keeping an extra reference to this object so the lifetime 243 // sure that nobody is keeping an extra reference to this object so the lifetime
244 // of the buffer can be completely managed by its intended owner. 244 // of the buffer can be completely managed by its intended owner.
245 class NET_EXPORT WrappedIOBuffer : public IOBuffer { 245 class NET_EXPORT WrappedIOBuffer : public IOBuffer {
246 public: 246 public:
247 explicit WrappedIOBuffer(const char* data); 247 explicit WrappedIOBuffer(const char* data);
248 248
249 protected: 249 protected:
250 ~WrappedIOBuffer() override; 250 ~WrappedIOBuffer() override;
251 }; 251 };
252 252
253 } // namespace net 253 } // namespace net
254 254
255 #endif // NET_BASE_IO_BUFFER_H_ 255 #endif // NET_BASE_IO_BUFFER_H_
OLDNEW
« no previous file with comments | « ipc/param_traits_read_macros.h ('k') | net/cert/signed_certificate_timestamp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698