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_QUIC_QUIC_DATA_WRITER_H_ | 5 #ifndef NET_QUIC_QUIC_DATA_WRITER_H_ |
6 #define NET_QUIC_QUIC_DATA_WRITER_H_ | 6 #define NET_QUIC_QUIC_DATA_WRITER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/port.h" | 12 #include "base/port.h" |
13 #include "base/string_piece.h" | 13 #include "base/string_piece.h" |
| 14 #include "net/base/int128.h" |
14 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
15 #include "net/quic/quic_protocol.h" | 16 #include "net/quic/quic_protocol.h" |
16 #include "net/quic/uint128.h" | |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 // This class provides facilities for packing QUIC data. | 20 // This class provides facilities for packing QUIC data. |
21 // | 21 // |
22 // The QuicDataWriter supports appending primitive values (int, string, etc) | 22 // The QuicDataWriter supports appending primitive values (int, string, etc) |
23 // to a frame instance. The QuicDataWriter grows its internal memory buffer | 23 // to a frame instance. The QuicDataWriter grows its internal memory buffer |
24 // dynamically to hold the sequence of primitive values. The internal memory | 24 // dynamically to hold the sequence of primitive values. The internal memory |
25 // buffer is exposed as the "data" of the QuicDataWriter. | 25 // buffer is exposed as the "data" of the QuicDataWriter. |
26 class NET_EXPORT_PRIVATE QuicDataWriter { | 26 class NET_EXPORT_PRIVATE QuicDataWriter { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 char* BeginWrite(size_t length); | 68 char* BeginWrite(size_t length); |
69 | 69 |
70 char* buffer_; | 70 char* buffer_; |
71 size_t capacity_; // Allocation size of payload (or -1 if buffer is const). | 71 size_t capacity_; // Allocation size of payload (or -1 if buffer is const). |
72 size_t length_; // Current length of the buffer. | 72 size_t length_; // Current length of the buffer. |
73 }; | 73 }; |
74 | 74 |
75 } // namespace net | 75 } // namespace net |
76 | 76 |
77 #endif // NET_QUIC_QUIC_DATA_WRITER_H_ | 77 #endif // NET_QUIC_QUIC_DATA_WRITER_H_ |
OLD | NEW |