| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 closed_stream_sent_bytes_(0), | 43 closed_stream_sent_bytes_(0), |
| 44 request_info_(NULL), | 44 request_info_(NULL), |
| 45 response_info_(NULL), | 45 response_info_(NULL), |
| 46 response_headers_status_(RESPONSE_HEADERS_ARE_INCOMPLETE), | 46 response_headers_status_(RESPONSE_HEADERS_ARE_INCOMPLETE), |
| 47 user_buffer_len_(0), | 47 user_buffer_len_(0), |
| 48 request_body_buf_size_(0), | 48 request_body_buf_size_(0), |
| 49 buffered_read_callback_pending_(false), | 49 buffered_read_callback_pending_(false), |
| 50 more_read_data_pending_(false), | 50 more_read_data_pending_(false), |
| 51 direct_(direct), | 51 direct_(direct), |
| 52 was_alpn_negotiated_(false), | 52 was_alpn_negotiated_(false), |
| 53 negotiated_protocol_(kProtoUnknown), | |
| 54 weak_factory_(this) { | 53 weak_factory_(this) { |
| 55 DCHECK(spdy_session_.get()); | 54 DCHECK(spdy_session_.get()); |
| 56 } | 55 } |
| 57 | 56 |
| 58 SpdyHttpStream::~SpdyHttpStream() { | 57 SpdyHttpStream::~SpdyHttpStream() { |
| 59 if (stream_.get()) { | 58 if (stream_.get()) { |
| 60 stream_->DetachDelegate(); | 59 stream_->DetachDelegate(); |
| 61 DCHECK(!stream_.get()); | 60 DCHECK(!stream_.get()); |
| 62 } | 61 } |
| 63 } | 62 } |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 weak_factory_.GetWeakPtr())); | 442 weak_factory_.GetWeakPtr())); |
| 444 | 443 |
| 445 if (rv != ERR_IO_PENDING) | 444 if (rv != ERR_IO_PENDING) |
| 446 OnRequestBodyReadCompleted(rv); | 445 OnRequestBodyReadCompleted(rv); |
| 447 } | 446 } |
| 448 | 447 |
| 449 void SpdyHttpStream::InitializeStreamHelper() { | 448 void SpdyHttpStream::InitializeStreamHelper() { |
| 450 stream_->SetDelegate(this); | 449 stream_->SetDelegate(this); |
| 451 stream_->GetSSLInfo(&ssl_info_); | 450 stream_->GetSSLInfo(&ssl_info_); |
| 452 was_alpn_negotiated_ = stream_->WasNpnNegotiated(); | 451 was_alpn_negotiated_ = stream_->WasNpnNegotiated(); |
| 453 negotiated_protocol_ = stream_->GetNegotiatedProtocol(); | |
| 454 } | 452 } |
| 455 | 453 |
| 456 void SpdyHttpStream::ResetStreamInternal() { | 454 void SpdyHttpStream::ResetStreamInternal() { |
| 457 spdy_session_->ResetStream(stream()->stream_id(), RST_STREAM_INTERNAL_ERROR, | 455 spdy_session_->ResetStream(stream()->stream_id(), RST_STREAM_INTERNAL_ERROR, |
| 458 std::string()); | 456 std::string()); |
| 459 } | 457 } |
| 460 | 458 |
| 461 void SpdyHttpStream::OnRequestBodyReadCompleted(int status) { | 459 void SpdyHttpStream::OnRequestBodyReadCompleted(int status) { |
| 462 if (status < 0) { | 460 if (status < 0) { |
| 463 DCHECK_NE(ERR_IO_PENDING, status); | 461 DCHECK_NE(ERR_IO_PENDING, status); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP2; | 612 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP2; |
| 615 return; | 613 return; |
| 616 } | 614 } |
| 617 | 615 |
| 618 void SpdyHttpStream::SetPriority(RequestPriority priority) { | 616 void SpdyHttpStream::SetPriority(RequestPriority priority) { |
| 619 // TODO(akalin): Plumb this through to |stream_request_| and | 617 // TODO(akalin): Plumb this through to |stream_request_| and |
| 620 // |stream_|. | 618 // |stream_|. |
| 621 } | 619 } |
| 622 | 620 |
| 623 } // namespace net | 621 } // namespace net |
| OLD | NEW |