diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-28 06:51:29 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-28 06:51:29 +0000 |
commit | 33c797bc9ed66302ca00eaf0eed00ab84ba13456 (patch) | |
tree | 4aa7cea0fb73a051d45f075f264e8e0375561f42 | |
parent | ac5c0debf658799ad11bb8cf23dad31d024196ee (diff) | |
download | chromium_src-33c797bc9ed66302ca00eaf0eed00ab84ba13456.zip chromium_src-33c797bc9ed66302ca00eaf0eed00ab84ba13456.tar.gz chromium_src-33c797bc9ed66302ca00eaf0eed00ab84ba13456.tar.bz2 |
Rename GetControlFrameMinimumSize() to GetControlFrameHeaderSize() in SpdyFramer
This lands server change 43174857.
Review URL: https://chromiumcodereview.appspot.com/12381008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185170 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/spdy/buffered_spdy_framer.h | 4 | ||||
-rw-r--r-- | net/spdy/spdy_frame_builder.cc | 6 | ||||
-rw-r--r-- | net/spdy/spdy_framer.cc | 56 | ||||
-rw-r--r-- | net/spdy/spdy_framer.h | 2 | ||||
-rw-r--r-- | net/spdy/spdy_framer_test.cc | 28 | ||||
-rw-r--r-- | net/spdy/spdy_network_transaction_spdy2_unittest.cc | 2 | ||||
-rw-r--r-- | net/spdy/spdy_network_transaction_spdy3_unittest.cc | 2 | ||||
-rw-r--r-- | net/spdy/spdy_session.cc | 4 | ||||
-rw-r--r-- | net/spdy/spdy_session_spdy2_unittest.cc | 6 | ||||
-rw-r--r-- | net/spdy/spdy_session_spdy3_unittest.cc | 6 |
10 files changed, 60 insertions, 56 deletions
diff --git a/net/spdy/buffered_spdy_framer.h b/net/spdy/buffered_spdy_framer.h index 3ece787..21a6961 100644 --- a/net/spdy/buffered_spdy_framer.h +++ b/net/spdy/buffered_spdy_framer.h @@ -184,8 +184,8 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramer // Returns the (minimum) size of control frames (sans variable-length // portions). - size_t GetControlFrameMinimumSize() const { - return spdy_framer_.GetControlFrameMinimumSize(); + size_t GetControlFrameHeaderSize() const { + return spdy_framer_.GetControlFrameHeaderSize(); } int frames_received() const { return frames_received_; } diff --git a/net/spdy/spdy_frame_builder.cc b/net/spdy/spdy_frame_builder.cc index 29f365b..957e777 100644 --- a/net/spdy/spdy_frame_builder.cc +++ b/net/spdy/spdy_frame_builder.cc @@ -61,11 +61,11 @@ bool SpdyFrameBuilder::WriteControlFrameHeader(const SpdyFramer& framer, SpdyControlType type, uint8 flags) { FlagsAndLength flags_length = CreateFlagsAndLength( - flags, capacity_ - framer.GetControlFrameMinimumSize()); + flags, capacity_ - framer.GetControlFrameHeaderSize()); bool success = WriteUInt16(kControlFlagMask | framer.protocol_version()); success &= WriteUInt16(type); success &= WriteBytes(&flags_length, sizeof(flags_length)); - DCHECK_EQ(framer.GetControlFrameMinimumSize(), length()); + DCHECK_EQ(framer.GetControlFrameHeaderSize(), length()); return success; } @@ -117,7 +117,7 @@ bool SpdyFrameBuilder::WriteBytes(const void* data, uint32 data_len) { } bool SpdyFrameBuilder::RewriteLength(const SpdyFramer& framer) { - return OverwriteLength(framer, length_ - framer.GetControlFrameMinimumSize()); + return OverwriteLength(framer, length_ - framer.GetControlFrameHeaderSize()); } bool SpdyFrameBuilder::OverwriteLength(const SpdyFramer& framer, diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc index 94f9fb7..c38aa08 100644 --- a/net/spdy/spdy_framer.cc +++ b/net/spdy/spdy_framer.cc @@ -161,7 +161,7 @@ size_t SpdyFramer::GetDataFrameMinimumSize() const { return 8; } -size_t SpdyFramer::GetControlFrameMinimumSize() const { +size_t SpdyFramer::GetControlFrameHeaderSize() const { // Size, in bytes, of the control frame header. Future versions of SPDY // will likely vary this, so we allow for the flexibility of a function call // for this value as opposed to a constant. @@ -172,14 +172,14 @@ size_t SpdyFramer::GetSynStreamMinimumSize() const { // Size, in bytes, of a SYN_STREAM frame not including the variable-length // name-value block. Calculated as: // control frame header + 2 * 4 (stream IDs) + 1 (priority) + 1 (slot) - return GetControlFrameMinimumSize() + 10; + return GetControlFrameHeaderSize() + 10; } size_t SpdyFramer::GetSynReplyMinimumSize() const { // Size, in bytes, of a SYN_REPLY frame not including the variable-length // name-value block. Calculated as: // control frame header + 4 (stream ID) - size_t size = GetControlFrameMinimumSize() + 4; + size_t size = GetControlFrameHeaderSize() + 4; // In SPDY 2, there were 2 unused bytes before payload. if (protocol_version() < 3) { @@ -192,26 +192,26 @@ size_t SpdyFramer::GetSynReplyMinimumSize() const { size_t SpdyFramer::GetRstStreamSize() const { // Size, in bytes, of a RST_STREAM frame. Calculated as: // control frame header + 4 (stream id) + 4 (status code) - return GetControlFrameMinimumSize() + 8; + return GetControlFrameHeaderSize() + 8; } size_t SpdyFramer::GetSettingsMinimumSize() const { // Size, in bytes, of a SETTINGS frame not including the IDs and values // from the variable-length value block. Calculated as: // control frame header + 4 (number of ID/value pairs) - return GetControlFrameMinimumSize() + 4; + return GetControlFrameHeaderSize() + 4; } size_t SpdyFramer::GetPingSize() const { // Size, in bytes, of this PING frame. Calculated as: // control frame header + 4 (id) - return GetControlFrameMinimumSize() + 4; + return GetControlFrameHeaderSize() + 4; } size_t SpdyFramer::GetGoAwaySize() const { // Size, in bytes, of this GOAWAY frame. Calculated as: // control frame header + 4 (last good stream id) - size_t size = GetControlFrameMinimumSize() + 4; + size_t size = GetControlFrameHeaderSize() + 4; // SPDY 3+ GOAWAY frames also contain a status. if (protocol_version() >= 3) { @@ -225,7 +225,7 @@ size_t SpdyFramer::GetHeadersMinimumSize() const { // Size, in bytes, of a HEADERS frame not including the variable-length // name-value block. Calculated as: // control frame header + 4 (stream ID) - size_t size = GetControlFrameMinimumSize() + 4; + size_t size = GetControlFrameHeaderSize() + 4; // In SPDY 2, there were 2 unused bytes before payload. if (protocol_version() < 3) { @@ -238,14 +238,14 @@ size_t SpdyFramer::GetHeadersMinimumSize() const { size_t SpdyFramer::GetWindowUpdateSize() const { // Size, in bytes, of this WINDOW_UPDATE frame. Calculated as: // control frame header + 4 (stream id) + 4 (delta) - return GetControlFrameMinimumSize() + 8; + return GetControlFrameHeaderSize() + 8; } size_t SpdyFramer::GetCredentialMinimumSize() const { // Size, in bytes, of a CREDENTIAL frame sans variable-length certificate list // and proof. Calculated as: // control frame header + 2 (slot) - return GetControlFrameMinimumSize() + 2; + return GetControlFrameHeaderSize() + 2; } const char* SpdyFramer::StateToString(int state) { @@ -477,13 +477,13 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) { size_t original_len = len; // Update current frame buffer as needed. - if (current_frame_buffer_length_ < GetControlFrameMinimumSize()) { + if (current_frame_buffer_length_ < GetControlFrameHeaderSize()) { size_t bytes_desired = - GetControlFrameMinimumSize() - current_frame_buffer_length_; + GetControlFrameHeaderSize() - current_frame_buffer_length_; UpdateCurrentFrameBuffer(&data, &len, bytes_desired); } - if (current_frame_buffer_length_ < GetControlFrameMinimumSize()) { + if (current_frame_buffer_length_ < GetControlFrameHeaderSize()) { // TODO(rch): remove this empty block // Do nothing. } else { @@ -517,7 +517,7 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) { // This is just a sanity check for help debugging early frame errors. if (remaining_data_ > 1000000u) { // The strncmp for 5 is safe because we only hit this point if we - // have GetControlFrameMinimumSize() (8) bytes + // have GetControlFrameHeaderSize() (8) bytes if (!syn_frame_processed_ && strncmp(current_frame_buffer_.get(), "HTTP/", 5) == 0) { LOG(WARNING) << "Unexpected HTTP response to " << display_protocol_ @@ -563,7 +563,7 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) { void SpdyFramer::ProcessControlFrameHeader() { DCHECK_EQ(SPDY_NO_ERROR, error_code_); - DCHECK_LE(GetControlFrameMinimumSize(), + DCHECK_LE(GetControlFrameHeaderSize(), current_frame_buffer_length_); if (current_frame_type_ < SYN_STREAM || @@ -582,7 +582,7 @@ void SpdyFramer::ProcessControlFrameHeader() { switch (current_frame_type_) { case SYN_STREAM: if (current_frame_length_ < - GetSynStreamMinimumSize() - GetControlFrameMinimumSize()) { + GetSynStreamMinimumSize() - GetControlFrameHeaderSize()) { set_error(SPDY_INVALID_CONTROL_FRAME); } else if (current_frame_flags_ & ~(CONTROL_FLAG_FIN | CONTROL_FLAG_UNIDIRECTIONAL)) { @@ -591,7 +591,7 @@ void SpdyFramer::ProcessControlFrameHeader() { break; case SYN_REPLY: if (current_frame_length_ < - GetSynReplyMinimumSize() - GetControlFrameMinimumSize()) { + GetSynReplyMinimumSize() - GetControlFrameHeaderSize()) { set_error(SPDY_INVALID_CONTROL_FRAME); } else if (current_frame_flags_ & ~CONTROL_FLAG_FIN) { set_error(SPDY_INVALID_CONTROL_FRAME_FLAGS); @@ -599,7 +599,7 @@ void SpdyFramer::ProcessControlFrameHeader() { break; case RST_STREAM: if (current_frame_length_ != - GetRstStreamSize() - GetControlFrameMinimumSize()) { + GetRstStreamSize() - GetControlFrameHeaderSize()) { set_error(SPDY_INVALID_CONTROL_FRAME); } else if (current_frame_flags_ != 0) { set_error(SPDY_INVALID_CONTROL_FRAME_FLAGS); @@ -609,7 +609,7 @@ void SpdyFramer::ProcessControlFrameHeader() { // Make sure that we have an integral number of 8-byte key/value pairs, // plus a 4-byte length field. if (current_frame_length_ < - GetSettingsMinimumSize() - GetControlFrameMinimumSize() || + GetSettingsMinimumSize() - GetControlFrameHeaderSize() || current_frame_length_ % 8 != 4) { DLOG(WARNING) << "Invalid length for SETTINGS frame: " << current_frame_length_; @@ -622,7 +622,7 @@ void SpdyFramer::ProcessControlFrameHeader() { case GOAWAY: { if (current_frame_length_ != - GetGoAwaySize() - GetControlFrameMinimumSize()) { + GetGoAwaySize() - GetControlFrameHeaderSize()) { set_error(SPDY_INVALID_CONTROL_FRAME); } else if (current_frame_flags_ != 0) { set_error(SPDY_INVALID_CONTROL_FRAME_FLAGS); @@ -631,7 +631,7 @@ void SpdyFramer::ProcessControlFrameHeader() { } case HEADERS: if (current_frame_length_ < - GetHeadersMinimumSize() - GetControlFrameMinimumSize()) { + GetHeadersMinimumSize() - GetControlFrameHeaderSize()) { set_error(SPDY_INVALID_CONTROL_FRAME); } else if (current_frame_flags_ & ~CONTROL_FLAG_FIN) { set_error(SPDY_INVALID_CONTROL_FRAME_FLAGS); @@ -639,7 +639,7 @@ void SpdyFramer::ProcessControlFrameHeader() { break; case WINDOW_UPDATE: if (current_frame_length_ != - GetWindowUpdateSize() - GetControlFrameMinimumSize()) { + GetWindowUpdateSize() - GetControlFrameHeaderSize()) { set_error(SPDY_INVALID_CONTROL_FRAME); } else if (current_frame_flags_ != 0) { set_error(SPDY_INVALID_CONTROL_FRAME_FLAGS); @@ -647,7 +647,7 @@ void SpdyFramer::ProcessControlFrameHeader() { break; case PING: if (current_frame_length_ != - GetPingSize() - GetControlFrameMinimumSize()) { + GetPingSize() - GetControlFrameHeaderSize()) { set_error(SPDY_INVALID_CONTROL_FRAME); } else if (current_frame_flags_ != 0) { set_error(SPDY_INVALID_CONTROL_FRAME_FLAGS); @@ -655,7 +655,7 @@ void SpdyFramer::ProcessControlFrameHeader() { break; case CREDENTIAL: if (current_frame_length_ < - GetCredentialMinimumSize() - GetControlFrameMinimumSize()) { + GetCredentialMinimumSize() - GetControlFrameHeaderSize()) { set_error(SPDY_INVALID_CONTROL_FRAME); } else if (current_frame_flags_ != 0) { set_error(SPDY_INVALID_CONTROL_FRAME_FLAGS); @@ -680,7 +680,7 @@ void SpdyFramer::ProcessControlFrameHeader() { remaining_control_payload_ = current_frame_length_; const size_t total_frame_size = - remaining_control_payload_ + GetControlFrameMinimumSize(); + remaining_control_payload_ + GetControlFrameHeaderSize(); if (total_frame_size > GetControlFrameBufferMaxSize()) { DLOG(WARNING) << "Received control frame with way too big of a payload: " << total_frame_size; @@ -734,7 +734,7 @@ void SpdyFramer::ProcessControlFrameHeader() { static_cast<int32>(current_frame_buffer_length_)); remaining_control_header_ = frame_size_without_variable_data - current_frame_buffer_length_; - remaining_control_payload_ += GetControlFrameMinimumSize() - + remaining_control_payload_ += GetControlFrameHeaderSize() - frame_size_without_variable_data; CHANGE_STATE(SPDY_CONTROL_FRAME_BEFORE_HEADER_BLOCK); return; @@ -977,7 +977,7 @@ size_t SpdyFramer::ProcessControlFrameBeforeHeaderBlock(const char* data, if (remaining_control_header_ == 0) { SpdyFrameReader reader(current_frame_buffer_.get(), current_frame_buffer_length_); - reader.Seek(GetControlFrameMinimumSize()); // Seek past frame header. + reader.Seek(GetControlFrameHeaderSize()); // Seek past frame header. switch (current_frame_type_) { case SYN_STREAM: @@ -1215,7 +1215,7 @@ size_t SpdyFramer::ProcessControlFramePayload(const char* data, size_t len) { if (remaining_control_payload_ == 0) { SpdyFrameReader reader(current_frame_buffer_.get(), current_frame_buffer_length_); - reader.Seek(GetControlFrameMinimumSize()); // Skip frame header. + reader.Seek(GetControlFrameHeaderSize()); // Skip frame header. // Use frame-specific handlers. switch (current_frame_type_) { diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h index 7b532f7..38cd56f 100644 --- a/net/spdy/spdy_framer.h +++ b/net/spdy/spdy_framer.h @@ -477,7 +477,7 @@ class NET_EXPORT_PRIVATE SpdyFramer { // Returns the (minimum) size of frames (sans variable-length portions). size_t GetDataFrameMinimumSize() const; - size_t GetControlFrameMinimumSize() const; + size_t GetControlFrameHeaderSize() const; size_t GetSynStreamMinimumSize() const; size_t GetSynReplyMinimumSize() const; size_t GetRstStreamSize() const; diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc index 5e2867a..a676233 100644 --- a/net/spdy/spdy_framer_test.cc +++ b/net/spdy/spdy_framer_test.cc @@ -87,7 +87,7 @@ class SpdyFramerTestUtil { CHECK(buffer != NULL); SpdyFrame* decompressed_frame = new SpdyFrame(buffer, visitor.size(), true); SetFrameLength(decompressed_frame, - visitor.size() - framer->GetControlFrameMinimumSize(), + visitor.size() - framer->GetControlFrameHeaderSize(), framer->protocol_version()); return decompressed_frame; } @@ -773,8 +773,8 @@ TEST_P(SpdyFramerTest, ParseCredentialFrameData) { reinterpret_cast<char*>(kFrameData), arraysize(kFrameData), false); SpdyCredential credential; EXPECT_TRUE(SpdyFramer::ParseCredentialData( - frame.data() + framer.GetControlFrameMinimumSize(), - frame.size() - framer.GetControlFrameMinimumSize(), + frame.data() + framer.GetControlFrameHeaderSize(), + frame.size() - framer.GetControlFrameHeaderSize(), &credential)); EXPECT_EQ(3u, credential.slot); EXPECT_EQ("proof", credential.proof); @@ -2608,7 +2608,7 @@ TEST_P(SpdyFramerTest, ControlFrameSizesAreValidated) { }; SpdyFramer framer(spdy_version_); const size_t pad_length = - length + framer.GetControlFrameMinimumSize() - + length + framer.GetControlFrameHeaderSize() - (IsSpdy2() ? sizeof(kV2FrameData) : sizeof(kV3FrameData)); string pad('A', pad_length); TestSpdyVisitor visitor(spdy_version_); @@ -2637,7 +2637,7 @@ TEST_P(SpdyFramerTest, ReadZeroLenSettingsFrame) { visitor.use_compression_ = false; visitor.SimulateInFramer( reinterpret_cast<unsigned char*>(control_frame->data()), - framer.GetControlFrameMinimumSize()); + framer.GetControlFrameHeaderSize()); // Should generate an error, since zero-len settings frames are unsupported. EXPECT_EQ(1, visitor.error_count_); } @@ -2657,7 +2657,7 @@ TEST_P(SpdyFramerTest, ReadBogusLenSettingsFrame) { visitor.use_compression_ = false; visitor.SimulateInFramer( reinterpret_cast<unsigned char*>(control_frame->data()), - framer.GetControlFrameMinimumSize() + kNewLength); + framer.GetControlFrameHeaderSize() + kNewLength); // Should generate an error, since zero-len settings frames are unsupported. EXPECT_EQ(1, visitor.error_count_); } @@ -2808,7 +2808,7 @@ TEST_P(SpdyFramerTest, ReadCredentialFrame) { reinterpret_cast<unsigned char*>(control_frame->data()), control_frame->size()); EXPECT_EQ(0, visitor.error_count_); - EXPECT_EQ(control_frame->size() - framer.GetControlFrameMinimumSize(), + EXPECT_EQ(control_frame->size() - framer.GetControlFrameHeaderSize(), visitor.credential_buffer_length_); EXPECT_EQ(credential.slot, visitor.credential_.slot); EXPECT_EQ(credential.proof, visitor.credential_.proof); @@ -2839,7 +2839,7 @@ TEST_P(SpdyFramerTest, ReadCredentialFrameOneByteAtATime) { ASSERT_EQ(0, visitor.error_count_); } EXPECT_EQ(0, visitor.error_count_); - EXPECT_EQ(control_frame->size() - framer.GetControlFrameMinimumSize(), + EXPECT_EQ(control_frame->size() - framer.GetControlFrameHeaderSize(), visitor.credential_buffer_length_); EXPECT_EQ(credential.slot, visitor.credential_.slot); EXPECT_EQ(credential.proof, visitor.credential_.proof); @@ -2865,7 +2865,7 @@ TEST_P(SpdyFramerTest, ReadCredentialFrameWithNoPayload) { SetFrameLength(control_frame.get(), 0, spdy_version_); unsigned char* data = reinterpret_cast<unsigned char*>(control_frame->data()); - visitor.SimulateInFramer(data, framer.GetControlFrameMinimumSize()); + visitor.SimulateInFramer(data, framer.GetControlFrameHeaderSize()); EXPECT_EQ(1, visitor.error_count_); } @@ -2884,7 +2884,7 @@ TEST_P(SpdyFramerTest, ReadCredentialFrameWithCorruptProof) { visitor.use_compression_ = false; unsigned char* data = reinterpret_cast<unsigned char*>(control_frame->data()); - size_t offset = framer.GetControlFrameMinimumSize() + 4; + size_t offset = framer.GetControlFrameHeaderSize() + 4; data[offset] = 0xFF; // Proof length is past the end of the frame visitor.SimulateInFramer( data, control_frame->size()); @@ -2937,7 +2937,11 @@ TEST_P(SpdyFramerTest, ReadGarbageWithValidVersion) { TEST_P(SpdyFramerTest, SizesTest) { SpdyFramer framer(spdy_version_); - EXPECT_EQ(8u, framer.GetControlFrameMinimumSize()); + EXPECT_EQ(8u, framer.GetControlFrameHeaderSize()); + EXPECT_EQ(18u, framer.GetSynStreamMinimumSize()); + EXPECT_EQ(IsSpdy2() ? 14u : 12u, framer.GetSynReplyMinimumSize()); + EXPECT_EQ(16u, framer.GetRstStreamSize()); + EXPECT_EQ(8u, framer.GetControlFrameHeaderSize()); EXPECT_EQ(18u, framer.GetSynStreamMinimumSize()); EXPECT_EQ(IsSpdy2() ? 14u : 12u, framer.GetSynReplyMinimumSize()); EXPECT_EQ(16u, framer.GetRstStreamSize()); @@ -3429,7 +3433,7 @@ TEST_P(SpdyFramerTest, EmptySynStream) { // Adjust size to remove the name/value block. SetFrameLength( frame.get(), - framer.GetSynStreamMinimumSize() - framer.GetControlFrameMinimumSize(), + framer.GetSynStreamMinimumSize() - framer.GetControlFrameHeaderSize(), spdy_version_); EXPECT_CALL(visitor, OnSynStream(1, 0, 1, 0, false, false)); diff --git a/net/spdy/spdy_network_transaction_spdy2_unittest.cc b/net/spdy/spdy_network_transaction_spdy2_unittest.cc index 910e1a1..6cb6420 100644 --- a/net/spdy/spdy_network_transaction_spdy2_unittest.cc +++ b/net/spdy/spdy_network_transaction_spdy2_unittest.cc @@ -3520,7 +3520,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, CorruptFrameSessionError) { size_t wrong_size = syn_reply_wrong_length->size() - 4; BufferedSpdyFramer framer(kSpdyVersion2, false); test::SetFrameLength(syn_reply_wrong_length.get(), - wrong_size - framer.GetControlFrameMinimumSize(), + wrong_size - framer.GetControlFrameHeaderSize(), kSpdyVersion2); struct SynReplyTests { diff --git a/net/spdy/spdy_network_transaction_spdy3_unittest.cc b/net/spdy/spdy_network_transaction_spdy3_unittest.cc index a97cb0a..230ec6a 100644 --- a/net/spdy/spdy_network_transaction_spdy3_unittest.cc +++ b/net/spdy/spdy_network_transaction_spdy3_unittest.cc @@ -4095,7 +4095,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, CorruptFrameSessionError) { size_t wrong_size = syn_reply_wrong_length->size() - 4; BufferedSpdyFramer framer(kSpdyVersion3, false); test::SetFrameLength(syn_reply_wrong_length.get(), - wrong_size - framer.GetControlFrameMinimumSize(), + wrong_size - framer.GetControlFrameHeaderSize(), kSpdyVersion3); struct SynReplyTests { diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 8f8317d..386c449 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -901,8 +901,8 @@ void SpdySession::OnWriteComplete(int result) { result = in_flight_write_.buffer()->size(); DCHECK_GE(result, static_cast<int>( - buffered_spdy_framer_->GetControlFrameMinimumSize())); - result -= buffered_spdy_framer_->GetControlFrameMinimumSize(); + buffered_spdy_framer_->GetControlFrameHeaderSize())); + result -= buffered_spdy_framer_->GetControlFrameHeaderSize(); } // It is possible that the stream was cancelled while we were writing diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc index cd90bef..01e7e4c 100644 --- a/net/spdy/spdy_session_spdy2_unittest.cc +++ b/net/spdy/spdy_session_spdy2_unittest.cc @@ -1642,7 +1642,7 @@ TEST_F(SpdySessionSpdy2Test, ReadDataWithoutYielding) { // Build buffer of size kMaxReadBytes / 4 (-spdy_data_frame_size). ASSERT_EQ(32 * 1024, kMaxReadBytes); const int kPayloadSize = - kMaxReadBytes / 4 - framer.GetControlFrameMinimumSize(); + kMaxReadBytes / 4 - framer.GetControlFrameHeaderSize(); TestDataStream test_stream; scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(kPayloadSize)); char* payload_data = payload->data(); @@ -1733,7 +1733,7 @@ TEST_F(SpdySessionSpdy2Test, TestYieldingDuringReadData) { // Build buffer of size kMaxReadBytes / 4 (-spdy_data_frame_size). ASSERT_EQ(32 * 1024, kMaxReadBytes); const int kPayloadSize = - kMaxReadBytes / 4 - framer.GetControlFrameMinimumSize(); + kMaxReadBytes / 4 - framer.GetControlFrameHeaderSize(); TestDataStream test_stream; scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(kPayloadSize)); char* payload_data = payload->data(); @@ -1833,7 +1833,7 @@ TEST_F(SpdySessionSpdy2Test, TestYieldingDuringAsyncReadData) { ASSERT_EQ(32 * 1024, kMaxReadBytes); TestDataStream test_stream; const int kEightKPayloadSize = - kMaxReadBytes / 4 - framer.GetControlFrameMinimumSize(); + kMaxReadBytes / 4 - framer.GetControlFrameHeaderSize(); scoped_refptr<net::IOBuffer> eightk_payload( new net::IOBuffer(kEightKPayloadSize)); char* eightk_payload_data = eightk_payload->data(); diff --git a/net/spdy/spdy_session_spdy3_unittest.cc b/net/spdy/spdy_session_spdy3_unittest.cc index 1b4b599..e7e2d18 100644 --- a/net/spdy/spdy_session_spdy3_unittest.cc +++ b/net/spdy/spdy_session_spdy3_unittest.cc @@ -1771,7 +1771,7 @@ TEST_F(SpdySessionSpdy3Test, ReadDataWithoutYielding) { // Build buffer of size kMaxReadBytes / 4 (-spdy_data_frame_size). ASSERT_EQ(32 * 1024, kMaxReadBytes); const int kPayloadSize = - kMaxReadBytes / 4 - framer.GetControlFrameMinimumSize(); + kMaxReadBytes / 4 - framer.GetControlFrameHeaderSize(); TestDataStream test_stream; scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(kPayloadSize)); char* payload_data = payload->data(); @@ -1862,7 +1862,7 @@ TEST_F(SpdySessionSpdy3Test, TestYieldingDuringReadData) { // Build buffer of size kMaxReadBytes / 4 (-spdy_data_frame_size). ASSERT_EQ(32 * 1024, kMaxReadBytes); const int kPayloadSize = - kMaxReadBytes / 4 - framer.GetControlFrameMinimumSize(); + kMaxReadBytes / 4 - framer.GetControlFrameHeaderSize(); TestDataStream test_stream; scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(kPayloadSize)); char* payload_data = payload->data(); @@ -1962,7 +1962,7 @@ TEST_F(SpdySessionSpdy3Test, TestYieldingDuringAsyncReadData) { ASSERT_EQ(32 * 1024, kMaxReadBytes); TestDataStream test_stream; const int kEightKPayloadSize = - kMaxReadBytes / 4 - framer.GetControlFrameMinimumSize(); + kMaxReadBytes / 4 - framer.GetControlFrameHeaderSize(); scoped_refptr<net::IOBuffer> eightk_payload( new net::IOBuffer(kEightKPayloadSize)); char* eightk_payload_data = eightk_payload->data(); |