| 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 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
| 7 | 7 |
| 8 using base::StringPiece; | 8 using base::StringPiece; |
| 9 using std::map; | 9 using std::map; |
| 10 using std::numeric_limits; | 10 using std::numeric_limits; |
| 11 using std::ostream; | 11 using std::ostream; |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 ostream& operator<<(ostream& os, const QuicConsumedData& s) { |
| 16 os << "bytes_consumed: " << s.bytes_consumed |
| 17 << " fin_consumed: " << s.fin_consumed; |
| 18 return os; |
| 19 } |
| 20 |
| 15 QuicStreamFrame::QuicStreamFrame() {} | 21 QuicStreamFrame::QuicStreamFrame() {} |
| 16 | 22 |
| 17 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, | 23 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, |
| 18 bool fin, | 24 bool fin, |
| 19 uint64 offset, | 25 uint64 offset, |
| 20 StringPiece data) | 26 StringPiece data) |
| 21 : stream_id(stream_id), | 27 : stream_id(stream_id), |
| 22 fin(fin), | 28 fin(fin), |
| 23 offset(offset), | 29 offset(offset), |
| 24 data(data) { | 30 data(data) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 QuicPacketSequenceNumber least_unacked) { | 78 QuicPacketSequenceNumber least_unacked) { |
| 73 for (QuicPacketSequenceNumber seq_num = 1; | 79 for (QuicPacketSequenceNumber seq_num = 1; |
| 74 seq_num <= largest_observed; ++seq_num) { | 80 seq_num <= largest_observed; ++seq_num) { |
| 75 received_info.RecordReceived(seq_num); | 81 received_info.RecordReceived(seq_num); |
| 76 } | 82 } |
| 77 received_info.largest_observed = largest_observed; | 83 received_info.largest_observed = largest_observed; |
| 78 sent_info.least_unacked = least_unacked; | 84 sent_info.least_unacked = least_unacked; |
| 79 } | 85 } |
| 80 | 86 |
| 81 ostream& operator<<(ostream& os, const SentPacketInfo& sent_info) { | 87 ostream& operator<<(ostream& os, const SentPacketInfo& sent_info) { |
| 82 os << "least_waiting: " << sent_info.least_unacked; | 88 os << "least_unacked: " << sent_info.least_unacked; |
| 83 return os; | 89 return os; |
| 84 } | 90 } |
| 85 | 91 |
| 86 ostream& operator<<(ostream& os, const ReceivedPacketInfo& received_info) { | 92 ostream& operator<<(ostream& os, const ReceivedPacketInfo& received_info) { |
| 87 os << "largest_observed: " | 93 os << "largest_observed: " |
| 88 << received_info.largest_observed | 94 << received_info.largest_observed |
| 89 << " missing_packets: [ "; | 95 << " missing_packets: [ "; |
| 90 for (SequenceSet::const_iterator it = received_info.missing_packets.begin(); | 96 for (SequenceSet::const_iterator it = received_info.missing_packets.begin(); |
| 91 it != received_info.missing_packets.end(); ++it) { | 97 it != received_info.missing_packets.end(); ++it) { |
| 92 os << *it << " "; | 98 os << *it << " "; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 172 } |
| 167 return true; | 173 return true; |
| 168 } | 174 } |
| 169 | 175 |
| 170 QuicData::~QuicData() { | 176 QuicData::~QuicData() { |
| 171 if (owns_buffer_) { | 177 if (owns_buffer_) { |
| 172 delete [] const_cast<char*>(buffer_); | 178 delete [] const_cast<char*>(buffer_); |
| 173 } | 179 } |
| 174 } | 180 } |
| 175 | 181 |
| 182 ostream& operator<<(ostream& os, const QuicEncryptedPacket& s) { |
| 183 os << s.length() << "-byte data"; |
| 184 return os; |
| 185 } |
| 186 |
| 176 } // namespace net | 187 } // namespace net |
| OLD | NEW |