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

Side by Side Diff: net/quic/quic_connection_test.cc

Issue 1662433002: Per-packet options now passed through to QuicPacketWriter, instead of (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@113054959
Patch Set: Fix comments for Patch Set 1 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_connection.cc ('k') | net/quic/quic_packet_writer.h » ('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 #include "net/quic/quic_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 use_tagging_decrypter_(false), 259 use_tagging_decrypter_(false),
260 packets_write_attempts_(0), 260 packets_write_attempts_(0),
261 clock_(clock), 261 clock_(clock),
262 write_pause_time_delta_(QuicTime::Delta::Zero()), 262 write_pause_time_delta_(QuicTime::Delta::Zero()),
263 max_packet_size_(kMaxPacketSize) {} 263 max_packet_size_(kMaxPacketSize) {}
264 264
265 // QuicPacketWriter interface 265 // QuicPacketWriter interface
266 WriteResult WritePacket(const char* buffer, 266 WriteResult WritePacket(const char* buffer,
267 size_t buf_len, 267 size_t buf_len,
268 const IPAddressNumber& self_address, 268 const IPAddressNumber& self_address,
269 const IPEndPoint& peer_address) override { 269 const IPEndPoint& peer_address,
270 PerPacketOptions* options) override {
270 QuicEncryptedPacket packet(buffer, buf_len); 271 QuicEncryptedPacket packet(buffer, buf_len);
271 ++packets_write_attempts_; 272 ++packets_write_attempts_;
272 273
273 if (packet.length() >= sizeof(final_bytes_of_last_packet_)) { 274 if (packet.length() >= sizeof(final_bytes_of_last_packet_)) {
274 final_bytes_of_previous_packet_ = final_bytes_of_last_packet_; 275 final_bytes_of_previous_packet_ = final_bytes_of_last_packet_;
275 memcpy(&final_bytes_of_last_packet_, packet.data() + packet.length() - 4, 276 memcpy(&final_bytes_of_last_packet_, packet.data() + packet.length() - 4,
276 sizeof(final_bytes_of_last_packet_)); 277 sizeof(final_bytes_of_last_packet_));
277 } 278 }
278 279
279 if (use_tagging_decrypter_) { 280 if (use_tagging_decrypter_) {
(...skipping 5403 matching lines...) Expand 10 before | Expand all | Expand 10 after
5683 QuicStreamFrame stream_frame(1u, false, 0u, StringPiece()); 5684 QuicStreamFrame stream_frame(1u, false, 0u, StringPiece());
5684 EXPECT_DFATAL(ProcessFramePacket(QuicFrame(&stream_frame)), 5685 EXPECT_DFATAL(ProcessFramePacket(QuicFrame(&stream_frame)),
5685 "Received a packet with multipath flag on when multipath is " 5686 "Received a packet with multipath flag on when multipath is "
5686 "not enabled."); 5687 "not enabled.");
5687 EXPECT_FALSE(connection_.connected()); 5688 EXPECT_FALSE(connection_.connected());
5688 } 5689 }
5689 5690
5690 } // namespace 5691 } // namespace
5691 } // namespace test 5692 } // namespace test
5692 } // namespace net 5693 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_packet_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698