| Index: net/spdy/spdy_frame_builder.cc
|
| diff --git a/net/spdy/spdy_frame_builder.cc b/net/spdy/spdy_frame_builder.cc
|
| index fc37c0b4a290d534859b425a822ee3392d7418d3..a7eb91d71ce8199d9e68b08831340d5580045670 100644
|
| --- a/net/spdy/spdy_frame_builder.cc
|
| +++ b/net/spdy/spdy_frame_builder.cc
|
| @@ -62,13 +62,14 @@ bool SpdyFrameBuilder::Seek(size_t length) {
|
| bool SpdyFrameBuilder::WriteControlFrameHeader(const SpdyFramer& framer,
|
| SpdyFrameType type,
|
| uint8 flags) {
|
| - DCHECK_GT(4, framer.protocol_version());
|
| + DCHECK_GE(SPDY3, version_);
|
| DCHECK_NE(-1,
|
| - SpdyConstants::SerializeFrameType(framer.protocol_version(), type));
|
| + SpdyConstants::SerializeFrameType(version_, type));
|
| bool success = true;
|
| FlagsAndLength flags_length = CreateFlagsAndLength(
|
| flags, capacity_ - framer.GetControlFrameHeaderSize());
|
| - success &= WriteUInt16(kControlFlagMask | framer.protocol_version());
|
| + success &= WriteUInt16(kControlFlagMask |
|
| + SpdyConstants::SerializeMajorVersion(version_));
|
| success &= WriteUInt16(
|
| SpdyConstants::SerializeFrameType(framer.protocol_version(), type));
|
| success &= WriteBytes(&flags_length, sizeof(flags_length));
|
| @@ -79,7 +80,7 @@ bool SpdyFrameBuilder::WriteControlFrameHeader(const SpdyFramer& framer,
|
| bool SpdyFrameBuilder::WriteDataFrameHeader(const SpdyFramer& framer,
|
| SpdyStreamId stream_id,
|
| uint8 flags) {
|
| - if (framer.protocol_version() >= 4) {
|
| + if (version_ > SPDY3) {
|
| return BeginNewFrame(framer, DATA, flags, stream_id);
|
| }
|
| DCHECK_EQ(0u, stream_id & ~kStreamIdMask);
|
| @@ -103,8 +104,7 @@ bool SpdyFrameBuilder::BeginNewFrame(const SpdyFramer& framer,
|
| DCHECK(SpdyConstants::IsValidFrameType(version_,
|
| SpdyConstants::SerializeFrameType(version_, type)));
|
| DCHECK_EQ(0u, stream_id & ~kStreamIdMask);
|
| - DCHECK_LE(4, version_);
|
| -
|
| + DCHECK_LT(SPDY3, framer.protocol_version());
|
| bool success = true;
|
| if (length_ > 0) {
|
| // Update length field for previous frame.
|
| @@ -168,7 +168,7 @@ bool SpdyFrameBuilder::RewriteLength(const SpdyFramer& framer) {
|
|
|
| bool SpdyFrameBuilder::OverwriteLength(const SpdyFramer& framer,
|
| size_t length) {
|
| - if (version_ < 4) {
|
| + if (version_ <= SPDY3) {
|
| DCHECK_GE(SpdyConstants::GetFrameMaximumSize(version_) -
|
| framer.GetFrameMinimumSize(),
|
| length);
|
| @@ -178,7 +178,7 @@ bool SpdyFrameBuilder::OverwriteLength(const SpdyFramer& framer,
|
| bool success = false;
|
| const size_t old_length = length_;
|
|
|
| - if (version_ < 4) {
|
| + if (version_ <= SPDY3) {
|
| FlagsAndLength flags_length = CreateFlagsAndLength(
|
| 0, // We're not writing over the flags value anyway.
|
| length);
|
| @@ -198,7 +198,7 @@ bool SpdyFrameBuilder::OverwriteLength(const SpdyFramer& framer,
|
|
|
| bool SpdyFrameBuilder::OverwriteFlags(const SpdyFramer& framer,
|
| uint8 flags) {
|
| - DCHECK_LE(SPDY4, framer.protocol_version());
|
| + DCHECK_LT(SPDY3, framer.protocol_version());
|
| bool success = false;
|
| const size_t old_length = length_;
|
| // Flags are the fourth octet in the frame prefix.
|
|
|