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

Side by Side Diff: net/quic/core/quic_packets.cc

Issue 2591143003: Add QuicStrCat. (Closed)
Patch Set: correct quic_client_bin.cc Created 4 years 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
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 #include "net/quic/core/quic_packets.h" 5 #include "net/quic/core/quic_packets.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "net/quic/core/quic_flags.h" 9 #include "net/quic/core/quic_flags.h"
10 #include "net/quic/core/quic_utils.h" 10 #include "net/quic/core/quic_utils.h"
11 #include "net/quic/core/quic_versions.h" 11 #include "net/quic/core/quic_versions.h"
12 #include "net/quic/platform/api/quic_str_cat.h"
Ryan Hamilton 2016/12/22 18:17:30 Is this required? I don't think we use StrCat in t
12 13
13 using base::StringPiece; 14 using base::StringPiece;
14 using std::string; 15 using std::string;
15 16
16 namespace net { 17 namespace net {
17 18
18 size_t GetPacketHeaderSize(QuicVersion version, 19 size_t GetPacketHeaderSize(QuicVersion version,
19 const QuicPacketHeader& header) { 20 const QuicPacketHeader& header) {
20 return GetPacketHeaderSize(version, header.public_header.connection_id_length, 21 return GetPacketHeaderSize(version, header.public_header.connection_id_length,
21 header.public_header.version_flag, 22 header.public_header.version_flag,
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 serialized_packet->encrypted_length = 0; 240 serialized_packet->encrypted_length = 0;
240 } 241 }
241 242
242 char* CopyBuffer(const SerializedPacket& packet) { 243 char* CopyBuffer(const SerializedPacket& packet) {
243 char* dst_buffer = new char[packet.encrypted_length]; 244 char* dst_buffer = new char[packet.encrypted_length];
244 memcpy(dst_buffer, packet.encrypted_buffer, packet.encrypted_length); 245 memcpy(dst_buffer, packet.encrypted_buffer, packet.encrypted_length);
245 return dst_buffer; 246 return dst_buffer;
246 } 247 }
247 248
248 } // namespace net 249 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698