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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } | 155 } |
156 | 156 |
157 QuicVersion QuicTagToQuicVersion(const QuicTag version_tag) { | 157 QuicVersion QuicTagToQuicVersion(const QuicTag version_tag) { |
158 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { | 158 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { |
159 if (version_tag == QuicVersionToQuicTag(kSupportedQuicVersions[i])) { | 159 if (version_tag == QuicVersionToQuicTag(kSupportedQuicVersions[i])) { |
160 return kSupportedQuicVersions[i]; | 160 return kSupportedQuicVersions[i]; |
161 } | 161 } |
162 } | 162 } |
163 // Reading from the client so this should not be considered an ERROR. | 163 // Reading from the client so this should not be considered an ERROR. |
164 DVLOG(1) << "Unsupported QuicTag version: " | 164 DVLOG(1) << "Unsupported QuicTag version: " |
165 << QuicUtils::TagToString(version_tag); | 165 << QuicUtils::TagToString(version_tag); |
166 return QUIC_VERSION_UNSUPPORTED; | 166 return QUIC_VERSION_UNSUPPORTED; |
167 } | 167 } |
168 | 168 |
169 #define RETURN_STRING_LITERAL(x) \ | 169 #define RETURN_STRING_LITERAL(x) \ |
170 case x: \ | 170 case x: \ |
171 return #x | 171 return #x |
172 | 172 |
173 string QuicVersionToString(const QuicVersion version) { | 173 string QuicVersionToString(const QuicVersion version) { |
174 switch (version) { | 174 switch (version) { |
175 RETURN_STRING_LITERAL(QUIC_VERSION_12); | 175 RETURN_STRING_LITERAL(QUIC_VERSION_12); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 } | 308 } |
309 return os; | 309 return os; |
310 } | 310 } |
311 | 311 |
312 ostream& operator<<(ostream& os, const QuicAckFrame& ack_frame) { | 312 ostream& operator<<(ostream& os, const QuicAckFrame& ack_frame) { |
313 os << "sent info { " << ack_frame.sent_info << " } " | 313 os << "sent info { " << ack_frame.sent_info << " } " |
314 << "received info { " << ack_frame.received_info << " }\n"; | 314 << "received info { " << ack_frame.received_info << " }\n"; |
315 return os; | 315 return os; |
316 } | 316 } |
317 | 317 |
| 318 ostream& operator<<(ostream& os, const QuicStreamFrame& stream_frame) { |
| 319 os << "stream_id { " << stream_frame.stream_id << " } " |
| 320 << "fin { " << stream_frame.fin << " } " |
| 321 << "offset { " << stream_frame.offset << " } " |
| 322 << "data { " |
| 323 << QuicUtils::StringToHexASCIIDump(*(stream_frame.GetDataAsString())) |
| 324 << " }\n"; |
| 325 return os; |
| 326 } |
| 327 |
| 328 ostream& operator<<(ostream& os, const QuicRstStreamFrame& rst_frame) { |
| 329 os << "stream_id { " << rst_frame.stream_id << " } " |
| 330 << "error_code { " << rst_frame.error_code << " } " |
| 331 << "error_details { " << rst_frame.error_details << " }\n"; |
| 332 return os; |
| 333 } |
| 334 |
318 CongestionFeedbackMessageFixRate::CongestionFeedbackMessageFixRate() | 335 CongestionFeedbackMessageFixRate::CongestionFeedbackMessageFixRate() |
319 : bitrate(QuicBandwidth::Zero()) { | 336 : bitrate(QuicBandwidth::Zero()) { |
320 } | 337 } |
321 | 338 |
322 CongestionFeedbackMessageInterArrival:: | 339 CongestionFeedbackMessageInterArrival:: |
323 CongestionFeedbackMessageInterArrival() {} | 340 CongestionFeedbackMessageInterArrival() {} |
324 | 341 |
325 CongestionFeedbackMessageInterArrival:: | 342 CongestionFeedbackMessageInterArrival:: |
326 ~CongestionFeedbackMessageInterArrival() {} | 343 ~CongestionFeedbackMessageInterArrival() {} |
327 | 344 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 return os; | 481 return os; |
465 } | 482 } |
466 | 483 |
467 ostream& operator<<(ostream& os, const QuicConsumedData& s) { | 484 ostream& operator<<(ostream& os, const QuicConsumedData& s) { |
468 os << "bytes_consumed: " << s.bytes_consumed | 485 os << "bytes_consumed: " << s.bytes_consumed |
469 << " fin_consumed: " << s.fin_consumed; | 486 << " fin_consumed: " << s.fin_consumed; |
470 return os; | 487 return os; |
471 } | 488 } |
472 | 489 |
473 } // namespace net | 490 } // namespace net |
OLD | NEW |