| Index: net/spdy/spdy_protocol.cc
|
| diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc
|
| index 9bf9672d09c16382e8bb2c4c4d445638c13b0606..b46e182bd67ee6e0eae911f11459791a6e991d5c 100644
|
| --- a/net/spdy/spdy_protocol.cc
|
| +++ b/net/spdy/spdy_protocol.cc
|
| @@ -611,6 +611,40 @@ int SpdyConstants::SerializeGoAwayStatus(SpdyMajorVersion version,
|
| return -1;
|
| }
|
|
|
| +size_t SpdyConstants::GetDataFrameMinimumSize() {
|
| + return 8;
|
| +}
|
| +
|
| +size_t SpdyConstants::GetControlFrameHeaderSize(SpdyMajorVersion version) {
|
| + switch (version) {
|
| + case SPDY2:
|
| + case SPDY3:
|
| + case SPDY4:
|
| + return 8;
|
| + }
|
| + LOG(DFATAL) << "Unhandled SPDY version.";
|
| + return 0;
|
| +}
|
| +
|
| +size_t SpdyConstants::GetPrefixLength(SpdyFrameType type,
|
| + SpdyMajorVersion version) {
|
| + if (type != DATA) {
|
| + return GetControlFrameHeaderSize(version);
|
| + } else {
|
| + return GetDataFrameMinimumSize();
|
| + }
|
| +}
|
| +
|
| +size_t SpdyConstants::GetFrameMaximumSize(SpdyMajorVersion version) {
|
| + if (version < SPDY4) {
|
| + // 24-bit length field plus eight-byte frame header.
|
| + return ((1<<24) - 1) + 8;
|
| + } else {
|
| + // 14-bit length field.
|
| + return (1<<14) - 1;
|
| + }
|
| +}
|
| +
|
| void SpdyDataIR::Visit(SpdyFrameVisitor* visitor) const {
|
| return visitor->VisitData(*this);
|
| }
|
|
|