| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 350 |
| 351 if (!SpdyHeadersToHttpResponse(response, response_info_)) { | 351 if (!SpdyHeadersToHttpResponse(response, response_info_)) { |
| 352 // We might not have complete headers yet. | 352 // We might not have complete headers yet. |
| 353 return ERR_INCOMPLETE_SPDY_HEADERS; | 353 return ERR_INCOMPLETE_SPDY_HEADERS; |
| 354 } | 354 } |
| 355 | 355 |
| 356 response_headers_received_ = true; | 356 response_headers_received_ = true; |
| 357 // Don't store the SSLInfo in the response here, HttpNetworkTransaction | 357 // Don't store the SSLInfo in the response here, HttpNetworkTransaction |
| 358 // will take care of that part. | 358 // will take care of that part. |
| 359 SSLInfo ssl_info; | 359 SSLInfo ssl_info; |
| 360 SSLClientSocket::NextProto protocol_negotiated = | 360 NextProto protocol_negotiated = kProtoUnknown; |
| 361 SSLClientSocket::kProtoUnknown; | |
| 362 stream_->GetSSLInfo(&ssl_info, | 361 stream_->GetSSLInfo(&ssl_info, |
| 363 &response_info_->was_npn_negotiated, | 362 &response_info_->was_npn_negotiated, |
| 364 &protocol_negotiated); | 363 &protocol_negotiated); |
| 365 response_info_->npn_negotiated_protocol = | 364 response_info_->npn_negotiated_protocol = |
| 366 SSLClientSocket::NextProtoToString(protocol_negotiated); | 365 SSLClientSocket::NextProtoToString(protocol_negotiated); |
| 367 response_info_->request_time = stream_->GetRequestTime(); | 366 response_info_->request_time = stream_->GetRequestTime(); |
| 368 response_info_->vary_data.Init(*request_info_, *response_info_->headers); | 367 response_info_->vary_data.Init(*request_info_, *response_info_->headers); |
| 369 // TODO(ahendrickson): This is recorded after the entire SYN_STREAM control | 368 // TODO(ahendrickson): This is recorded after the entire SYN_STREAM control |
| 370 // frame has been received and processed. Move to framer? | 369 // frame has been received and processed. Move to framer? |
| 371 response_info_->response_time = response_time; | 370 response_info_->response_time = response_time; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 | 485 |
| 487 // Since Run may result in being called back, clear user_callback_ in advance. | 486 // Since Run may result in being called back, clear user_callback_ in advance. |
| 488 CompletionCallback c = callback_; | 487 CompletionCallback c = callback_; |
| 489 callback_.Reset(); | 488 callback_.Reset(); |
| 490 c.Run(rv); | 489 c.Run(rv); |
| 491 } | 490 } |
| 492 | 491 |
| 493 void SpdyHttpStream::GetSSLInfo(SSLInfo* ssl_info) { | 492 void SpdyHttpStream::GetSSLInfo(SSLInfo* ssl_info) { |
| 494 DCHECK(stream_); | 493 DCHECK(stream_); |
| 495 bool using_npn; | 494 bool using_npn; |
| 496 SSLClientSocket::NextProto protocol_negotiated = | 495 NextProto protocol_negotiated = kProtoUnknown; |
| 497 SSLClientSocket::kProtoUnknown; | |
| 498 stream_->GetSSLInfo(ssl_info, &using_npn, &protocol_negotiated); | 496 stream_->GetSSLInfo(ssl_info, &using_npn, &protocol_negotiated); |
| 499 } | 497 } |
| 500 | 498 |
| 501 void SpdyHttpStream::GetSSLCertRequestInfo( | 499 void SpdyHttpStream::GetSSLCertRequestInfo( |
| 502 SSLCertRequestInfo* cert_request_info) { | 500 SSLCertRequestInfo* cert_request_info) { |
| 503 DCHECK(stream_); | 501 DCHECK(stream_); |
| 504 stream_->GetSSLCertRequestInfo(cert_request_info); | 502 stream_->GetSSLCertRequestInfo(cert_request_info); |
| 505 } | 503 } |
| 506 | 504 |
| 507 bool SpdyHttpStream::IsSpdyHttpStream() const { | 505 bool SpdyHttpStream::IsSpdyHttpStream() const { |
| 508 return true; | 506 return true; |
| 509 } | 507 } |
| 510 | 508 |
| 511 void SpdyHttpStream::Drain(HttpNetworkSession* session) { | 509 void SpdyHttpStream::Drain(HttpNetworkSession* session) { |
| 512 Close(false); | 510 Close(false); |
| 513 delete this; | 511 delete this; |
| 514 } | 512 } |
| 515 | 513 |
| 516 } // namespace net | 514 } // namespace net |
| OLD | NEW |