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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 if (pipeline_id > 1) { | 643 if (pipeline_id > 1) { |
644 return true; | 644 return true; |
645 } | 645 } |
646 ClientSocketHandle::SocketReuseType reuse_type = connection_->reuse_type(); | 646 ClientSocketHandle::SocketReuseType reuse_type = connection_->reuse_type(); |
647 return connection_->is_reused() || | 647 return connection_->is_reused() || |
648 reuse_type == ClientSocketHandle::UNUSED_IDLE; | 648 reuse_type == ClientSocketHandle::UNUSED_IDLE; |
649 } | 649 } |
650 | 650 |
651 void HttpPipelinedConnectionImpl::SetConnectionReused(int pipeline_id) { | 651 void HttpPipelinedConnectionImpl::SetConnectionReused(int pipeline_id) { |
652 CHECK(ContainsKey(stream_info_map_, pipeline_id)); | 652 CHECK(ContainsKey(stream_info_map_, pipeline_id)); |
653 connection_->set_is_reused(true); | 653 connection_->set_reuse_type(ClientSocketHandle::REUSED_IDLE); |
654 } | 654 } |
655 | 655 |
656 int64 HttpPipelinedConnectionImpl::GetTotalReceivedBytes( | 656 int64 HttpPipelinedConnectionImpl::GetTotalReceivedBytes( |
657 int pipeline_id) const { | 657 int pipeline_id) const { |
658 CHECK(ContainsKey(stream_info_map_, pipeline_id)); | 658 CHECK(ContainsKey(stream_info_map_, pipeline_id)); |
659 if (stream_info_map_.find(pipeline_id)->second.parser.get()) | 659 if (stream_info_map_.find(pipeline_id)->second.parser.get()) |
660 return stream_info_map_.find(pipeline_id)->second.parser->received_bytes(); | 660 return stream_info_map_.find(pipeline_id)->second.parser->received_bytes(); |
661 return 0; | 661 return 0; |
662 } | 662 } |
663 | 663 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 } | 837 } |
838 | 838 |
839 HttpPipelinedConnectionImpl::StreamInfo::StreamInfo() | 839 HttpPipelinedConnectionImpl::StreamInfo::StreamInfo() |
840 : state(STREAM_CREATED) { | 840 : state(STREAM_CREATED) { |
841 } | 841 } |
842 | 842 |
843 HttpPipelinedConnectionImpl::StreamInfo::~StreamInfo() { | 843 HttpPipelinedConnectionImpl::StreamInfo::~StreamInfo() { |
844 } | 844 } |
845 | 845 |
846 } // namespace net | 846 } // namespace net |
OLD | NEW |