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 2 and 3 | 5 // This file contains some protocol structures for use with SPDY 2 and 3 |
6 // The SPDY 2 spec can be found at: | 6 // The SPDY 2 spec can be found at: |
7 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft2 | 7 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft2 |
8 // The SPDY 3 spec can be found at: | 8 // The SPDY 3 spec can be found at: |
9 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3 | 9 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3 |
10 | 10 |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 // Behavior is undefined for invalid GOAWAY status fields; consumers should | 471 // Behavior is undefined for invalid GOAWAY status fields; consumers should |
472 // first use IsValidGoAwayStatus() to verify validity of GOAWAY status fields. | 472 // first use IsValidGoAwayStatus() to verify validity of GOAWAY status fields. |
473 static SpdyGoAwayStatus ParseGoAwayStatus(SpdyMajorVersion version, | 473 static SpdyGoAwayStatus ParseGoAwayStatus(SpdyMajorVersion version, |
474 int goaway_status_field); | 474 int goaway_status_field); |
475 | 475 |
476 // Serializes a given GOAWAY status to the on-the-wire enumeration value for | 476 // Serializes a given GOAWAY status to the on-the-wire enumeration value for |
477 // the given protocol version. | 477 // the given protocol version. |
478 // Returns -1 on failure (I.E. Invalid GOAWAY status for the given version). | 478 // Returns -1 on failure (I.E. Invalid GOAWAY status for the given version). |
479 static int SerializeGoAwayStatus(SpdyMajorVersion version, | 479 static int SerializeGoAwayStatus(SpdyMajorVersion version, |
480 SpdyGoAwayStatus status); | 480 SpdyGoAwayStatus status); |
| 481 |
| 482 // Size, in bytes, of the data frame header. Future versions of SPDY |
| 483 // will likely vary this, so we allow for the flexibility of a function call |
| 484 // for this value as opposed to a constant. |
| 485 static size_t GetDataFrameMinimumSize(); |
| 486 |
| 487 // Size, in bytes, of the control frame header. |
| 488 static size_t GetControlFrameHeaderSize(SpdyMajorVersion version); |
| 489 |
| 490 static size_t GetPrefixLength(SpdyFrameType type, SpdyMajorVersion version); |
| 491 |
| 492 static size_t GetFrameMaximumSize(SpdyMajorVersion version); |
481 }; | 493 }; |
482 | 494 |
483 class SpdyFrame; | 495 class SpdyFrame; |
484 typedef SpdyFrame SpdySerializedFrame; | 496 typedef SpdyFrame SpdySerializedFrame; |
485 | 497 |
486 class SpdyFrameVisitor; | 498 class SpdyFrameVisitor; |
487 | 499 |
488 // Intermediate representation for SPDY frames. | 500 // Intermediate representation for SPDY frames. |
489 // TODO(hkhalil): Rename this class to SpdyFrame when the existing SpdyFrame is | 501 // TODO(hkhalil): Rename this class to SpdyFrame when the existing SpdyFrame is |
490 // gone. | 502 // gone. |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 SpdyFrameVisitor() {} | 977 SpdyFrameVisitor() {} |
966 virtual ~SpdyFrameVisitor() {} | 978 virtual ~SpdyFrameVisitor() {} |
967 | 979 |
968 private: | 980 private: |
969 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor); | 981 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor); |
970 }; | 982 }; |
971 | 983 |
972 } // namespace net | 984 } // namespace net |
973 | 985 |
974 #endif // NET_SPDY_SPDY_PROTOCOL_H_ | 986 #endif // NET_SPDY_SPDY_PROTOCOL_H_ |
OLD | NEW |