summaryrefslogtreecommitdiffstats
path: root/net/spdy
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-23 21:44:44 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-23 21:44:44 +0000
commit194cfcf377509bf977fc0302d3e4a026a95b7e53 (patch)
treec610c2ca7c5d2a5601231845090dd8bcc8fcfc74 /net/spdy
parent08148473f1e59d75dd17407df7258ca18ca6c0cd (diff)
downloadchromium_src-194cfcf377509bf977fc0302d3e4a026a95b7e53.zip
chromium_src-194cfcf377509bf977fc0302d3e4a026a95b7e53.tar.gz
chromium_src-194cfcf377509bf977fc0302d3e4a026a95b7e53.tar.bz2
[SPDY] Remove the ability to send HEADERS frames
This is never used outside of tests. This simplifies a bunch of code. BUG=242288 R=rch@chromium.org Review URL: https://codereview.chromium.org/15802002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201894 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy')
-rw-r--r--net/spdy/spdy_session.cc24
-rw-r--r--net/spdy/spdy_session.h5
-rw-r--r--net/spdy/spdy_session_spdy2_unittest.cc9
-rw-r--r--net/spdy/spdy_session_spdy3_unittest.cc18
-rw-r--r--net/spdy/spdy_stream.cc56
-rw-r--r--net/spdy/spdy_stream.h4
-rw-r--r--net/spdy/spdy_stream_spdy2_unittest.cc85
-rw-r--r--net/spdy/spdy_stream_spdy3_unittest.cc92
-rw-r--r--net/spdy/spdy_stream_test_util.cc5
-rw-r--r--net/spdy/spdy_stream_test_util.h4
10 files changed, 18 insertions, 284 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index e7e9eab..714ce85 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -763,30 +763,6 @@ int SpdySession::CreateCredentialFrame(
return OK;
}
-scoped_ptr<SpdyFrame> SpdySession::CreateHeadersFrame(
- SpdyStreamId stream_id,
- const SpdyHeaderBlock& headers,
- SpdyControlFlags flags) {
- ActiveStreamMap::const_iterator it = active_streams_.find(stream_id);
- CHECK(it != active_streams_.end());
- CHECK_EQ(it->second->stream_id(), stream_id);
-
- // Create a HEADER frame.
- scoped_ptr<SpdyFrame> frame(
- buffered_spdy_framer_->CreateHeaders(
- stream_id, flags, enable_compression_, &headers));
-
- if (net_log().IsLoggingAllEvents()) {
- bool fin = flags & CONTROL_FLAG_FIN;
- net_log().AddEvent(
- NetLog::TYPE_SPDY_SESSION_SEND_HEADERS,
- base::Bind(&NetLogSpdySynCallback,
- &headers, fin, /*unidirectional=*/false,
- stream_id, 0));
- }
- return frame.Pass();
-}
-
scoped_ptr<SpdyBuffer> SpdySession::CreateDataBuffer(SpdyStreamId stream_id,
IOBuffer* data,
int len,
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index f78825c..1a287ca 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -277,11 +277,6 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>,
RequestPriority priority,
scoped_ptr<SpdyFrame>* credential_frame);
- // Creates and returns a HEADERS frame.
- scoped_ptr<SpdyFrame> CreateHeadersFrame(SpdyStreamId stream_id,
- const SpdyHeaderBlock& headers,
- SpdyControlFlags flags);
-
// Creates and returns a SpdyBuffer holding a data frame with the
// given data. May return NULL if stalled by flow control.
scoped_ptr<SpdyBuffer> CreateDataBuffer(SpdyStreamId stream_id,
diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc
index 4e2437a..58ef2ea 100644
--- a/net/spdy/spdy_session_spdy2_unittest.cc
+++ b/net/spdy/spdy_session_spdy2_unittest.cc
@@ -245,8 +245,7 @@ TEST_F(SpdySessionSpdy2Test, ClientPing) {
base::WeakPtr<SpdyStream> spdy_stream1 =
CreateStreamSynchronously(session, test_url_, MEDIUM, BoundNetLog());
ASSERT_TRUE(spdy_stream1.get() != NULL);
- test::StreamDelegateSendImmediate delegate(
- spdy_stream1, scoped_ptr<SpdyHeaderBlock>(), NULL);
+ test::StreamDelegateSendImmediate delegate(spdy_stream1, NULL);
spdy_stream1->SetDelegate(&delegate);
base::TimeTicks before_ping_time = base::TimeTicks::Now();
@@ -300,8 +299,7 @@ TEST_F(SpdySessionSpdy2Test, ServerPing) {
base::WeakPtr<SpdyStream> spdy_stream1 =
CreateStreamSynchronously(session, test_url_, MEDIUM, BoundNetLog());
ASSERT_TRUE(spdy_stream1.get() != NULL);
- test::StreamDelegateSendImmediate delegate(
- spdy_stream1, scoped_ptr<SpdyHeaderBlock>(), NULL);
+ test::StreamDelegateSendImmediate delegate(spdy_stream1, NULL);
spdy_stream1->SetDelegate(&delegate);
// Flush the SpdySession::OnReadComplete() task.
@@ -398,8 +396,7 @@ TEST_F(SpdySessionSpdy2Test, FailedPing) {
base::WeakPtr<SpdyStream> spdy_stream1 =
CreateStreamSynchronously(session, test_url_, MEDIUM, BoundNetLog());
ASSERT_TRUE(spdy_stream1.get() != NULL);
- test::StreamDelegateSendImmediate delegate(
- spdy_stream1, scoped_ptr<SpdyHeaderBlock>(), NULL);
+ test::StreamDelegateSendImmediate delegate(spdy_stream1, NULL);
spdy_stream1->SetDelegate(&delegate);
session->set_connection_at_risk_of_loss_time(base::TimeDelta::FromSeconds(0));
diff --git a/net/spdy/spdy_session_spdy3_unittest.cc b/net/spdy/spdy_session_spdy3_unittest.cc
index 8cf7e93..970f665 100644
--- a/net/spdy/spdy_session_spdy3_unittest.cc
+++ b/net/spdy/spdy_session_spdy3_unittest.cc
@@ -328,8 +328,7 @@ TEST_F(SpdySessionSpdy3Test, ClientPing) {
base::WeakPtr<SpdyStream> spdy_stream1 =
CreateStreamSynchronously(session, test_url_, MEDIUM, BoundNetLog());
ASSERT_TRUE(spdy_stream1.get() != NULL);
- test::StreamDelegateSendImmediate delegate(
- spdy_stream1, scoped_ptr<SpdyHeaderBlock>(), NULL);
+ test::StreamDelegateSendImmediate delegate(spdy_stream1, NULL);
spdy_stream1->SetDelegate(&delegate);
base::TimeTicks before_ping_time = base::TimeTicks::Now();
@@ -383,8 +382,7 @@ TEST_F(SpdySessionSpdy3Test, ServerPing) {
base::WeakPtr<SpdyStream> spdy_stream1 =
CreateStreamSynchronously(session, test_url_, MEDIUM, BoundNetLog());
ASSERT_TRUE(spdy_stream1.get() != NULL);
- test::StreamDelegateSendImmediate delegate(
- spdy_stream1, scoped_ptr<SpdyHeaderBlock>(), NULL);
+ test::StreamDelegateSendImmediate delegate(spdy_stream1, NULL);
spdy_stream1->SetDelegate(&delegate);
// Flush the SpdySession::OnReadComplete() task.
@@ -485,8 +483,7 @@ TEST_F(SpdySessionSpdy3Test, FailedPing) {
base::WeakPtr<SpdyStream> spdy_stream1 =
CreateStreamSynchronously(session, test_url_, MEDIUM, BoundNetLog());
ASSERT_TRUE(spdy_stream1.get() != NULL);
- test::StreamDelegateSendImmediate delegate(
- spdy_stream1, scoped_ptr<SpdyHeaderBlock>(), NULL);
+ test::StreamDelegateSendImmediate delegate(spdy_stream1, NULL);
spdy_stream1->SetDelegate(&delegate);
session->set_connection_at_risk_of_loss_time(base::TimeDelta::FromSeconds(0));
@@ -2615,8 +2612,7 @@ class DropReceivedDataDelegate : public test::StreamDelegateSendImmediate {
public:
DropReceivedDataDelegate(const base::WeakPtr<SpdyStream>& stream,
base::StringPiece data)
- : StreamDelegateSendImmediate(
- stream, scoped_ptr<SpdyHeaderBlock>(), data) {}
+ : StreamDelegateSendImmediate(stream, data) {}
virtual ~DropReceivedDataDelegate() {}
@@ -2763,8 +2759,7 @@ TEST_F(SpdySessionSpdy3Test, SessionFlowControlNoSendLeaks31) {
ASSERT_TRUE(stream.get() != NULL);
EXPECT_EQ(0u, stream->stream_id());
- test::StreamDelegateSendImmediate delegate(
- stream, scoped_ptr<SpdyHeaderBlock>(), msg_data);
+ test::StreamDelegateSendImmediate delegate(stream, msg_data);
stream->SetDelegate(&delegate);
stream->set_spdy_headers(
@@ -2854,8 +2849,7 @@ TEST_F(SpdySessionSpdy3Test, SessionFlowControlEndToEnd31) {
ASSERT_TRUE(stream.get() != NULL);
EXPECT_EQ(0u, stream->stream_id());
- test::StreamDelegateSendImmediate delegate(
- stream, scoped_ptr<SpdyHeaderBlock>(), msg_data);
+ test::StreamDelegateSendImmediate delegate(stream, msg_data);
stream->SetDelegate(&delegate);
stream->set_spdy_headers(
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index e7ebd48..485bbc3 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -78,35 +78,6 @@ class SpdyStream::SynStreamBufferProducer : public SpdyBufferProducer {
const base::WeakPtr<SpdyStream> stream_;
};
-// A wrapper around a stream that calls into ProduceHeaderFrame() with
-// a given header block.
-class SpdyStream::HeaderBufferProducer : public SpdyBufferProducer {
- public:
- HeaderBufferProducer(const base::WeakPtr<SpdyStream>& stream,
- scoped_ptr<SpdyHeaderBlock> headers)
- : stream_(stream),
- headers_(headers.Pass()) {
- DCHECK(stream_);
- DCHECK(headers_);
- }
-
- virtual ~HeaderBufferProducer() {}
-
- virtual scoped_ptr<SpdyBuffer> ProduceBuffer() OVERRIDE {
- if (!stream_) {
- NOTREACHED();
- return scoped_ptr<SpdyBuffer>();
- }
- DCHECK_GT(stream_->stream_id(), 0u);
- return scoped_ptr<SpdyBuffer>(
- new SpdyBuffer(stream_->ProduceHeaderFrame(headers_.Pass())));
- }
-
- private:
- const base::WeakPtr<SpdyStream> stream_;
- scoped_ptr<SpdyHeaderBlock> headers_;
-};
-
SpdyStream::SpdyStream(SpdySession* session,
const std::string& path,
RequestPriority priority,
@@ -214,21 +185,6 @@ scoped_ptr<SpdyFrame> SpdyStream::ProduceSynStreamFrame() {
return frame.Pass();
}
-scoped_ptr<SpdyFrame> SpdyStream::ProduceHeaderFrame(
- scoped_ptr<SpdyHeaderBlock> header_block) {
- // We must need to write stream data.
- // Until the headers have been completely sent, we can not be sure
- // that our stream_id is correct.
- DCHECK_GT(io_state_, STATE_SEND_HEADERS_COMPLETE);
- DCHECK_GT(stream_id_, 0u);
-
- // Create actual HEADERS frame just in time because it depends on
- // compression context and should not be reordered after the creation.
- scoped_ptr<SpdyFrame> header_frame(session_->CreateHeadersFrame(
- stream_id_, *header_block, SpdyControlFlags()));
- return header_frame.Pass();
-}
-
void SpdyStream::DetachDelegate() {
CHECK(!in_do_loop_);
DCHECK(!closed());
@@ -626,18 +582,6 @@ int SpdyStream::SendRequest(bool has_upload_data) {
return DoLoop(OK);
}
-void SpdyStream::SendHeaders(scoped_ptr<SpdyHeaderBlock> headers) {
- // Until the first headers by SYN_STREAM have been completely sent, we can
- // not be sure that our stream_id is correct.
- DCHECK_GT(io_state_, STATE_SEND_HEADERS_COMPLETE);
- CHECK_GT(stream_id_, 0u);
-
- session_->EnqueueStreamWrite(
- GetWeakPtr(), HEADERS,
- scoped_ptr<SpdyBufferProducer>(
- new HeaderBufferProducer(GetWeakPtr(), headers.Pass())));
-}
-
void SpdyStream::SendStreamData(IOBuffer* data,
int length,
SpdyDataFlags flags) {
diff --git a/net/spdy/spdy_stream.h b/net/spdy/spdy_stream.h
index 5f14f87..c2c9dcc 100644
--- a/net/spdy/spdy_stream.h
+++ b/net/spdy/spdy_stream.h
@@ -296,10 +296,6 @@ class NET_EXPORT_PRIVATE SpdyStream {
// For non push stream, it will send SYN_STREAM frame.
int SendRequest(bool has_upload_data);
- // Sends a HEADERS frame. The delegate will be notified via
- // OnHeadersSent() when the send is complete.
- void SendHeaders(scoped_ptr<SpdyHeaderBlock> headers);
-
// Sends a DATA frame. The delegate will be notified via
// OnSendBodyComplete() (if the response hasn't been received yet)
// or OnDataSent() (if the response has been received) when the send
diff --git a/net/spdy/spdy_stream_spdy2_unittest.cc b/net/spdy/spdy_stream_spdy2_unittest.cc
index 022efec..36a327a 100644
--- a/net/spdy/spdy_stream_spdy2_unittest.cc
+++ b/net/spdy/spdy_stream_spdy2_unittest.cc
@@ -121,8 +121,7 @@ TEST_F(SpdyStreamSpdy2Test, SendDataAfterOpen) {
CreateStreamSynchronously(session, url, LOWEST, BoundNetLog());
ASSERT_TRUE(stream.get() != NULL);
- StreamDelegateSendImmediate delegate(
- stream, scoped_ptr<SpdyHeaderBlock>(), kPostBodyStringPiece);
+ StreamDelegateSendImmediate delegate(stream, kPostBodyStringPiece);
stream->SetDelegate(&delegate);
EXPECT_FALSE(stream->HasUrl());
@@ -144,82 +143,6 @@ TEST_F(SpdyStreamSpdy2Test, SendDataAfterOpen) {
EXPECT_TRUE(data.at_write_eof());
}
-TEST_F(SpdyStreamSpdy2Test, SendHeaderAndDataAfterOpen) {
- session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
-
- scoped_ptr<SpdyFrame> expected_request(ConstructSpdyWebSocketSynStream(
- 1,
- "/chat",
- "server.example.com",
- "http://example.com"));
- scoped_ptr<SpdyFrame> expected_headers(ConstructSpdyWebSocketHeadersFrame(
- 1, "6", true));
- scoped_ptr<SpdyFrame> expected_message(
- ConstructSpdyBodyFrame(1, "hello!", 6, false));
- MockWrite writes[] = {
- CreateMockWrite(*expected_request),
- CreateMockWrite(*expected_headers),
- CreateMockWrite(*expected_message)
- };
- writes[0].sequence_number = 0;
- writes[1].sequence_number = 2;
- writes[1].sequence_number = 3;
-
- scoped_ptr<SpdyFrame> response(
- ConstructSpdyWebSocketSynReply(1));
- MockRead reads[] = {
- CreateMockRead(*response),
- MockRead(ASYNC, 0, 0), // EOF
- };
- reads[0].sequence_number = 1;
- reads[1].sequence_number = 4;
-
- OrderedSocketData data(reads, arraysize(reads),
- writes, arraysize(writes));
- MockConnect connect_data(SYNCHRONOUS, OK);
- data.set_connect_data(connect_data);
-
- session_deps_.socket_factory->AddSocketDataProvider(&data);
-
- scoped_refptr<SpdySession> session(CreateSpdySession());
- GURL url("ws://server.example.com/chat");
-
- HostPortPair host_port_pair("server.example.com", 80);
- InitializeSpdySession(session, host_port_pair);
-
- base::WeakPtr<SpdyStream> stream =
- CreateStreamSynchronously(session, url, HIGHEST, BoundNetLog());
- ASSERT_TRUE(stream.get() != NULL);
- scoped_ptr<SpdyHeaderBlock> message_headers(new SpdyHeaderBlock);
- (*message_headers)["opcode"] = "1";
- (*message_headers)["length"] = "6";
- (*message_headers)["fin"] = "1";
-
- StreamDelegateSendImmediate delegate(
- stream, message_headers.Pass(), base::StringPiece("hello!", 6));
- stream->SetDelegate(&delegate);
-
- EXPECT_FALSE(stream->HasUrl());
-
- scoped_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock);
- (*headers)["path"] = url.path();
- (*headers)["host"] = url.host();
- (*headers)["version"] = "WebSocket/13";
- (*headers)["scheme"] = url.scheme();
- (*headers)["origin"] = "http://example.com";
- stream->set_spdy_headers(headers.Pass());
- EXPECT_TRUE(stream->HasUrl());
-
- EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(true));
-
- EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose());
-
- EXPECT_TRUE(delegate.send_headers_completed());
- EXPECT_EQ("101", delegate.GetResponseHeaderValue("status"));
- EXPECT_EQ(std::string(), delegate.TakeReceivedData());
- EXPECT_TRUE(data.at_write_eof());
-}
-
TEST_F(SpdyStreamSpdy2Test, PushedStream) {
session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
scoped_refptr<SpdySession> spdy_session(CreateSpdySession());
@@ -311,8 +234,7 @@ TEST_F(SpdyStreamSpdy2Test, StreamError) {
CreateStreamSynchronously(session, url, LOWEST, log.bound());
ASSERT_TRUE(stream.get() != NULL);
- StreamDelegateSendImmediate delegate(
- stream, scoped_ptr<SpdyHeaderBlock>(), kPostBodyStringPiece);
+ StreamDelegateSendImmediate delegate(stream, kPostBodyStringPiece);
stream->SetDelegate(&delegate);
EXPECT_FALSE(stream->HasUrl());
@@ -456,8 +378,7 @@ TEST_F(SpdyStreamSpdy2Test, SendLargeDataAfterOpenBidirectional) {
ASSERT_TRUE(stream.get() != NULL);
std::string body_data(3 * kMaxSpdyFrameChunkSize, 'x');
- StreamDelegateSendImmediate delegate(
- stream, scoped_ptr<SpdyHeaderBlock>(), body_data);
+ StreamDelegateSendImmediate delegate(stream, body_data);
stream->SetDelegate(&delegate);
EXPECT_FALSE(stream->HasUrl());
diff --git a/net/spdy/spdy_stream_spdy3_unittest.cc b/net/spdy/spdy_stream_spdy3_unittest.cc
index 6bb67fb..d7bd627 100644
--- a/net/spdy/spdy_stream_spdy3_unittest.cc
+++ b/net/spdy/spdy_stream_spdy3_unittest.cc
@@ -130,8 +130,7 @@ TEST_F(SpdyStreamSpdy3Test, SendDataAfterOpen) {
CreateStreamSynchronously(session, url, LOWEST, BoundNetLog());
ASSERT_TRUE(stream.get() != NULL);
- StreamDelegateSendImmediate delegate(
- stream, scoped_ptr<SpdyHeaderBlock>(), kPostBodyStringPiece);
+ StreamDelegateSendImmediate delegate(stream, kPostBodyStringPiece);
stream->SetDelegate(&delegate);
EXPECT_FALSE(stream->HasUrl());
@@ -153,83 +152,6 @@ TEST_F(SpdyStreamSpdy3Test, SendDataAfterOpen) {
EXPECT_TRUE(data.at_write_eof());
}
-TEST_F(SpdyStreamSpdy3Test, SendHeaderAndDataAfterOpen) {
- session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
-
- scoped_ptr<SpdyFrame> expected_request(ConstructSpdyWebSocketSynStream(
- 1,
- "/chat",
- "server.example.com",
- "http://example.com"));
- scoped_ptr<SpdyFrame> expected_headers(ConstructSpdyWebSocketHeadersFrame(
- 1, "6", true));
- scoped_ptr<SpdyFrame> expected_message(
- ConstructSpdyBodyFrame(1, "hello!", 6, false));
- MockWrite writes[] = {
- CreateMockWrite(*expected_request),
- CreateMockWrite(*expected_headers),
- CreateMockWrite(*expected_message)
- };
- writes[0].sequence_number = 0;
- writes[1].sequence_number = 2;
- writes[1].sequence_number = 3;
-
- scoped_ptr<SpdyFrame> response(
- ConstructSpdyWebSocketSynReply(1));
- MockRead reads[] = {
- CreateMockRead(*response),
- MockRead(ASYNC, 0, 0), // EOF
- };
- reads[0].sequence_number = 1;
- reads[1].sequence_number = 4;
-
- OrderedSocketData data(reads, arraysize(reads),
- writes, arraysize(writes));
- MockConnect connect_data(SYNCHRONOUS, OK);
- data.set_connect_data(connect_data);
-
- session_deps_.socket_factory->AddSocketDataProvider(&data);
-
- scoped_refptr<SpdySession> session(CreateSpdySession());
- GURL url("ws://server.example.com/chat");
-
- HostPortPair host_port_pair("server.example.com", 80);
- InitializeSpdySession(session, host_port_pair);
-
- base::WeakPtr<SpdyStream> stream =
- CreateStreamSynchronously(session, url, HIGHEST, BoundNetLog());
- ASSERT_TRUE(stream.get() != NULL);
- TestCompletionCallback callback;
- scoped_ptr<SpdyHeaderBlock> message_headers(new SpdyHeaderBlock);
- (*message_headers)[":opcode"] = "1";
- (*message_headers)[":length"] = "6";
- (*message_headers)[":fin"] = "1";
-
- StreamDelegateSendImmediate delegate(
- stream, message_headers.Pass(), base::StringPiece("hello!", 6));
- stream->SetDelegate(&delegate);
-
- EXPECT_FALSE(stream->HasUrl());
-
- scoped_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock);
- (*headers)[":path"] = url.path();
- (*headers)[":host"] = url.host();
- (*headers)[":version"] = "WebSocket/13";
- (*headers)[":scheme"] = url.scheme();
- (*headers)[":origin"] = "http://example.com";
- stream->set_spdy_headers(headers.Pass());
- EXPECT_TRUE(stream->HasUrl());
-
- EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(true));
-
- EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose());
-
- EXPECT_TRUE(delegate.send_headers_completed());
- EXPECT_EQ("101", delegate.GetResponseHeaderValue(":status"));
- EXPECT_EQ(std::string(), delegate.TakeReceivedData());
- EXPECT_TRUE(data.at_write_eof());
-}
-
TEST_F(SpdyStreamSpdy3Test, PushedStream) {
session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
scoped_refptr<SpdySession> spdy_session(CreateSpdySession());
@@ -324,8 +246,7 @@ TEST_F(SpdyStreamSpdy3Test, StreamError) {
CreateStreamSynchronously(session, url, LOWEST, log.bound());
ASSERT_TRUE(stream.get() != NULL);
- StreamDelegateSendImmediate delegate(
- stream, scoped_ptr<SpdyHeaderBlock>(), kPostBodyStringPiece);
+ StreamDelegateSendImmediate delegate(stream, kPostBodyStringPiece);
stream->SetDelegate(&delegate);
EXPECT_FALSE(stream->HasUrl());
@@ -469,8 +390,7 @@ TEST_F(SpdyStreamSpdy3Test, SendLargeDataAfterOpenBidirectional) {
ASSERT_TRUE(stream.get() != NULL);
std::string body_data(3 * kMaxSpdyFrameChunkSize, 'x');
- StreamDelegateSendImmediate delegate(
- stream, scoped_ptr<SpdyHeaderBlock>(), body_data);
+ StreamDelegateSendImmediate delegate(stream, body_data);
stream->SetDelegate(&delegate);
EXPECT_FALSE(stream->HasUrl());
@@ -530,8 +450,7 @@ TEST_F(SpdyStreamSpdy3Test, IncreaseSendWindowSizeOverflow) {
base::WeakPtr<SpdyStream> stream =
CreateStreamSynchronously(session, url, LOWEST, log.bound());
ASSERT_TRUE(stream.get() != NULL);
- StreamDelegateSendImmediate delegate(
- stream, scoped_ptr<SpdyHeaderBlock>(), kPostBodyStringPiece);
+ StreamDelegateSendImmediate delegate(stream, kPostBodyStringPiece);
stream->SetDelegate(&delegate);
stream->set_spdy_headers(
@@ -712,8 +631,7 @@ void SpdyStreamSpdy3Test::RunResumeAfterUnstallBidirectionalTest(
CreateStreamSynchronously(session, url, LOWEST, BoundNetLog());
ASSERT_TRUE(stream.get() != NULL);
- StreamDelegateSendImmediate delegate(stream, scoped_ptr<SpdyHeaderBlock>(),
- kPostBodyStringPiece);
+ StreamDelegateSendImmediate delegate(stream, kPostBodyStringPiece);
stream->SetDelegate(&delegate);
EXPECT_FALSE(stream->HasUrl());
diff --git a/net/spdy/spdy_stream_test_util.cc b/net/spdy/spdy_stream_test_util.cc
index 3055267..f3781f4 100644
--- a/net/spdy/spdy_stream_test_util.cc
+++ b/net/spdy/spdy_stream_test_util.cc
@@ -135,10 +135,8 @@ SpdySendStatus StreamDelegateDoNothing::OnSendBodyComplete() {
StreamDelegateSendImmediate::StreamDelegateSendImmediate(
const base::WeakPtr<SpdyStream>& stream,
- scoped_ptr<SpdyHeaderBlock> headers,
base::StringPiece data)
: StreamDelegateBase(stream),
- headers_(headers.Pass()),
data_(data) {}
StreamDelegateSendImmediate::~StreamDelegateSendImmediate() {
@@ -159,9 +157,6 @@ int StreamDelegateSendImmediate::OnResponseReceived(
int status) {
status =
StreamDelegateBase::OnResponseReceived(response, response_time, status);
- if (headers_.get()) {
- stream()->SendHeaders(headers_.Pass());
- }
if (data_.data()) {
scoped_refptr<StringIOBuffer> buf(new StringIOBuffer(data_.as_string()));
stream()->SendStreamData(buf, buf->size(), DATA_FLAG_NONE);
diff --git a/net/spdy/spdy_stream_test_util.h b/net/spdy/spdy_stream_test_util.h
index d99c967..21e57d5 100644
--- a/net/spdy/spdy_stream_test_util.h
+++ b/net/spdy/spdy_stream_test_util.h
@@ -106,9 +106,8 @@ class StreamDelegateDoNothing : public StreamDelegateBase {
// Test delegate that sends data immediately in OnResponseReceived().
class StreamDelegateSendImmediate : public StreamDelegateBase {
public:
- // Both |headers| and |buf| can be NULL.
+ // |data| can be NULL.
StreamDelegateSendImmediate(const base::WeakPtr<SpdyStream>& stream,
- scoped_ptr<SpdyHeaderBlock> headers,
base::StringPiece data);
virtual ~StreamDelegateSendImmediate();
@@ -119,7 +118,6 @@ class StreamDelegateSendImmediate : public StreamDelegateBase {
int status) OVERRIDE;
private:
- scoped_ptr<SpdyHeaderBlock> headers_;
base::StringPiece data_;
};