xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/quic_transmission_info.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "quiche/quic/core/quic_transmission_info.h"
6 
7 #include "absl/strings/str_cat.h"
8 
9 namespace quic {
10 
QuicTransmissionInfo()11 QuicTransmissionInfo::QuicTransmissionInfo()
12     : sent_time(QuicTime::Zero()),
13       bytes_sent(0),
14       encryption_level(ENCRYPTION_INITIAL),
15       transmission_type(NOT_RETRANSMISSION),
16       in_flight(false),
17       state(OUTSTANDING),
18       has_crypto_handshake(false),
19       has_ack_frequency(false),
20       ecn_codepoint(ECN_NOT_ECT) {}
21 
QuicTransmissionInfo(EncryptionLevel level,TransmissionType transmission_type,QuicTime sent_time,QuicPacketLength bytes_sent,bool has_crypto_handshake,bool has_ack_frequency,QuicEcnCodepoint ecn_codepoint)22 QuicTransmissionInfo::QuicTransmissionInfo(
23     EncryptionLevel level, TransmissionType transmission_type,
24     QuicTime sent_time, QuicPacketLength bytes_sent, bool has_crypto_handshake,
25     bool has_ack_frequency, QuicEcnCodepoint ecn_codepoint)
26     : sent_time(sent_time),
27       bytes_sent(bytes_sent),
28       encryption_level(level),
29       transmission_type(transmission_type),
30       in_flight(false),
31       state(OUTSTANDING),
32       has_crypto_handshake(has_crypto_handshake),
33       has_ack_frequency(has_ack_frequency),
34       ecn_codepoint(ecn_codepoint) {}
35 
36 QuicTransmissionInfo::QuicTransmissionInfo(const QuicTransmissionInfo& other) =
37     default;
38 
~QuicTransmissionInfo()39 QuicTransmissionInfo::~QuicTransmissionInfo() {}
40 
DebugString() const41 std::string QuicTransmissionInfo::DebugString() const {
42   return absl::StrCat(
43       "{sent_time: ", sent_time.ToDebuggingValue(),
44       ", bytes_sent: ", bytes_sent,
45       ", encryption_level: ", EncryptionLevelToString(encryption_level),
46       ", transmission_type: ", TransmissionTypeToString(transmission_type),
47       ", in_flight: ", in_flight, ", state: ", state,
48       ", has_crypto_handshake: ", has_crypto_handshake,
49       ", has_ack_frequency: ", has_ack_frequency,
50       ", first_sent_after_loss: ", first_sent_after_loss.ToString(),
51       ", largest_acked: ", largest_acked.ToString(),
52       ", retransmittable_frames: ", QuicFramesToString(retransmittable_frames),
53       "}");
54 }
55 
56 }  // namespace quic
57