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

Unified Diff: net/spdy/spdy_stream_test_util.cc

Issue 17382012: [SPDY] Refactor SpdyStream's handling of response headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More updates from rebase Created 7 years, 6 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_stream_unittest.cc » ('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 8024f8fcafa7dd4c09ac975d8c64749029adc903..782c34552aa96bf379e2a41ff2ff17d34cd425ef 100644
--- a/net/spdy/spdy_stream_test_util.cc
+++ b/net/spdy/spdy_stream_test_util.cc
@@ -22,15 +22,12 @@ ClosingDelegate::~ClosingDelegate() {}
void ClosingDelegate::OnRequestHeadersSent() {}
-int ClosingDelegate::OnResponseHeadersReceived(const SpdyHeaderBlock& response,
- base::Time response_time,
- int status) {
- return OK;
+SpdyResponseHeadersStatus ClosingDelegate::OnResponseHeadersUpdated(
+ const SpdyHeaderBlock& response_headers) {
+ return RESPONSE_HEADERS_ARE_COMPLETE;
}
-int ClosingDelegate::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) {
- return OK;
-}
+void ClosingDelegate::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) {}
void ClosingDelegate::OnDataSent() {}
@@ -56,19 +53,16 @@ void StreamDelegateBase::OnRequestHeadersSent() {
send_headers_completed_ = true;
}
-int StreamDelegateBase::OnResponseHeadersReceived(
- const SpdyHeaderBlock& response,
- base::Time response_time,
- int status) {
- EXPECT_TRUE(send_headers_completed_);
- response_ = response;
- return status;
+SpdyResponseHeadersStatus StreamDelegateBase::OnResponseHeadersUpdated(
+ const SpdyHeaderBlock& response_headers) {
+ EXPECT_EQ(stream_->type() != SPDY_PUSH_STREAM, send_headers_completed_);
+ response_headers_ = response_headers;
+ return RESPONSE_HEADERS_ARE_COMPLETE;
}
-int StreamDelegateBase::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) {
+void StreamDelegateBase::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) {
if (buffer)
received_data_queue_.Enqueue(buffer.Pass());
- return OK;
}
void StreamDelegateBase::OnDataSent() {}
@@ -100,8 +94,8 @@ std::string StreamDelegateBase::TakeReceivedData() {
std::string StreamDelegateBase::GetResponseHeaderValue(
const std::string& name) const {
- SpdyHeaderBlock::const_iterator it = response_.find(name);
- return (it == response_.end()) ? std::string() : it->second;
+ SpdyHeaderBlock::const_iterator it = response_headers_.find(name);
+ return (it == response_headers_.end()) ? std::string() : it->second;
}
StreamDelegateDoNothing::StreamDelegateDoNothing(
@@ -120,13 +114,10 @@ StreamDelegateSendImmediate::StreamDelegateSendImmediate(
StreamDelegateSendImmediate::~StreamDelegateSendImmediate() {
}
-int StreamDelegateSendImmediate::OnResponseHeadersReceived(
- const SpdyHeaderBlock& response,
- base::Time response_time,
- int status) {
- status =
- StreamDelegateBase::OnResponseHeadersReceived(
- response, response_time, status);
+SpdyResponseHeadersStatus StreamDelegateSendImmediate::OnResponseHeadersUpdated(
+ const SpdyHeaderBlock& response_headers) {
+ SpdyResponseHeadersStatus status =
+ StreamDelegateBase::OnResponseHeadersUpdated(response_headers);
if (data_.data()) {
scoped_refptr<StringIOBuffer> buf(new StringIOBuffer(data_.as_string()));
stream()->SendData(buf.get(), buf->size(), MORE_DATA_TO_SEND);
« no previous file with comments | « net/spdy/spdy_stream_test_util.h ('k') | net/spdy/spdy_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698