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 // This file contains some protocol structures for use with SPDY 3 and HTTP 2 | 5 // This file contains some protocol structures for use with SPDY 3 and HTTP 2 |
6 // The SPDY 3 spec can be found at: | 6 // The SPDY 3 spec can be found at: |
7 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3 | 7 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3 |
8 | 8 |
9 #ifndef NET_SPDY_SPDY_PROTOCOL_H_ | 9 #ifndef NET_SPDY_SPDY_PROTOCOL_H_ |
10 #define NET_SPDY_SPDY_PROTOCOL_H_ | 10 #define NET_SPDY_SPDY_PROTOCOL_H_ |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 // 15 bit version field for SPDY/3 frames. | 43 // 15 bit version field for SPDY/3 frames. |
44 const uint16_t kSpdy3Version = 3; | 44 const uint16_t kSpdy3Version = 3; |
45 | 45 |
46 // A SPDY stream id is a 31 bit entity. | 46 // A SPDY stream id is a 31 bit entity. |
47 typedef uint32_t SpdyStreamId; | 47 typedef uint32_t SpdyStreamId; |
48 | 48 |
49 // Specifies the stream ID used to denote the current session (for | 49 // Specifies the stream ID used to denote the current session (for |
50 // flow control). | 50 // flow control). |
51 const SpdyStreamId kSessionFlowControlStreamId = 0; | 51 const SpdyStreamId kSessionFlowControlStreamId = 0; |
52 | 52 |
53 // The maxmium possible frame payload size allowed by the spec. | 53 // The maxmium possible frame payload size allowed by the spec. |
Bence
2016/07/08 20:19:01
Please fix this typo: this is part of change 12643
| |
54 const uint32_t kSpdyMaxFrameSizeLimit = (1 << 24) - 1; | 54 const uint32_t kSpdyMaxFrameSizeLimit = (1 << 24) - 1; |
55 | 55 |
56 // The initial value for the maximum frame payload size as per the spec. This is | 56 // The initial value for the maximum frame payload size as per the spec. This is |
57 // the maximum control frame size we accept. | 57 // the maximum control frame size we accept. |
58 const uint32_t kSpdyInitialFrameSizeLimit = 1 << 14; | 58 const uint32_t kSpdyInitialFrameSizeLimit = 1 << 14; |
59 | 59 |
60 // The initial value for the maximum size of the header list, "unlimited" (max | 60 // The initial value for the maximum size of the header list, "unlimited" (max |
61 // unsigned 32-bit int) as per the spec. | 61 // unsigned 32-bit int) as per the spec. |
62 const uint32_t kSpdyInitialHeaderListSizeLimit = 0xFFFFFFFF; | 62 const uint32_t kSpdyInitialHeaderListSizeLimit = 0xFFFFFFFF; |
63 | 63 |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
525 // the given protocol version. | 525 // the given protocol version. |
526 // Returns -1 on failure (I.E. Invalid GOAWAY status for the given version). | 526 // Returns -1 on failure (I.E. Invalid GOAWAY status for the given version). |
527 static int SerializeGoAwayStatus(SpdyMajorVersion version, | 527 static int SerializeGoAwayStatus(SpdyMajorVersion version, |
528 SpdyGoAwayStatus status); | 528 SpdyGoAwayStatus status); |
529 | 529 |
530 // Size, in bytes, of the data frame header. Future versions of SPDY | 530 // Size, in bytes, of the data frame header. Future versions of SPDY |
531 // will likely vary this, so we allow for the flexibility of a function call | 531 // will likely vary this, so we allow for the flexibility of a function call |
532 // for this value as opposed to a constant. | 532 // for this value as opposed to a constant. |
533 static size_t GetDataFrameMinimumSize(SpdyMajorVersion version); | 533 static size_t GetDataFrameMinimumSize(SpdyMajorVersion version); |
534 | 534 |
535 // Number of octets in the frame header | |
536 static size_t GetFrameHeaderSize(SpdyMajorVersion version); | |
537 | |
535 // Size, in bytes, of the control frame header. | 538 // Size, in bytes, of the control frame header. |
536 static size_t GetControlFrameHeaderSize(SpdyMajorVersion version); | 539 static size_t GetControlFrameHeaderSize(SpdyMajorVersion version); |
537 | 540 |
538 static size_t GetPrefixLength(SpdyFrameType type, SpdyMajorVersion version); | 541 static size_t GetPrefixLength(SpdyFrameType type, SpdyMajorVersion version); |
539 | 542 |
540 static size_t GetFrameMaximumSize(SpdyMajorVersion version); | 543 // Maximum possible configurable size of a frame in octets. |
544 static size_t GetMaxFrameSizeLimit(SpdyMajorVersion version); | |
541 | 545 |
542 // Returns the size of a header block size field. Valid only for SPDY 3. | 546 // Returns the size of a header block size field. Valid only for SPDY 3. |
543 static size_t GetSizeOfSizeField(); | 547 static size_t GetSizeOfSizeField(); |
544 | 548 |
545 // Returns the per-header overhead for block size accounting in bytes. | 549 // Returns the per-header overhead for block size accounting in bytes. |
546 static size_t GetPerHeaderOverhead(SpdyMajorVersion version); | 550 static size_t GetPerHeaderOverhead(SpdyMajorVersion version); |
547 | 551 |
548 // Returns the size (in bytes) of a wire setting ID and value. | 552 // Returns the size (in bytes) of a wire setting ID and value. |
549 static size_t GetSettingSize(SpdyMajorVersion version); | 553 static size_t GetSettingSize(SpdyMajorVersion version); |
550 | 554 |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1230 SpdyFrameVisitor() {} | 1234 SpdyFrameVisitor() {} |
1231 virtual ~SpdyFrameVisitor() {} | 1235 virtual ~SpdyFrameVisitor() {} |
1232 | 1236 |
1233 private: | 1237 private: |
1234 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor); | 1238 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor); |
1235 }; | 1239 }; |
1236 | 1240 |
1237 } // namespace net | 1241 } // namespace net |
1238 | 1242 |
1239 #endif // NET_SPDY_SPDY_PROTOCOL_H_ | 1243 #endif // NET_SPDY_SPDY_PROTOCOL_H_ |
OLD | NEW |