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

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

Issue 1979763002: Landing Recent QUIC changes until Sun May 8 00:39:29 2016 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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_http_stream_test.cc ('k') | net/quic/quic_packet_creator_test.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 #include "net/quic/quic_packet_creator.h" 5 #include "net/quic/quic_packet_creator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 packet_.encryption_level != ENCRYPTION_FORWARD_SECURE) { 311 packet_.encryption_level != ENCRYPTION_FORWARD_SECURE) {
312 packet_.encryption_level = retransmission.encryption_level; 312 packet_.encryption_level = retransmission.encryption_level;
313 } 313 }
314 314
315 // Serialize the packet and restore packet number length state. 315 // Serialize the packet and restore packet number length state.
316 for (const QuicFrame& frame : retransmission.retransmittable_frames) { 316 for (const QuicFrame& frame : retransmission.retransmittable_frames) {
317 bool success = AddFrame(frame, false); 317 bool success = AddFrame(frame, false);
318 DCHECK(success); 318 DCHECK(success);
319 } 319 }
320 SerializePacket(buffer, buffer_len); 320 SerializePacket(buffer, buffer_len);
321 packet_.original_path_id = retransmission.path_id;
321 packet_.original_packet_number = retransmission.packet_number; 322 packet_.original_packet_number = retransmission.packet_number;
322 packet_.transmission_type = retransmission.transmission_type; 323 packet_.transmission_type = retransmission.transmission_type;
323 OnSerializedPacket(); 324 OnSerializedPacket();
324 // Restore old values. 325 // Restore old values.
325 packet_.packet_number_length = saved_length; 326 packet_.packet_number_length = saved_length;
326 next_packet_number_length_ = saved_next_length; 327 next_packet_number_length_ = saved_next_length;
327 packet_.encryption_level = default_encryption_level; 328 packet_.encryption_level = default_encryption_level;
328 } 329 }
329 330
330 void QuicPacketCreator::Flush() { 331 void QuicPacketCreator::Flush() {
(...skipping 25 matching lines...) Expand all
356 if (CanSetMaxPacketLength()) { 357 if (CanSetMaxPacketLength()) {
357 SetMaxPacketLength(max_packet_length_); 358 SetMaxPacketLength(max_packet_length_);
358 } 359 }
359 } 360 }
360 361
361 void QuicPacketCreator::ClearPacket() { 362 void QuicPacketCreator::ClearPacket() {
362 packet_.has_ack = false; 363 packet_.has_ack = false;
363 packet_.has_stop_waiting = false; 364 packet_.has_stop_waiting = false;
364 packet_.has_crypto_handshake = NOT_HANDSHAKE; 365 packet_.has_crypto_handshake = NOT_HANDSHAKE;
365 packet_.num_padding_bytes = 0; 366 packet_.num_padding_bytes = 0;
367 packet_.original_path_id = kInvalidPathId;
366 packet_.original_packet_number = 0; 368 packet_.original_packet_number = 0;
367 packet_.transmission_type = NOT_RETRANSMISSION; 369 packet_.transmission_type = NOT_RETRANSMISSION;
368 packet_.encrypted_buffer = nullptr; 370 packet_.encrypted_buffer = nullptr;
369 packet_.encrypted_length = 0; 371 packet_.encrypted_length = 0;
370 DCHECK(packet_.retransmittable_frames.empty()); 372 DCHECK(packet_.retransmittable_frames.empty());
371 packet_.listeners.clear(); 373 packet_.listeners.clear();
372 } 374 }
373 375
374 bool QuicPacketCreator::HasPendingFrames() const { 376 bool QuicPacketCreator::HasPendingFrames() const {
375 return !queued_frames_.empty(); 377 return !queued_frames_.empty();
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 // Switching path needs to update packet number length. 615 // Switching path needs to update packet number length.
614 UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight); 616 UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight);
615 } 617 }
616 618
617 bool QuicPacketCreator::IncludeNonceInPublicHeader() { 619 bool QuicPacketCreator::IncludeNonceInPublicHeader() {
618 return have_diversification_nonce_ && 620 return have_diversification_nonce_ &&
619 packet_.encryption_level == ENCRYPTION_INITIAL; 621 packet_.encryption_level == ENCRYPTION_INITIAL;
620 } 622 }
621 623
622 } // namespace net 624 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_http_stream_test.cc ('k') | net/quic/quic_packet_creator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698