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 using base::StringPiece; | 7 using base::StringPiece; |
| 8 using base::hash_set; |
| 9 using std::ostream; |
8 | 10 |
9 namespace net { | 11 namespace net { |
10 | 12 |
11 QuicStreamFrame::QuicStreamFrame() {} | 13 QuicStreamFrame::QuicStreamFrame() {} |
12 | 14 |
13 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, | 15 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, |
14 bool fin, | 16 bool fin, |
15 uint64 offset, | 17 uint64 offset, |
16 StringPiece data) | 18 StringPiece data) |
17 : stream_id(stream_id), | 19 : stream_id(stream_id), |
18 fin(fin), | 20 fin(fin), |
19 offset(offset), | 21 offset(offset), |
20 data(data) { | 22 data(data) { |
21 } | 23 } |
22 | 24 |
23 ReceivedPacketInfo::ReceivedPacketInfo() {} | 25 ReceivedPacketInfo::ReceivedPacketInfo() {} |
24 | 26 |
25 ReceivedPacketInfo::~ReceivedPacketInfo() {} | 27 ReceivedPacketInfo::~ReceivedPacketInfo() {} |
26 | 28 |
27 SentPacketInfo::SentPacketInfo() {} | 29 SentPacketInfo::SentPacketInfo() {} |
28 | 30 |
29 SentPacketInfo::~SentPacketInfo() {} | 31 SentPacketInfo::~SentPacketInfo() {} |
30 | 32 |
| 33 ostream& operator<<(ostream& os, const QuicAckFrame& s) { |
| 34 os << "largest_received: " << s.received_info.largest_received |
| 35 << " time: " << s.received_info.time_received |
| 36 << " missing: "; |
| 37 for (hash_set<QuicPacketSequenceNumber>::const_iterator it = |
| 38 s.received_info.missing_packets.begin(); |
| 39 it != s.received_info.missing_packets.end(); ++it) { |
| 40 os << *it << " "; |
| 41 } |
| 42 |
| 43 os << " least_waiting: " << s.sent_info.least_unacked |
| 44 << " no_retransmit: "; |
| 45 for (hash_set<QuicPacketSequenceNumber>::const_iterator it = |
| 46 s.sent_info.non_retransmiting.begin(); |
| 47 it != s.sent_info.non_retransmiting.end(); ++it) { |
| 48 os << *it << " "; |
| 49 } |
| 50 os << "\n"; |
| 51 return os; |
| 52 } |
| 53 |
31 QuicFecData::QuicFecData() {} | 54 QuicFecData::QuicFecData() {} |
32 | 55 |
| 56 bool QuicFecData::operator==(const QuicFecData& other) const { |
| 57 if (fec_group != other.fec_group) { |
| 58 return false; |
| 59 } |
| 60 if (first_protected_packet_sequence_number != |
| 61 other.first_protected_packet_sequence_number) { |
| 62 return false; |
| 63 } |
| 64 if (redundancy != other.redundancy) { |
| 65 return false; |
| 66 } |
| 67 return true; |
| 68 } |
| 69 |
33 QuicData::~QuicData() { | 70 QuicData::~QuicData() { |
34 if (owns_buffer_) { | 71 if (owns_buffer_) { |
35 delete [] const_cast<char*>(buffer_); | 72 delete [] const_cast<char*>(buffer_); |
36 } | 73 } |
37 } | 74 } |
38 | 75 |
39 } // namespace net | 76 } // namespace net |
OLD | NEW |