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

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

Issue 1841863002: Update monet. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 4 years, 8 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 | « net/base/host_mapping_rules.cc ('k') | net/base/mime_sniffer.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 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 int capacity_; 208 int capacity_;
209 int offset_; 209 int offset_;
210 }; 210 };
211 211
212 // This versions allows a pickle to be used as the storage for a write-style 212 // This versions allows a pickle to be used as the storage for a write-style
213 // operation, avoiding an extra data copy. 213 // operation, avoiding an extra data copy.
214 class NET_EXPORT PickledIOBuffer : public IOBuffer { 214 class NET_EXPORT PickledIOBuffer : public IOBuffer {
215 public: 215 public:
216 PickledIOBuffer(); 216 PickledIOBuffer();
217 217
218 Pickle* pickle() { return &pickle_; } 218 base::Pickle* pickle() { return &pickle_; }
219 219
220 // Signals that we are done writing to the pickle and we can use it for a 220 // Signals that we are done writing to the pickle and we can use it for a
221 // write-style IO operation. 221 // write-style IO operation.
222 void Done(); 222 void Done();
223 223
224 private: 224 private:
225 ~PickledIOBuffer() override; 225 ~PickledIOBuffer() override;
226 226
227 Pickle pickle_; 227 base::Pickle pickle_;
228 }; 228 };
229 229
230 // This class allows the creation of a temporary IOBuffer that doesn't really 230 // This class allows the creation of a temporary IOBuffer that doesn't really
231 // own the underlying buffer. Please use this class only as a last resort. 231 // own the underlying buffer. Please use this class only as a last resort.
232 // A good example is the buffer for a synchronous operation, where we can be 232 // A good example is the buffer for a synchronous operation, where we can be
233 // sure that nobody is keeping an extra reference to this object so the lifetime 233 // sure that nobody is keeping an extra reference to this object so the lifetime
234 // of the buffer can be completely managed by its intended owner. 234 // of the buffer can be completely managed by its intended owner.
235 class NET_EXPORT WrappedIOBuffer : public IOBuffer { 235 class NET_EXPORT WrappedIOBuffer : public IOBuffer {
236 public: 236 public:
237 explicit WrappedIOBuffer(const char* data); 237 explicit WrappedIOBuffer(const char* data);
238 238
239 protected: 239 protected:
240 ~WrappedIOBuffer() override; 240 ~WrappedIOBuffer() override;
241 }; 241 };
242 242
243 } // namespace net 243 } // namespace net
244 244
245 #endif // NET_BASE_IO_BUFFER_H_ 245 #endif // NET_BASE_IO_BUFFER_H_
OLDNEW
« no previous file with comments | « net/base/host_mapping_rules.cc ('k') | net/base/mime_sniffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698