OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/spdy/spdy_http_stream.h" | 5 #include "net/spdy/spdy_http_stream.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 // If the response is already received, these headers are too late. | 341 // If the response is already received, these headers are too late. |
342 if (response_headers_received_) { | 342 if (response_headers_received_) { |
343 LOG(WARNING) << "SpdyHttpStream headers received after response started."; | 343 LOG(WARNING) << "SpdyHttpStream headers received after response started."; |
344 return OK; | 344 return OK; |
345 } | 345 } |
346 | 346 |
347 // TODO(mbelshe): This is the time of all headers received, not just time | 347 // TODO(mbelshe): This is the time of all headers received, not just time |
348 // to first byte. | 348 // to first byte. |
349 response_info_->response_time = base::Time::Now(); | 349 response_info_->response_time = base::Time::Now(); |
350 | 350 |
351 if (!SpdyHeadersToHttpResponse(response, response_info_)) { | 351 if (!SpdyHeadersToHttpResponse(response, stream_->GetProtocolVersion(), |
| 352 response_info_)) { |
352 // We might not have complete headers yet. | 353 // We might not have complete headers yet. |
353 return ERR_INCOMPLETE_SPDY_HEADERS; | 354 return ERR_INCOMPLETE_SPDY_HEADERS; |
354 } | 355 } |
355 | 356 |
356 response_headers_received_ = true; | 357 response_headers_received_ = true; |
357 // Don't store the SSLInfo in the response here, HttpNetworkTransaction | 358 // Don't store the SSLInfo in the response here, HttpNetworkTransaction |
358 // will take care of that part. | 359 // will take care of that part. |
359 SSLInfo ssl_info; | 360 SSLInfo ssl_info; |
360 NextProto protocol_negotiated = kProtoUnknown; | 361 NextProto protocol_negotiated = kProtoUnknown; |
361 stream_->GetSSLInfo(&ssl_info, | 362 stream_->GetSSLInfo(&ssl_info, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 bool SpdyHttpStream::IsSpdyHttpStream() const { | 506 bool SpdyHttpStream::IsSpdyHttpStream() const { |
506 return true; | 507 return true; |
507 } | 508 } |
508 | 509 |
509 void SpdyHttpStream::Drain(HttpNetworkSession* session) { | 510 void SpdyHttpStream::Drain(HttpNetworkSession* session) { |
510 Close(false); | 511 Close(false); |
511 delete this; | 512 delete this; |
512 } | 513 } |
513 | 514 |
514 } // namespace net | 515 } // namespace net |
OLD | NEW |