summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-21 21:52:50 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-21 21:52:50 +0000
commit45691a6a380391e5e41e5c1e1d74ba01f979effc (patch)
tree7a8a45d937ffa2f588421fad7a5bd5fba6fe10c0
parent0cb3d72e44bbca50104f8a79acdff5c6344278b8 (diff)
downloadchromium_src-45691a6a380391e5e41e5c1e1d74ba01f979effc.zip
chromium_src-45691a6a380391e5e41e5c1e1d74ba01f979effc.tar.gz
chromium_src-45691a6a380391e5e41e5c1e1d74ba01f979effc.tar.bz2
Remove SpdyDataFrame. Useful in SPDY 4 development.
This lands server change 42861289. Review URL: https://codereview.chromium.org/12317028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183866 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/spdy/buffered_spdy_framer.cc8
-rw-r--r--net/spdy/buffered_spdy_framer.h8
-rw-r--r--net/spdy/buffered_spdy_framer_spdy2_unittest.cc2
-rw-r--r--net/spdy/buffered_spdy_framer_spdy3_unittest.cc2
-rw-r--r--net/spdy/spdy_frame_reader.h3
-rw-r--r--net/spdy/spdy_framer.cc77
-rw-r--r--net/spdy/spdy_framer.h7
-rw-r--r--net/spdy/spdy_protocol.h31
-rw-r--r--net/spdy/spdy_protocol_test.cc74
-rw-r--r--net/spdy/spdy_session.cc8
-rw-r--r--net/spdy/spdy_session.h6
-rw-r--r--net/spdy/spdy_session_spdy2_unittest.cc6
-rw-r--r--net/spdy/spdy_session_spdy3_unittest.cc6
-rw-r--r--net/spdy/spdy_stream.cc2
-rw-r--r--net/spdy/spdy_stream.h2
-rw-r--r--net/tools/flip_server/spdy_interface.cc4
16 files changed, 67 insertions, 179 deletions
diff --git a/net/spdy/buffered_spdy_framer.cc b/net/spdy/buffered_spdy_framer.cc
index 9cebcff..57b08d2 100644
--- a/net/spdy/buffered_spdy_framer.cc
+++ b/net/spdy/buffered_spdy_framer.cc
@@ -278,10 +278,10 @@ SpdyFrame* BufferedSpdyFramer::CreateCredentialFrame(
return spdy_framer_.CreateCredentialFrame(credential);
}
-SpdyDataFrame* BufferedSpdyFramer::CreateDataFrame(SpdyStreamId stream_id,
- const char* data,
- uint32 len,
- SpdyDataFlags flags) {
+SpdyFrame* BufferedSpdyFramer::CreateDataFrame(SpdyStreamId stream_id,
+ const char* data,
+ uint32 len,
+ SpdyDataFlags flags) {
return spdy_framer_.CreateDataFrame(stream_id, data, len, flags);
}
diff --git a/net/spdy/buffered_spdy_framer.h b/net/spdy/buffered_spdy_framer.h
index 11bfff9..3ece787 100644
--- a/net/spdy/buffered_spdy_framer.h
+++ b/net/spdy/buffered_spdy_framer.h
@@ -176,10 +176,10 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramer
uint32 delta_window_size) const;
SpdyFrame* CreateCredentialFrame(
const SpdyCredential& credential) const;
- SpdyDataFrame* CreateDataFrame(SpdyStreamId stream_id,
- const char* data,
- uint32 len,
- SpdyDataFlags flags);
+ SpdyFrame* CreateDataFrame(SpdyStreamId stream_id,
+ const char* data,
+ uint32 len,
+ SpdyDataFlags flags);
SpdyPriority GetHighestPriority() const;
// Returns the (minimum) size of control frames (sans variable-length
diff --git a/net/spdy/buffered_spdy_framer_spdy2_unittest.cc b/net/spdy/buffered_spdy_framer_spdy2_unittest.cc
index 98dde26..a0e8792 100644
--- a/net/spdy/buffered_spdy_framer_spdy2_unittest.cc
+++ b/net/spdy/buffered_spdy_framer_spdy2_unittest.cc
@@ -102,7 +102,7 @@ class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface {
return false;
}
- void OnDataFrameHeader(const SpdyDataFrame* frame) {
+ void OnDataFrameHeader(const SpdyFrame* frame) {
LOG(FATAL) << "Unexpected OnDataFrameHeader call.";
}
diff --git a/net/spdy/buffered_spdy_framer_spdy3_unittest.cc b/net/spdy/buffered_spdy_framer_spdy3_unittest.cc
index 3645614..19fe716 100644
--- a/net/spdy/buffered_spdy_framer_spdy3_unittest.cc
+++ b/net/spdy/buffered_spdy_framer_spdy3_unittest.cc
@@ -100,7 +100,7 @@ class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface {
return false;
}
- void OnDataFrameHeader(const SpdyDataFrame* frame) {
+ void OnDataFrameHeader(const SpdyFrame* frame) {
LOG(FATAL) << "Unexpected OnDataFrameHeader call.";
}
diff --git a/net/spdy/spdy_frame_reader.h b/net/spdy/spdy_frame_reader.h
index 8a658f1..e6a0b6d 100644
--- a/net/spdy/spdy_frame_reader.h
+++ b/net/spdy/spdy_frame_reader.h
@@ -90,6 +90,9 @@ class NET_EXPORT_PRIVATE SpdyFrameReader {
// Returns true on success, false otherwise.
bool Seek(size_t size);
+ // Rewinds this reader to the beginning of the frame.
+ void Rewind() { ofs_ = 0; }
+
// Returns true if the entirety of the underlying buffer has been read via
// Read*() calls.
bool IsDoneReading() const;
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index 810e84b..94ff423 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -150,6 +150,7 @@ void SpdyFramer::Reset() {
current_frame_type_ = NUM_CONTROL_FRAME_TYPES;
current_frame_flags_ = 0;
current_frame_length_ = 0;
+ current_frame_stream_id_ = kInvalidStream;
settings_scratch_.Reset();
}
@@ -501,7 +502,8 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) {
// We check for validity below in ProcessControlFrameHeader().
current_frame_type_ = static_cast<SpdyControlType>(frame_type_field);
} else {
- successful_read = reader.Seek(2); // Seek past rest of stream_id.
+ reader.Rewind();
+ successful_read = reader.ReadUInt31(&current_frame_stream_id_);
}
DCHECK(successful_read);
@@ -529,11 +531,10 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) {
// if we're here, then we have the common header all received.
if (!control_bit) {
- SpdyDataFrame data_frame(current_frame_buffer_.get(), false);
if (current_frame_flags_ & ~DATA_FLAG_FIN) {
set_error(SPDY_INVALID_DATA_FRAME_FLAGS);
} else {
- visitor_->OnDataFrameHeader(data_frame.stream_id(),
+ visitor_->OnDataFrameHeader(current_frame_stream_id_,
current_frame_length_,
current_frame_flags_ & DATA_FLAG_FIN);
if (current_frame_length_ > 0) {
@@ -541,7 +542,7 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) {
} else {
// Empty data frame.
if (current_frame_flags_ & DATA_FLAG_FIN) {
- visitor_->OnStreamFrameData(data_frame.stream_id(),
+ visitor_->OnStreamFrameData(current_frame_stream_id_,
NULL, 0, DATA_FLAG_FIN);
}
CHANGE_STATE(SPDY_AUTO_RESET);
@@ -980,8 +981,7 @@ size_t SpdyFramer::ProcessControlFrameBeforeHeaderBlock(const char* data,
switch (current_frame_type_) {
case SYN_STREAM:
{
- SpdyStreamId stream_id = kInvalidStream;
- bool successful_read = reader.ReadUInt31(&stream_id);
+ bool successful_read = reader.ReadUInt31(&current_frame_stream_id_);
DCHECK(successful_read);
SpdyStreamId associated_to_stream_id = kInvalidStream;
@@ -1008,7 +1008,7 @@ size_t SpdyFramer::ProcessControlFrameBeforeHeaderBlock(const char* data,
DCHECK(reader.IsDoneReading());
visitor_->OnSynStream(
- stream_id,
+ current_frame_stream_id_,
associated_to_stream_id,
priority,
slot,
@@ -1021,8 +1021,7 @@ size_t SpdyFramer::ProcessControlFrameBeforeHeaderBlock(const char* data,
case HEADERS:
// SYN_REPLY and HEADERS are the same, save for the visitor call.
{
- SpdyStreamId stream_id = kInvalidStream;
- bool successful_read = reader.ReadUInt31(&stream_id);
+ bool successful_read = reader.ReadUInt31(&current_frame_stream_id_);
DCHECK(successful_read);
if (protocol_version() < 3) {
// SPDY 2 had two unused bytes here. Seek past them.
@@ -1031,11 +1030,11 @@ size_t SpdyFramer::ProcessControlFrameBeforeHeaderBlock(const char* data,
DCHECK(reader.IsDoneReading());
if (current_frame_type_ == SYN_REPLY) {
visitor_->OnSynReply(
- stream_id,
+ current_frame_stream_id_,
(current_frame_flags_ & CONTROL_FLAG_FIN) != 0);
} else {
visitor_->OnHeaders(
- stream_id,
+ current_frame_stream_id_,
(current_frame_flags_ & CONTROL_FLAG_FIN) != 0);
}
}
@@ -1060,28 +1059,19 @@ size_t SpdyFramer::ProcessControlFrameHeaderBlock(const char* data,
DCHECK_EQ(SPDY_CONTROL_FRAME_HEADER_BLOCK, state_);
bool processed_successfully = true;
- SpdyStreamId stream_id = kInvalidStream;
- if (current_frame_type_ == SYN_STREAM ||
- current_frame_type_ == SYN_REPLY ||
- current_frame_type_ == HEADERS) {
- // The logic for all three of the aforementioned frame types is identical,
- // since the stream id is the first field in the frame after the header.
- SpdyFrameReader reader(current_frame_buffer_.get(),
- current_frame_buffer_length_);
- reader.Seek(GetControlFrameMinimumSize()); // Seek past frame header.
- bool successful_read = reader.ReadUInt31(&stream_id);
- DCHECK(successful_read);
- } else {
+ if (current_frame_type_ != SYN_STREAM &&
+ current_frame_type_ != SYN_REPLY &&
+ current_frame_type_ != HEADERS) {
LOG(DFATAL) << "Unhandled frame type in ProcessControlFrameHeaderBlock.";
}
size_t process_bytes = std::min(data_len, remaining_control_payload_);
if (process_bytes > 0) {
if (enable_compression_) {
processed_successfully = IncrementallyDecompressControlFrameHeaderData(
- stream_id, data, process_bytes);
+ current_frame_stream_id_, data, process_bytes);
} else {
processed_successfully = IncrementallyDeliverControlFrameHeaderData(
- stream_id, data, process_bytes);
+ current_frame_stream_id_, data, process_bytes);
}
remaining_control_payload_ -= process_bytes;
@@ -1092,11 +1082,12 @@ size_t SpdyFramer::ProcessControlFrameHeaderBlock(const char* data,
if (remaining_control_payload_ == 0 && processed_successfully) {
// The complete header block has been delivered. We send a zero-length
// OnControlFrameHeaderData() to indicate this.
- visitor_->OnControlFrameHeaderData(stream_id, NULL, 0);
+ visitor_->OnControlFrameHeaderData(current_frame_stream_id_, NULL, 0);
// If this is a FIN, tell the caller.
if (current_frame_flags_ & CONTROL_FLAG_FIN) {
- visitor_->OnStreamFrameData(stream_id, NULL, 0, DATA_FLAG_FIN);
+ visitor_->OnStreamFrameData(
+ current_frame_stream_id_, NULL, 0, DATA_FLAG_FIN);
}
CHANGE_STATE(SPDY_AUTO_RESET);
@@ -1236,19 +1227,18 @@ size_t SpdyFramer::ProcessControlFramePayload(const char* data, size_t len) {
}
break;
case WINDOW_UPDATE: {
- SpdyStreamId stream_id = kInvalidStream;
uint32 delta_window_size = 0;
- bool successful_read = reader.ReadUInt31(&stream_id);
+ bool successful_read = reader.ReadUInt31(&current_frame_stream_id_);
DCHECK(successful_read);
successful_read = reader.ReadUInt32(&delta_window_size);
DCHECK(successful_read);
DCHECK(reader.IsDoneReading());
- visitor_->OnWindowUpdate(stream_id, delta_window_size);
+ visitor_->OnWindowUpdate(
+ current_frame_stream_id_, delta_window_size);
}
break;
case RST_STREAM: {
- SpdyStreamId stream_id = kInvalidStream;
- bool successful_read = reader.ReadUInt32(&stream_id);
+ bool successful_read = reader.ReadUInt32(&current_frame_stream_id_);
DCHECK(successful_read);
SpdyRstStreamStatus status = RST_STREAM_INVALID;
uint32 status_raw = status;
@@ -1263,12 +1253,11 @@ size_t SpdyFramer::ProcessControlFramePayload(const char* data, size_t len) {
// behavior for now.
}
DCHECK(reader.IsDoneReading());
- visitor_->OnRstStream(stream_id, status);
+ visitor_->OnRstStream(current_frame_stream_id_, status);
}
break;
case GOAWAY: {
- SpdyStreamId last_accepted_stream_id = kInvalidStream;
- bool successful_read = reader.ReadUInt31(&last_accepted_stream_id);
+ bool successful_read = reader.ReadUInt31(&current_frame_stream_id_);
DCHECK(successful_read);
SpdyGoAwayStatus status = GOAWAY_OK;
if (spdy_version_ >= 3) {
@@ -1285,7 +1274,7 @@ size_t SpdyFramer::ProcessControlFramePayload(const char* data, size_t len) {
}
}
DCHECK(reader.IsDoneReading());
- visitor_->OnGoAway(last_accepted_stream_id, status);
+ visitor_->OnGoAway(current_frame_stream_id_, status);
}
break;
default:
@@ -1319,14 +1308,13 @@ size_t SpdyFramer::ProcessCredentialFramePayload(const char* data, size_t len) {
size_t SpdyFramer::ProcessDataFramePayload(const char* data, size_t len) {
size_t original_len = len;
- SpdyDataFrame current_data_frame(current_frame_buffer_.get(), false);
if (remaining_data_ > 0) {
size_t amount_to_forward = std::min(remaining_data_, len);
if (amount_to_forward && state_ != SPDY_IGNORE_REMAINING_PAYLOAD) {
// Only inform the visitor if there is data.
if (amount_to_forward) {
- visitor_->OnStreamFrameData(current_data_frame.stream_id(),
- data, amount_to_forward, SpdyDataFlags());
+ visitor_->OnStreamFrameData(
+ current_frame_stream_id_, data, amount_to_forward, SpdyDataFlags());
}
}
data += amount_to_forward;
@@ -1335,10 +1323,9 @@ size_t SpdyFramer::ProcessDataFramePayload(const char* data, size_t len) {
// If the FIN flag is set, and there is no more data in this data
// frame, inform the visitor of EOF via a 0-length data frame.
- if (!remaining_data_ &&
- current_data_frame.flags() & DATA_FLAG_FIN) {
- visitor_->OnStreamFrameData(current_data_frame.stream_id(),
- NULL, 0, DATA_FLAG_FIN);
+ if (!remaining_data_ && current_frame_flags_ & DATA_FLAG_FIN) {
+ visitor_->OnStreamFrameData(
+ current_frame_stream_id_, NULL, 0, DATA_FLAG_FIN);
}
}
@@ -1719,14 +1706,14 @@ SpdySerializedFrame* SpdyFramer::SerializeCredential(
return builder.take();
}
-SpdyDataFrame* SpdyFramer::CreateDataFrame(
+SpdyFrame* SpdyFramer::CreateDataFrame(
SpdyStreamId stream_id, const char* data,
uint32 len, SpdyDataFlags flags) const {
DCHECK_EQ(0, flags & (!DATA_FLAG_FIN));
SpdyDataIR data_ir(stream_id, base::StringPiece(data, len));
data_ir.set_fin(flags & DATA_FLAG_FIN);
- return reinterpret_cast<SpdyDataFrame*>(SerializeData(data_ir));
+ return SerializeData(data_ir);
}
SpdySerializedFrame* SpdyFramer::SerializeData(const SpdyDataIR& data) const {
diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h
index 4ee88a6..9d3fadf 100644
--- a/net/spdy/spdy_framer.h
+++ b/net/spdy/spdy_framer.h
@@ -441,8 +441,8 @@ class NET_EXPORT_PRIVATE SpdyFramer {
// |len| is the length of the data
// |flags| is the flags to use with the data.
// To mark this frame as the last data frame, enable DATA_FLAG_FIN.
- SpdyDataFrame* CreateDataFrame(SpdyStreamId stream_id, const char* data,
- uint32 len, SpdyDataFlags flags) const;
+ SpdyFrame* CreateDataFrame(SpdyStreamId stream_id, const char* data,
+ uint32 len, SpdyDataFlags flags) const;
SpdySerializedFrame* SerializeData(const SpdyDataIR& data) const;
// Serializes just the data frame header, excluding actual data payload.
SpdySerializedFrame* SerializeDataFrameHeader(const SpdyDataIR& data) const;
@@ -638,6 +638,9 @@ class NET_EXPORT_PRIVATE SpdyFramer {
// The length field of the frame currently being read.
uint32 current_frame_length_;
+ // The stream ID field of the frame currently being read, if applicable.
+ SpdyStreamId current_frame_stream_id_;
+
// Scratch space for handling SETTINGS frames.
// TODO(hkhalil): Unify memory for this scratch space with
// current_frame_buffer_.
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h
index d608f70..bb9d674 100644
--- a/net/spdy/spdy_protocol.h
+++ b/net/spdy/spdy_protocol.h
@@ -870,37 +870,6 @@ class SpdyFrame {
DISALLOW_COPY_AND_ASSIGN(SpdyFrame);
};
-// A Data Frame.
-class SpdyDataFrame : public SpdyFrame {
- public:
- SpdyDataFrame() : SpdyFrame(size()) {}
- SpdyDataFrame(char* data, bool owns_buffer)
- : SpdyFrame(data, owns_buffer) {}
-
- SpdyStreamId stream_id() const {
- return ntohl(frame_->data_.stream_id_) & kStreamIdMask;
- }
-
- // Note that setting the stream id sets the control bit to false.
- // As stream id should always be set, this means the control bit
- // should always be set correctly.
- void set_stream_id(SpdyStreamId id) {
- DCHECK_EQ(0u, (id & ~kStreamIdMask));
- frame_->data_.stream_id_ = htonl(id & kStreamIdMask);
- }
-
- // Returns the size of the SpdyFrameBlock structure.
- // Note: this is not the size of the SpdyDataFrame class.
- static size_t size() { return SpdyFrame::kHeaderSize; }
-
- const char* payload() const {
- return reinterpret_cast<const char*>(frame_) + size();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(SpdyDataFrame);
-};
-
} // namespace net
#endif // NET_SPDY_SPDY_PROTOCOL_H_
diff --git a/net/spdy/spdy_protocol_test.cc b/net/spdy/spdy_protocol_test.cc
index 3dfb050..bb00979 100644
--- a/net/spdy/spdy_protocol_test.cc
+++ b/net/spdy/spdy_protocol_test.cc
@@ -41,7 +41,6 @@ INSTANTIATE_TEST_CASE_P(SpdyProtocolTests,
// Test our protocol constants
TEST_P(SpdyProtocolTest, ProtocolConstants) {
EXPECT_EQ(8u, SpdyFrame::kHeaderSize);
- EXPECT_EQ(8u, SpdyDataFrame::size());
EXPECT_EQ(4u, sizeof(FlagsAndLength));
EXPECT_EQ(1, SYN_STREAM);
EXPECT_EQ(2, SYN_REPLY);
@@ -68,52 +67,6 @@ TEST_P(SpdyProtocolTest, FrameStructs) {
EXPECT_EQ(10u, frame.flags());
}
-TEST_P(SpdyProtocolTest, DataFrameStructs) {
- SpdyDataFrame data_frame;
- data_frame.set_stream_id(12345);
- EXPECT_EQ(12345u, data_frame.stream_id());
-}
-
-TEST_P(SpdyProtocolTest, TestDataFrame) {
- SpdyDataFrame frame;
-
- // Set the stream ID to various values.
- frame.set_stream_id(0);
- EXPECT_EQ(0u, frame.stream_id());
- frame.set_stream_id(~0 & kStreamIdMask);
- EXPECT_EQ(~0 & kStreamIdMask, frame.stream_id());
-
- // Set length to various values. Make sure that when you set_length(x),
- // length() == x. Also make sure the flags are unaltered.
- memset(frame.data(), '1', SpdyDataFrame::size());
- int8 flags = frame.flags();
- frame.set_length(0);
- EXPECT_EQ(0u, frame.length());
- EXPECT_EQ(flags, frame.flags());
- frame.set_length(kLengthMask);
- EXPECT_EQ(kLengthMask, frame.length());
- EXPECT_EQ(flags, frame.flags());
- frame.set_length(5u);
- EXPECT_EQ(5u, frame.length());
- EXPECT_EQ(flags, frame.flags());
-
- // Set flags to various values. Make sure that when you set_flags(x),
- // flags() == x. Also make sure the length is unaltered.
- memset(frame.data(), '1', SpdyDataFrame::size());
- uint32 length = frame.length();
- frame.set_flags(0u);
- EXPECT_EQ(0u, frame.flags());
- EXPECT_EQ(length, frame.length());
- int8 all_flags = ~0;
- frame.set_flags(all_flags);
- flags = frame.flags();
- EXPECT_EQ(all_flags, flags);
- EXPECT_EQ(length, frame.length());
- frame.set_flags(5u);
- EXPECT_EQ(5u, frame.flags());
- EXPECT_EQ(length, frame.length());
-}
-
class SpdyProtocolDeathTest : public SpdyProtocolTest {};
// All tests are run with two different SPDY versions: SPDY/2 and SPDY/3.
@@ -121,31 +74,4 @@ INSTANTIATE_TEST_CASE_P(SpdyProtocolDeathTests,
SpdyProtocolDeathTest,
::testing::Values(SPDY2, SPDY3));
-// Make sure that overflows both die in debug mode, and do not cause problems
-// in opt mode. Note: The EXPECT_DEBUG_DEATH call does not work on Win32 yet,
-// so we comment it out.
-TEST_P(SpdyProtocolDeathTest, TestDataFrame) {
- SpdyDataFrame frame;
-
- frame.set_stream_id(0);
- // TODO(mbelshe): implement EXPECT_DEBUG_DEATH on windows.
-#if !defined(WIN32) && defined(GTEST_HAS_DEATH_TEST)
-#if !defined(DCHECK_ALWAYS_ON)
- EXPECT_DEBUG_DEATH(frame.set_stream_id(~0), "");
-#else
- EXPECT_DEATH(frame.set_stream_id(~0), "");
-#endif
-#endif
-
- frame.set_flags(0);
-#if !defined(WIN32) && defined(GTEST_HAS_DEATH_TEST)
-#if !defined(DCHECK_ALWAYS_ON)
- EXPECT_DEBUG_DEATH(frame.set_length(~0), "");
-#else
- EXPECT_DEATH(frame.set_length(~0), "");
-#endif
-#endif
- EXPECT_EQ(0, frame.flags());
-}
-
} // namespace net
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index f156652..683a211 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -669,9 +669,9 @@ SpdyFrame* SpdySession::CreateHeadersFrame(
return frame.release();
}
-SpdyDataFrame* SpdySession::CreateDataFrame(SpdyStreamId stream_id,
- net::IOBuffer* data, int len,
- SpdyDataFlags flags) {
+SpdyFrame* SpdySession::CreateDataFrame(SpdyStreamId stream_id,
+ net::IOBuffer* data, int len,
+ SpdyDataFlags flags) {
// Find our stream
CHECK(IsStreamActive(stream_id));
scoped_refptr<SpdyStream> stream = active_streams_[stream_id];
@@ -717,7 +717,7 @@ SpdyDataFrame* SpdySession::CreateDataFrame(SpdyStreamId stream_id,
// TODO(mbelshe): reduce memory copies here.
DCHECK(buffered_spdy_framer_.get());
- scoped_ptr<SpdyDataFrame> frame(
+ scoped_ptr<SpdyFrame> frame(
buffered_spdy_framer_->CreateDataFrame(
stream_id, data->data(), len, flags));
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index 9209b03..5e907d6 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -228,9 +228,9 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>,
// Write a data frame to the stream.
// Used to create and queue a data frame for the given stream.
- SpdyDataFrame* CreateDataFrame(SpdyStreamId stream_id,
- net::IOBuffer* data, int len,
- SpdyDataFlags flags);
+ SpdyFrame* CreateDataFrame(SpdyStreamId stream_id,
+ net::IOBuffer* data, int len,
+ SpdyDataFlags flags);
// Close a stream.
void CloseStream(SpdyStreamId stream_id, int status);
diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc
index 2cf76e4..6d52838 100644
--- a/net/spdy/spdy_session_spdy2_unittest.cc
+++ b/net/spdy/spdy_session_spdy2_unittest.cc
@@ -1641,7 +1641,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 - SpdyDataFrame::size();
+ const int kPayloadSize = kMaxReadBytes / 4 - SpdyFrame::kHeaderSize;
TestDataStream test_stream;
scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(kPayloadSize));
char* payload_data = payload->data();
@@ -1731,7 +1731,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 - SpdyDataFrame::size();
+ const int kPayloadSize = kMaxReadBytes / 4 - SpdyFrame::kHeaderSize;
TestDataStream test_stream;
scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(kPayloadSize));
char* payload_data = payload->data();
@@ -1830,7 +1830,7 @@ TEST_F(SpdySessionSpdy2Test, TestYieldingDuringAsyncReadData) {
// Build buffer of size kMaxReadBytes / 4 (-spdy_data_frame_size).
ASSERT_EQ(32 * 1024, kMaxReadBytes);
TestDataStream test_stream;
- const int kEightKPayloadSize = kMaxReadBytes / 4 - SpdyDataFrame::size();
+ const int kEightKPayloadSize = kMaxReadBytes / 4 - SpdyFrame::kHeaderSize;
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 dc5c32e..bfc3d0a6 100644
--- a/net/spdy/spdy_session_spdy3_unittest.cc
+++ b/net/spdy/spdy_session_spdy3_unittest.cc
@@ -1770,7 +1770,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 - SpdyDataFrame::size();
+ const int kPayloadSize = kMaxReadBytes / 4 - SpdyFrame::kHeaderSize;
TestDataStream test_stream;
scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(kPayloadSize));
char* payload_data = payload->data();
@@ -1860,7 +1860,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 - SpdyDataFrame::size();
+ const int kPayloadSize = kMaxReadBytes / 4 - SpdyFrame::kHeaderSize;
TestDataStream test_stream;
scoped_refptr<net::IOBuffer> payload(new net::IOBuffer(kPayloadSize));
char* payload_data = payload->data();
@@ -1959,7 +1959,7 @@ TEST_F(SpdySessionSpdy3Test, TestYieldingDuringAsyncReadData) {
// Build buffer of size kMaxReadBytes / 4 (-spdy_data_frame_size).
ASSERT_EQ(32 * 1024, kMaxReadBytes);
TestDataStream test_stream;
- const int kEightKPayloadSize = kMaxReadBytes / 4 - SpdyDataFrame::size();
+ const int kEightKPayloadSize = kMaxReadBytes / 4 - SpdyFrame::kHeaderSize;
scoped_refptr<net::IOBuffer> eightk_payload(
new net::IOBuffer(kEightKPayloadSize));
char* eightk_payload_data = eightk_payload->data();
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index 2bf99f8..ebbc1d2 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -604,7 +604,7 @@ int SpdyStream::WriteStreamData(IOBuffer* data,
DCHECK_GT(io_state_, STATE_SEND_HEADERS_COMPLETE);
CHECK_GT(stream_id_, 0u);
- SpdyDataFrame* data_frame = session_->CreateDataFrame(
+ SpdyFrame* data_frame = session_->CreateDataFrame(
stream_id_, data, length, flags);
if (!data_frame)
return ERR_IO_PENDING;
diff --git a/net/spdy/spdy_stream.h b/net/spdy/spdy_stream.h
index 38a09a6..485bb97 100644
--- a/net/spdy/spdy_stream.h
+++ b/net/spdy/spdy_stream.h
@@ -104,7 +104,7 @@ class NET_EXPORT_PRIVATE SpdyStream
FrameType type;
union {
SpdyHeaderBlock* header_block;
- SpdyDataFrame* data_frame;
+ SpdyFrame* data_frame;
};
} PendingFrame;
diff --git a/net/tools/flip_server/spdy_interface.cc b/net/tools/flip_server/spdy_interface.cc
index dfef135..7220607 100644
--- a/net/tools/flip_server/spdy_interface.cc
+++ b/net/tools/flip_server/spdy_interface.cc
@@ -465,7 +465,7 @@ void SpdySM::SendDataFrameImpl(uint32 stream_id, const char* data, int64 len,
// priority queue. Compression needs to be done
// with late binding.
if (len == 0) {
- SpdyDataFrame* fdf = buffered_spdy_framer_->CreateDataFrame(
+ SpdyFrame* fdf = buffered_spdy_framer_->CreateDataFrame(
stream_id, data, len, flags);
EnqueueDataFrame(new SpdyFrameDataFrame(fdf));
return;
@@ -482,7 +482,7 @@ void SpdySM::SendDataFrameImpl(uint32 stream_id, const char* data, int64 len,
if ((size < len) && (flags & DATA_FLAG_FIN))
chunk_flags = static_cast<SpdyDataFlags>(chunk_flags & ~DATA_FLAG_FIN);
- SpdyDataFrame* fdf = buffered_spdy_framer_->CreateDataFrame(
+ SpdyFrame* fdf = buffered_spdy_framer_->CreateDataFrame(
stream_id, data, size, chunk_flags);
EnqueueDataFrame(new SpdyFrameDataFrame(fdf));