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

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

Issue 612323013: QUIC - (no behavior change) s/NULL/nullptr/g in .../quic/... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/quic/quic_data_stream_test.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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Return true if there is enough space at that offset, false otherwise. 59 // Return true if there is enough space at that offset, false otherwise.
60 bool WriteUInt8ToOffset(uint8 value, size_t offset); 60 bool WriteUInt8ToOffset(uint8 value, size_t offset);
61 bool WriteUInt32ToOffset(uint32 value, size_t offset); 61 bool WriteUInt32ToOffset(uint32 value, size_t offset);
62 bool WriteUInt48ToOffset(uint64 value, size_t offset); 62 bool WriteUInt48ToOffset(uint64 value, size_t offset);
63 63
64 size_t capacity() const { 64 size_t capacity() const {
65 return capacity_; 65 return capacity_;
66 } 66 }
67 67
68 private: 68 private:
69 // Returns the location that the data should be written at, or NULL if there 69 // Returns the location that the data should be written at, or nullptr if
70 // is not enough room. Call EndWrite with the returned offset and the given 70 // there is not enough room. Call EndWrite with the returned offset and the
71 // length to pad out for the next write. 71 // given length to pad out for the next write.
72 char* BeginWrite(size_t length); 72 char* BeginWrite(size_t length);
73 73
74 char* buffer_; 74 char* buffer_;
75 size_t capacity_; // Allocation size of payload (or -1 if buffer is const). 75 size_t capacity_; // Allocation size of payload (or -1 if buffer is const).
76 size_t length_; // Current length of the buffer. 76 size_t length_; // Current length of the buffer.
77 77
78 DISALLOW_COPY_AND_ASSIGN(QuicDataWriter); 78 DISALLOW_COPY_AND_ASSIGN(QuicDataWriter);
79 }; 79 };
80 80
81 } // namespace net 81 } // namespace net
82 82
83 #endif // NET_QUIC_QUIC_DATA_WRITER_H_ 83 #endif // NET_QUIC_QUIC_DATA_WRITER_H_
OLDNEW
« no previous file with comments | « net/quic/quic_data_stream_test.cc ('k') | net/quic/quic_data_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698