| Index: net/spdy/spdy_protocol.cc
|
| diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc
|
| index a5445b7c8ec7c2e80762832ce7f6d0d54e52a949..2069f8e1aeccb45f39f27d47f4cdb57f5d734868 100644
|
| --- a/net/spdy/spdy_protocol.cc
|
| +++ b/net/spdy/spdy_protocol.cc
|
| @@ -603,6 +603,40 @@ int SpdyConstants::SerializeGoAwayStatus(SpdyMajorVersion version,
|
| }
|
| }
|
|
|
| +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);
|
| }
|
|
|