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 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ | 5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ |
6 #define NET_QUIC_QUIC_PROTOCOL_H_ | 6 #define NET_QUIC_QUIC_PROTOCOL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 }; | 530 }; |
531 | 531 |
532 struct NET_EXPORT_PRIVATE QuicStreamFrame { | 532 struct NET_EXPORT_PRIVATE QuicStreamFrame { |
533 QuicStreamFrame(); | 533 QuicStreamFrame(); |
534 QuicStreamFrame(const QuicStreamFrame& frame); | 534 QuicStreamFrame(const QuicStreamFrame& frame); |
535 QuicStreamFrame(QuicStreamId stream_id, | 535 QuicStreamFrame(QuicStreamId stream_id, |
536 bool fin, | 536 bool fin, |
537 QuicStreamOffset offset, | 537 QuicStreamOffset offset, |
538 IOVector data); | 538 IOVector data); |
539 | 539 |
| 540 NET_EXPORT_PRIVATE friend std::ostream& operator<<( |
| 541 std::ostream& os, const QuicStreamFrame& s); |
| 542 |
540 // Returns a copy of the IOVector |data| as a heap-allocated string. | 543 // Returns a copy of the IOVector |data| as a heap-allocated string. |
541 // Caller must take ownership of the returned string. | 544 // Caller must take ownership of the returned string. |
542 std::string* GetDataAsString() const; | 545 std::string* GetDataAsString() const; |
543 | 546 |
544 QuicStreamId stream_id; | 547 QuicStreamId stream_id; |
545 bool fin; | 548 bool fin; |
546 QuicStreamOffset offset; // Location of this data in the stream. | 549 QuicStreamOffset offset; // Location of this data in the stream. |
547 IOVector data; | 550 IOVector data; |
548 | 551 |
549 // If this is set, then when this packet is ACKed the AckNotifier will be | 552 // If this is set, then when this packet is ACKed the AckNotifier will be |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 CongestionFeedbackMessageFixRate fix_rate; | 677 CongestionFeedbackMessageFixRate fix_rate; |
675 }; | 678 }; |
676 | 679 |
677 struct NET_EXPORT_PRIVATE QuicRstStreamFrame { | 680 struct NET_EXPORT_PRIVATE QuicRstStreamFrame { |
678 QuicRstStreamFrame() {} | 681 QuicRstStreamFrame() {} |
679 QuicRstStreamFrame(QuicStreamId stream_id, QuicRstStreamErrorCode error_code) | 682 QuicRstStreamFrame(QuicStreamId stream_id, QuicRstStreamErrorCode error_code) |
680 : stream_id(stream_id), error_code(error_code) { | 683 : stream_id(stream_id), error_code(error_code) { |
681 DCHECK_LE(error_code, std::numeric_limits<uint8>::max()); | 684 DCHECK_LE(error_code, std::numeric_limits<uint8>::max()); |
682 } | 685 } |
683 | 686 |
| 687 NET_EXPORT_PRIVATE friend std::ostream& operator<<( |
| 688 std::ostream& os, const QuicRstStreamFrame& s); |
| 689 |
684 QuicStreamId stream_id; | 690 QuicStreamId stream_id; |
685 QuicRstStreamErrorCode error_code; | 691 QuicRstStreamErrorCode error_code; |
686 std::string error_details; | 692 std::string error_details; |
687 }; | 693 }; |
688 | 694 |
689 struct NET_EXPORT_PRIVATE QuicConnectionCloseFrame { | 695 struct NET_EXPORT_PRIVATE QuicConnectionCloseFrame { |
690 QuicErrorCode error_code; | 696 QuicErrorCode error_code; |
691 std::string error_details; | 697 std::string error_details; |
692 }; | 698 }; |
693 | 699 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 WriteStatus status; | 965 WriteStatus status; |
960 union { | 966 union { |
961 int bytes_written; // only valid when status is OK | 967 int bytes_written; // only valid when status is OK |
962 int error_code; // only valid when status is ERROR | 968 int error_code; // only valid when status is ERROR |
963 }; | 969 }; |
964 }; | 970 }; |
965 | 971 |
966 } // namespace net | 972 } // namespace net |
967 | 973 |
968 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 974 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |