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

Side by Side Diff: net/quic/quic_data_writer.h

Issue 47283002: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compilation error Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_data_reader.cc ('k') | net/quic/quic_data_writer.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_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"
(...skipping 25 matching lines...) Expand all
36 char* take(); 36 char* take();
37 37
38 // Methods for adding to the payload. These values are appended to the end 38 // Methods for adding to the payload. These values are appended to the end
39 // of the QuicDataWriter payload. Note - binary integers are written in 39 // of the QuicDataWriter payload. Note - binary integers are written in
40 // host byte order (little endian) not network byte order (big endian). 40 // host byte order (little endian) not network byte order (big endian).
41 bool WriteUInt8(uint8 value); 41 bool WriteUInt8(uint8 value);
42 bool WriteUInt16(uint16 value); 42 bool WriteUInt16(uint16 value);
43 bool WriteUInt32(uint32 value); 43 bool WriteUInt32(uint32 value);
44 bool WriteUInt48(uint64 value); 44 bool WriteUInt48(uint64 value);
45 bool WriteUInt64(uint64 value); 45 bool WriteUInt64(uint64 value);
46 // Write unsigned floating point corresponding to the value. Large values are
47 // clamped to the maximum representable (kUFloat16MaxValue). Values that can
48 // not be represented directly are rounded down.
49 bool WriteUFloat16(uint64 value);
46 bool WriteStringPiece16(base::StringPiece val); 50 bool WriteStringPiece16(base::StringPiece val);
47 bool WriteBytes(const void* data, size_t data_len); 51 bool WriteBytes(const void* data, size_t data_len);
48 bool WriteRepeatedByte(uint8 byte, size_t count); 52 bool WriteRepeatedByte(uint8 byte, size_t count);
49 // Fills the remaining buffer with null characters. 53 // Fills the remaining buffer with null characters.
50 void WritePadding(); 54 void WritePadding();
51 55
52 // Methods for editing the payload at a specific offset, where the 56 // Methods for editing the payload at a specific offset, where the
53 // offset must be within the writer's capacity. 57 // offset must be within the writer's capacity.
54 // Return true if there is enough space at that offset, false otherwise. 58 // Return true if there is enough space at that offset, false otherwise.
55 bool WriteUInt8ToOffset(uint8 value, size_t offset); 59 bool WriteUInt8ToOffset(uint8 value, size_t offset);
(...skipping 11 matching lines...) Expand all
67 char* BeginWrite(size_t length); 71 char* BeginWrite(size_t length);
68 72
69 char* buffer_; 73 char* buffer_;
70 size_t capacity_; // Allocation size of payload (or -1 if buffer is const). 74 size_t capacity_; // Allocation size of payload (or -1 if buffer is const).
71 size_t length_; // Current length of the buffer. 75 size_t length_; // Current length of the buffer.
72 }; 76 };
73 77
74 } // namespace net 78 } // namespace net
75 79
76 #endif // NET_QUIC_QUIC_DATA_WRITER_H_ 80 #endif // NET_QUIC_QUIC_DATA_WRITER_H_
OLDNEW
« no previous file with comments | « net/quic/quic_data_reader.cc ('k') | net/quic/quic_data_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698