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_protocol.h" | 5 #include "net/quic/quic_protocol.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/quic_utils.h" | 8 #include "net/quic/quic_utils.h" |
9 | 9 |
10 using base::StringPiece; | 10 using base::StringPiece; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 QuicPublicResetPacket::QuicPublicResetPacket() | 94 QuicPublicResetPacket::QuicPublicResetPacket() |
95 : nonce_proof(0), | 95 : nonce_proof(0), |
96 rejected_sequence_number(0) {} | 96 rejected_sequence_number(0) {} |
97 | 97 |
98 QuicPublicResetPacket::QuicPublicResetPacket( | 98 QuicPublicResetPacket::QuicPublicResetPacket( |
99 const QuicPacketPublicHeader& header) | 99 const QuicPacketPublicHeader& header) |
100 : public_header(header), | 100 : public_header(header), |
101 nonce_proof(0), | 101 nonce_proof(0), |
102 rejected_sequence_number(0) {} | 102 rejected_sequence_number(0) {} |
103 | 103 |
104 QuicStreamFrame::QuicStreamFrame() | 104 QuicStreamFrame::QuicStreamFrame() : stream_id(0), fin(false), offset(0) { |
105 : stream_id(0), | 105 } |
106 fin(false), | |
107 offset(0), | |
108 notifier(nullptr) {} | |
109 | 106 |
110 QuicStreamFrame::QuicStreamFrame(const QuicStreamFrame& frame) | 107 QuicStreamFrame::QuicStreamFrame(const QuicStreamFrame& frame) |
111 : stream_id(frame.stream_id), | 108 : stream_id(frame.stream_id), |
112 fin(frame.fin), | 109 fin(frame.fin), |
113 offset(frame.offset), | 110 offset(frame.offset), |
114 data(frame.data), | 111 data(frame.data) { |
115 notifier(frame.notifier) { | |
116 } | 112 } |
117 | 113 |
118 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, | 114 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, |
119 bool fin, | 115 bool fin, |
120 QuicStreamOffset offset, | 116 QuicStreamOffset offset, |
121 IOVector data) | 117 IOVector data) |
122 : stream_id(stream_id), | 118 : stream_id(stream_id), fin(fin), offset(offset), data(data) { |
123 fin(fin), | 119 } |
124 offset(offset), | |
125 data(data), | |
126 notifier(nullptr) {} | |
127 | 120 |
128 string* QuicStreamFrame::GetDataAsString() const { | 121 string* QuicStreamFrame::GetDataAsString() const { |
129 string* data_string = new string(); | 122 string* data_string = new string(); |
130 data_string->reserve(data.TotalBufferSize()); | 123 data_string->reserve(data.TotalBufferSize()); |
131 for (size_t i = 0; i < data.Size(); ++i) { | 124 for (size_t i = 0; i < data.Size(); ++i) { |
132 data_string->append(static_cast<char*>(data.iovec()[i].iov_base), | 125 data_string->append(static_cast<char*>(data.iovec()[i].iov_base), |
133 data.iovec()[i].iov_len); | 126 data.iovec()[i].iov_len); |
134 } | 127 } |
135 DCHECK_EQ(data_string->size(), data.TotalBufferSize()); | 128 DCHECK_EQ(data_string->size(), data.TotalBufferSize()); |
136 return data_string; | 129 return data_string; |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 TransmissionInfo::TransmissionInfo() | 645 TransmissionInfo::TransmissionInfo() |
653 : retransmittable_frames(nullptr), | 646 : retransmittable_frames(nullptr), |
654 sequence_number_length(PACKET_1BYTE_SEQUENCE_NUMBER), | 647 sequence_number_length(PACKET_1BYTE_SEQUENCE_NUMBER), |
655 sent_time(QuicTime::Zero()), | 648 sent_time(QuicTime::Zero()), |
656 bytes_sent(0), | 649 bytes_sent(0), |
657 nack_count(0), | 650 nack_count(0), |
658 transmission_type(NOT_RETRANSMISSION), | 651 transmission_type(NOT_RETRANSMISSION), |
659 all_transmissions(nullptr), | 652 all_transmissions(nullptr), |
660 in_flight(false), | 653 in_flight(false), |
661 is_unackable(false), | 654 is_unackable(false), |
662 is_fec_packet(false) {} | 655 is_fec_packet(false) { |
| 656 } |
663 | 657 |
664 TransmissionInfo::TransmissionInfo( | 658 TransmissionInfo::TransmissionInfo( |
665 RetransmittableFrames* retransmittable_frames, | 659 RetransmittableFrames* retransmittable_frames, |
666 QuicSequenceNumberLength sequence_number_length, | 660 QuicSequenceNumberLength sequence_number_length, |
667 TransmissionType transmission_type, | 661 TransmissionType transmission_type, |
668 QuicTime sent_time) | 662 QuicTime sent_time, |
| 663 QuicByteCount bytes_sent, |
| 664 bool is_fec_packet) |
669 : retransmittable_frames(retransmittable_frames), | 665 : retransmittable_frames(retransmittable_frames), |
670 sequence_number_length(sequence_number_length), | 666 sequence_number_length(sequence_number_length), |
671 sent_time(sent_time), | 667 sent_time(sent_time), |
672 bytes_sent(0), | 668 bytes_sent(bytes_sent), |
673 nack_count(0), | 669 nack_count(0), |
674 transmission_type(transmission_type), | 670 transmission_type(transmission_type), |
675 all_transmissions(nullptr), | 671 all_transmissions(nullptr), |
676 in_flight(false), | 672 in_flight(false), |
677 is_unackable(false), | 673 is_unackable(false), |
678 is_fec_packet(false) {} | 674 is_fec_packet(is_fec_packet) { |
| 675 } |
679 | 676 |
680 } // namespace net | 677 } // namespace net |
OLD | NEW |