| OLD | NEW | 
|---|
| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 343   if (CanSetMaxPacketLength()) { | 343   if (CanSetMaxPacketLength()) { | 
| 344     SetMaxPacketLength(max_packet_length_); | 344     SetMaxPacketLength(max_packet_length_); | 
| 345   } | 345   } | 
| 346 } | 346 } | 
| 347 | 347 | 
| 348 void QuicPacketCreator::ClearPacket() { | 348 void QuicPacketCreator::ClearPacket() { | 
| 349   packet_.has_ack = false; | 349   packet_.has_ack = false; | 
| 350   packet_.has_stop_waiting = false; | 350   packet_.has_stop_waiting = false; | 
| 351   packet_.has_crypto_handshake = NOT_HANDSHAKE; | 351   packet_.has_crypto_handshake = NOT_HANDSHAKE; | 
| 352   packet_.needs_padding = false; | 352   packet_.needs_padding = false; | 
| 353   packet_.is_fec_packet = false; |  | 
| 354   packet_.original_packet_number = 0; | 353   packet_.original_packet_number = 0; | 
| 355   packet_.transmission_type = NOT_RETRANSMISSION; | 354   packet_.transmission_type = NOT_RETRANSMISSION; | 
| 356   packet_.encrypted_buffer = nullptr; | 355   packet_.encrypted_buffer = nullptr; | 
| 357   packet_.encrypted_length = 0; | 356   packet_.encrypted_length = 0; | 
| 358   DCHECK(packet_.retransmittable_frames.empty()); | 357   DCHECK(packet_.retransmittable_frames.empty()); | 
| 359   packet_.listeners.clear(); | 358   packet_.listeners.clear(); | 
| 360 } | 359 } | 
| 361 | 360 | 
| 362 bool QuicPacketCreator::HasPendingFrames() const { | 361 bool QuicPacketCreator::HasPendingFrames() const { | 
| 363   return !queued_frames_.empty(); | 362   return !queued_frames_.empty(); | 
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 601   packet_.packet_number = it == multipath_packet_number_.end() ? 0 : it->second; | 600   packet_.packet_number = it == multipath_packet_number_.end() ? 0 : it->second; | 
| 602   packet_.path_id = path_id; | 601   packet_.path_id = path_id; | 
| 603   DCHECK(packet_.path_id != kInvalidPathId); | 602   DCHECK(packet_.path_id != kInvalidPathId); | 
| 604   // Send path in packet if current path is not the default path. | 603   // Send path in packet if current path is not the default path. | 
| 605   send_path_id_in_packet_ = packet_.path_id != kDefaultPathId ? true : false; | 604   send_path_id_in_packet_ = packet_.path_id != kDefaultPathId ? true : false; | 
| 606   // Switching path needs to update packet number length. | 605   // Switching path needs to update packet number length. | 
| 607   UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight); | 606   UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight); | 
| 608 } | 607 } | 
| 609 | 608 | 
| 610 }  // namespace net | 609 }  // namespace net | 
| OLD | NEW | 
|---|