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/http/http_pipelined_connection_impl.h" | 5 #include "net/http/http_pipelined_connection_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 int pipeline_id, | 673 int pipeline_id, |
674 SSLCertRequestInfo* cert_request_info) { | 674 SSLCertRequestInfo* cert_request_info) { |
675 CHECK(ContainsKey(stream_info_map_, pipeline_id)); | 675 CHECK(ContainsKey(stream_info_map_, pipeline_id)); |
676 CHECK(stream_info_map_[pipeline_id].parser.get()); | 676 CHECK(stream_info_map_[pipeline_id].parser.get()); |
677 stream_info_map_[pipeline_id].parser->GetSSLCertRequestInfo( | 677 stream_info_map_[pipeline_id].parser->GetSSLCertRequestInfo( |
678 cert_request_info); | 678 cert_request_info); |
679 } | 679 } |
680 | 680 |
681 void HttpPipelinedConnectionImpl::Drain(HttpPipelinedStream* stream, | 681 void HttpPipelinedConnectionImpl::Drain(HttpPipelinedStream* stream, |
682 HttpNetworkSession* session) { | 682 HttpNetworkSession* session) { |
683 HttpResponseHeaders* headers = stream->GetResponseInfo()->headers; | 683 HttpResponseHeaders* headers = stream->GetResponseInfo()->headers.get(); |
684 if (!stream->CanFindEndOfResponse() || headers->IsChunkEncoded() || | 684 if (!stream->CanFindEndOfResponse() || headers->IsChunkEncoded() || |
685 !usable_) { | 685 !usable_) { |
686 // TODO(simonjam): Drain chunk-encoded responses if they're relatively | 686 // TODO(simonjam): Drain chunk-encoded responses if they're relatively |
687 // common. | 687 // common. |
688 stream->Close(true); | 688 stream->Close(true); |
689 delete stream; | 689 delete stream; |
690 return; | 690 return; |
691 } | 691 } |
692 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(stream); | 692 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(stream); |
693 drainer->StartWithSize(session, headers->GetContentLength()); | 693 drainer->StartWithSize(session, headers->GetContentLength()); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 } | 832 } |
833 | 833 |
834 HttpPipelinedConnectionImpl::StreamInfo::StreamInfo() | 834 HttpPipelinedConnectionImpl::StreamInfo::StreamInfo() |
835 : state(STREAM_CREATED) { | 835 : state(STREAM_CREATED) { |
836 } | 836 } |
837 | 837 |
838 HttpPipelinedConnectionImpl::StreamInfo::~StreamInfo() { | 838 HttpPipelinedConnectionImpl::StreamInfo::~StreamInfo() { |
839 } | 839 } |
840 | 840 |
841 } // namespace net | 841 } // namespace net |
OLD | NEW |