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

Unified Diff: net/spdy/spdy_http_stream.cc

Issue 17382012: [SPDY] Refactor SpdyStream's handling of response headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to rename a function 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
Index: net/spdy/spdy_http_stream.cc
diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc
index e10aaa6c3c2d2b70e8ece53554502f0a21f3b17d..4a8e7f41234a216d9277f3b17c7fb2c97dbe20b0 100644
--- a/net/spdy/spdy_http_stream.cc
+++ b/net/spdy/spdy_http_stream.cc
@@ -112,7 +112,7 @@ int SpdyHttpStream::ReadResponseHeaders(const CompletionCallback& callback) {
CHECK(stream_.get());
// Check if we already have the response headers. If so, return synchronously.
- if(stream_->response_received()) {
+ if(stream_->ReceivedInitialResponseHeaders()) {
CHECK(stream_->is_idle());
return OK;
}
@@ -298,9 +298,8 @@ void SpdyHttpStream::OnRequestHeadersSent() {
ReadAndSendRequestBodyData();
}
-int SpdyHttpStream::OnResponseHeadersReceived(const SpdyHeaderBlock& response,
- base::Time response_time,
- int status) {
+int SpdyHttpStream::OnResponseHeadersUpdated(
+ const SpdyHeaderBlock& response_headers) {
if (!response_info_) {
DCHECK_EQ(stream_->type(), SPDY_PUSH_STREAM);
push_response_info_.reset(new HttpResponseInfo);
@@ -313,16 +312,13 @@ int SpdyHttpStream::OnResponseHeadersReceived(const SpdyHeaderBlock& response,
return OK;
}
- // TODO(mbelshe): This is the time of all headers received, not just time
- // to first byte.
- response_info_->response_time = base::Time::Now();
-
- if (!SpdyHeadersToHttpResponse(response, stream_->GetProtocolVersion(),
- response_info_)) {
+ if (!SpdyHeadersToHttpResponse(
+ response_headers, stream_->GetProtocolVersion(), response_info_)) {
// We might not have complete headers yet.
return ERR_INCOMPLETE_SPDY_HEADERS;
}
+ response_info_->response_time = stream_->response_time();
response_headers_received_ = true;
// Don't store the SSLInfo in the response here, HttpNetworkTransaction
// will take care of that part.
@@ -349,14 +345,11 @@ int SpdyHttpStream::OnResponseHeadersReceived(const SpdyHeaderBlock& response,
}
response_info_->vary_data
.Init(*request_info_, *response_info_->headers.get());
- // TODO(ahendrickson): This is recorded after the entire SYN_STREAM control
- // frame has been received and processed. Move to framer?
- response_info_->response_time = response_time;
if (!callback_.is_null())
- DoCallback(status);
+ DoCallback(OK);
- return status;
+ return OK;
}
int SpdyHttpStream::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) {

Powered by Google App Engine
This is Rietveld 408576698