Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: net/spdy/spdy_stream_test_util.cc

Issue 15936003: [SPDY] Refactor SpdyStream::Delegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_stream_test_util.h ('k') | net/spdy/spdy_websocket_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_stream_test_util.cc
diff --git a/net/spdy/spdy_stream_test_util.cc b/net/spdy/spdy_stream_test_util.cc
index 36c233ee1c00ea8f43d5cea994fc047099b2232f..e72f40808e795ccc4b9f349cee212ec060f2e2ae 100644
--- a/net/spdy/spdy_stream_test_util.cc
+++ b/net/spdy/spdy_stream_test_util.cc
@@ -20,17 +20,11 @@ ClosingDelegate::ClosingDelegate(
ClosingDelegate::~ClosingDelegate() {}
-void ClosingDelegate::OnSendRequestHeadersComplete() {}
+void ClosingDelegate::OnRequestHeadersSent() {}
-void ClosingDelegate::OnSendBody() {
- ADD_FAILURE() << "OnSendBody should not be called";
-}
-
-void ClosingDelegate::OnSendBodyComplete() {}
-
-int ClosingDelegate::OnResponseReceived(const SpdyHeaderBlock& response,
- base::Time response_time,
- int status) {
+int ClosingDelegate::OnResponseHeadersReceived(const SpdyHeaderBlock& response,
+ base::Time response_time,
+ int status) {
return OK;
}
@@ -56,15 +50,16 @@ StreamDelegateBase::StreamDelegateBase(
StreamDelegateBase::~StreamDelegateBase() {
}
-void StreamDelegateBase::OnSendRequestHeadersComplete() {
+void StreamDelegateBase::OnRequestHeadersSent() {
stream_id_ = stream_->stream_id();
EXPECT_NE(stream_id_, 0u);
send_headers_completed_ = true;
}
-int StreamDelegateBase::OnResponseReceived(const SpdyHeaderBlock& response,
- base::Time response_time,
- int status) {
+int StreamDelegateBase::OnResponseHeadersReceived(
+ const SpdyHeaderBlock& response,
+ base::Time response_time,
+ int status) {
EXPECT_TRUE(send_headers_completed_);
response_ = response;
return status;
@@ -116,12 +111,6 @@ StreamDelegateDoNothing::StreamDelegateDoNothing(
StreamDelegateDoNothing::~StreamDelegateDoNothing() {
}
-void StreamDelegateDoNothing::OnSendBody() {
- ADD_FAILURE() << "OnSendBody should not be called";
-}
-
-void StreamDelegateDoNothing::OnSendBodyComplete() {}
-
StreamDelegateSendImmediate::StreamDelegateSendImmediate(
const base::WeakPtr<SpdyStream>& stream,
base::StringPiece data)
@@ -131,23 +120,16 @@ StreamDelegateSendImmediate::StreamDelegateSendImmediate(
StreamDelegateSendImmediate::~StreamDelegateSendImmediate() {
}
-void StreamDelegateSendImmediate::OnSendBody() {
- ADD_FAILURE() << "OnSendBody should not be called";
-}
-
-void StreamDelegateSendImmediate::OnSendBodyComplete() {
- ADD_FAILURE() << "OnSendBodyComplete should not be called";
-}
-
-int StreamDelegateSendImmediate::OnResponseReceived(
+int StreamDelegateSendImmediate::OnResponseHeadersReceived(
const SpdyHeaderBlock& response,
base::Time response_time,
int status) {
status =
- StreamDelegateBase::OnResponseReceived(response, response_time, status);
+ StreamDelegateBase::OnResponseHeadersReceived(
+ response, response_time, status);
if (data_.data()) {
scoped_refptr<StringIOBuffer> buf(new StringIOBuffer(data_.as_string()));
- stream()->SendStreamData(buf, buf->size(), MORE_DATA_TO_SEND);
+ stream()->SendData(buf, buf->size(), MORE_DATA_TO_SEND);
}
return status;
}
@@ -161,12 +143,11 @@ StreamDelegateWithBody::StreamDelegateWithBody(
StreamDelegateWithBody::~StreamDelegateWithBody() {
}
-void StreamDelegateWithBody::OnSendBody() {
- stream()->SendStreamData(buf_.get(), buf_->size(), NO_MORE_DATA_TO_SEND);
+void StreamDelegateWithBody::OnRequestHeadersSent() {
+ StreamDelegateBase::OnRequestHeadersSent();
+ stream()->SendData(buf_.get(), buf_->size(), NO_MORE_DATA_TO_SEND);
}
-void StreamDelegateWithBody::OnSendBodyComplete() {}
-
} // namespace test
} // namespace net
« no previous file with comments | « net/spdy/spdy_stream_test_util.h ('k') | net/spdy/spdy_websocket_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698