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_SPDY_SPDY_FRAMER_H_ | 5 #ifndef NET_SPDY_SPDY_FRAMER_H_ |
6 #define NET_SPDY_SPDY_FRAMER_H_ | 6 #define NET_SPDY_SPDY_FRAMER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 size_t GetContinuationMinimumSize() const; | 543 size_t GetContinuationMinimumSize() const; |
544 size_t GetAltSvcMinimumSize() const; | 544 size_t GetAltSvcMinimumSize() const; |
545 size_t GetPrioritySize() const; | 545 size_t GetPrioritySize() const; |
546 | 546 |
547 // Returns the minimum size a frame can be (data or control). | 547 // Returns the minimum size a frame can be (data or control). |
548 size_t GetFrameMinimumSize() const; | 548 size_t GetFrameMinimumSize() const; |
549 | 549 |
550 // Returns the maximum size a frame can be (data or control). | 550 // Returns the maximum size a frame can be (data or control). |
551 size_t GetFrameMaximumSize() const; | 551 size_t GetFrameMaximumSize() const; |
552 | 552 |
553 // Returns the maximum size that a control frame can be. | |
554 size_t GetControlFrameMaximumSize() const; | |
555 | |
556 // Returns the maximum payload size of a DATA frame. | 553 // Returns the maximum payload size of a DATA frame. |
557 size_t GetDataFrameMaximumPayload() const; | 554 size_t GetDataFrameMaximumPayload() const; |
558 | 555 |
559 // Returns the prefix length for the given frame type. | 556 // Returns the prefix length for the given frame type. |
560 size_t GetPrefixLength(SpdyFrameType type) const; | 557 size_t GetPrefixLength(SpdyFrameType type) const; |
561 | 558 |
562 // For debugging. | 559 // For debugging. |
563 static const char* StateToString(int state); | 560 static const char* StateToString(int state); |
564 static const char* ErrorCodeToString(int error_code); | 561 static const char* ErrorCodeToString(int error_code); |
565 static const char* StatusCodeToString(int status_code); | 562 static const char* StatusCodeToString(int status_code); |
566 static const char* FrameTypeToString(SpdyFrameType type); | 563 static const char* FrameTypeToString(SpdyFrameType type); |
567 | 564 |
568 SpdyMajorVersion protocol_version() const { return protocol_version_; } | 565 SpdyMajorVersion protocol_version() const { return protocol_version_; } |
569 | 566 |
570 bool probable_http_response() const { return probable_http_response_; } | 567 bool probable_http_response() const { return probable_http_response_; } |
571 | 568 |
572 SpdyStreamId expect_continuation() const { return expect_continuation_; } | |
573 | |
574 SpdyPriority GetLowestPriority() const { | 569 SpdyPriority GetLowestPriority() const { |
575 return protocol_version_ < SPDY3 ? 3 : 7; | 570 return protocol_version_ < SPDY3 ? 3 : 7; |
576 } | 571 } |
577 | 572 |
578 SpdyPriority GetHighestPriority() const { return 0; } | 573 SpdyPriority GetHighestPriority() const { return 0; } |
579 | 574 |
580 // Interpolates SpdyPriority values into SPDY4/HTTP2 priority weights, | 575 // Interpolates SpdyPriority values into SPDY4/HTTP2 priority weights, |
581 // and vice versa. | 576 // and vice versa. |
582 static uint8 MapPriorityToWeight(SpdyPriority priority); | 577 static uint8 MapPriorityToWeight(SpdyPriority priority); |
583 static SpdyPriority MapWeightToPriority(uint8 weight); | 578 static SpdyPriority MapWeightToPriority(uint8 weight); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 // If a HEADERS frame is followed by a CONTINUATION frame, the FIN/END_STREAM | 796 // If a HEADERS frame is followed by a CONTINUATION frame, the FIN/END_STREAM |
802 // flag is still carried in the HEADERS frame. If it's set, flip this so that | 797 // flag is still carried in the HEADERS frame. If it's set, flip this so that |
803 // we know to terminate the stream when the entire header block has been | 798 // we know to terminate the stream when the entire header block has been |
804 // processed. | 799 // processed. |
805 bool end_stream_when_done_; | 800 bool end_stream_when_done_; |
806 }; | 801 }; |
807 | 802 |
808 } // namespace net | 803 } // namespace net |
809 | 804 |
810 #endif // NET_SPDY_SPDY_FRAMER_H_ | 805 #endif // NET_SPDY_SPDY_FRAMER_H_ |
OLD | NEW |