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

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

Issue 1667583004: Landing Recent QUIC changes until 01/31/2016 05:22 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0203
Patch Set: Rebase Created 4 years, 10 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_unacked_packet_map_test.cc ('k') | net/quic/quic_utils.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 // Some helpers for quic. 5 // Some helpers for quic.
6 6
7 #ifndef NET_QUIC_QUIC_UTILS_H_ 7 #ifndef NET_QUIC_QUIC_UTILS_H_
8 #define NET_QUIC_QUIC_UTILS_H_ 8 #define NET_QUIC_QUIC_UTILS_H_
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 // Deletes and clears all the frames and the packet from serialized packet. 114 // Deletes and clears all the frames and the packet from serialized packet.
115 static void ClearSerializedPacket(SerializedPacket* serialized_packet); 115 static void ClearSerializedPacket(SerializedPacket* serialized_packet);
116 116
117 // Returns a packed representation of |path_id| and |packet_number| in which 117 // Returns a packed representation of |path_id| and |packet_number| in which
118 // the highest byte is set to |path_id| and the lower 7 bytes are the lower 118 // the highest byte is set to |path_id| and the lower 7 bytes are the lower
119 // 7 bytes of |packet_number|. 119 // 7 bytes of |packet_number|.
120 static uint64_t PackPathIdAndPacketNumber(QuicPathId path_id, 120 static uint64_t PackPathIdAndPacketNumber(QuicPathId path_id,
121 QuicPacketNumber packet_number); 121 QuicPacketNumber packet_number);
122 122
123 // Allocates a new char[] of size |packet.encrypted_length| and copies in
124 // |packet.encrypted_buffer|.
125 static char* CopyBuffer(const SerializedPacket& packet);
126
123 private: 127 private:
124 DISALLOW_COPY_AND_ASSIGN(QuicUtils); 128 DISALLOW_COPY_AND_ASSIGN(QuicUtils);
125 }; 129 };
126 130
127 // Utility function that returns an QuicIOVector object wrapped around |str|. 131 // Utility function that returns an QuicIOVector object wrapped around |str|.
128 // |str|'s data is stored in |iov|. 132 // |str|'s data is stored in |iov|.
129 inline QuicIOVector MakeIOVector(base::StringPiece str, struct iovec* iov) { 133 inline QuicIOVector MakeIOVector(base::StringPiece str, struct iovec* iov) {
130 iov->iov_base = const_cast<char*>(str.data()); 134 iov->iov_base = const_cast<char*>(str.data());
131 iov->iov_len = static_cast<size_t>(str.size()); 135 iov->iov_len = static_cast<size_t>(str.size());
132 QuicIOVector quic_iov(iov, 1, str.size()); 136 QuicIOVector quic_iov(iov, 1, str.size());
133 return quic_iov; 137 return quic_iov;
134 } 138 }
135 139
136 } // namespace net 140 } // namespace net
137 141
138 #endif // NET_QUIC_QUIC_UTILS_H_ 142 #endif // NET_QUIC_QUIC_UTILS_H_
OLDNEW
« no previous file with comments | « net/quic/quic_unacked_packet_map_test.cc ('k') | net/quic/quic_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698