blob: 9ec0f39be72951d3f595fa5f4f32cdd7f7843e4c [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// 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
QUICHE team5be974e2020-12-29 18:35:24 -05005#include "quic/core/quic_transmission_info.h"
wub662ecf22020-12-08 07:43:28 -08006#include "absl/strings/str_cat.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -05007
8namespace quic {
9
10QuicTransmissionInfo::QuicTransmissionInfo()
haoyuewang344e1702020-10-27 07:45:59 -070011 : sent_time(QuicTime::Zero()),
QUICHE teama6ef0a62019-03-07 20:34:33 -050012 bytes_sent(0),
haoyuewang344e1702020-10-27 07:45:59 -070013 encryption_level(ENCRYPTION_INITIAL),
QUICHE teama6ef0a62019-03-07 20:34:33 -050014 transmission_type(NOT_RETRANSMISSION),
15 in_flight(false),
16 state(OUTSTANDING),
haoyuewang5b0f14f2020-09-18 14:31:54 -070017 has_crypto_handshake(false),
18 has_ack_frequency(false) {}
QUICHE teama6ef0a62019-03-07 20:34:33 -050019
fayang88b87232020-06-24 15:31:08 -070020QuicTransmissionInfo::QuicTransmissionInfo(EncryptionLevel level,
21 TransmissionType transmission_type,
22 QuicTime sent_time,
23 QuicPacketLength bytes_sent,
haoyuewang5b0f14f2020-09-18 14:31:54 -070024 bool has_crypto_handshake,
25 bool has_ack_frequency)
haoyuewang344e1702020-10-27 07:45:59 -070026 : sent_time(sent_time),
QUICHE teama6ef0a62019-03-07 20:34:33 -050027 bytes_sent(bytes_sent),
haoyuewang344e1702020-10-27 07:45:59 -070028 encryption_level(level),
QUICHE teama6ef0a62019-03-07 20:34:33 -050029 transmission_type(transmission_type),
30 in_flight(false),
31 state(OUTSTANDING),
haoyuewang5b0f14f2020-09-18 14:31:54 -070032 has_crypto_handshake(has_crypto_handshake),
33 has_ack_frequency(has_ack_frequency) {}
QUICHE teama6ef0a62019-03-07 20:34:33 -050034
35QuicTransmissionInfo::QuicTransmissionInfo(const QuicTransmissionInfo& other) =
36 default;
37
38QuicTransmissionInfo::~QuicTransmissionInfo() {}
39
wub662ecf22020-12-08 07:43:28 -080040std::string QuicTransmissionInfo::DebugString() const {
41 return absl::StrCat(
42 "{sent_time: ", sent_time.ToDebuggingValue(),
43 ", bytes_sent: ", bytes_sent,
44 ", encryption_level: ", EncryptionLevelToString(encryption_level),
45 ", transmission_type: ", TransmissionTypeToString(transmission_type),
46 ", in_flight: ", in_flight, ", state: ", state,
47 ", has_crypto_handshake: ", has_crypto_handshake,
48 ", has_ack_frequency: ", has_ack_frequency,
49 ", first_sent_after_loss: ", first_sent_after_loss.ToString(),
50 ", largest_acked: ", largest_acked.ToString(),
51 ", retransmittable_frames: ", QuicFramesToString(retransmittable_frames),
52 "}");
53}
54
QUICHE teama6ef0a62019-03-07 20:34:33 -050055} // namespace quic