OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_stream_factory_impl_job.h" | 5 #include "net/http/http_stream_factory_impl_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 | 1130 |
1131 bool HttpStreamFactoryImpl::Job::IsPreconnecting() const { | 1131 bool HttpStreamFactoryImpl::Job::IsPreconnecting() const { |
1132 DCHECK_GE(num_streams_, 0); | 1132 DCHECK_GE(num_streams_, 0); |
1133 return num_streams_ > 0; | 1133 return num_streams_ > 0; |
1134 } | 1134 } |
1135 | 1135 |
1136 bool HttpStreamFactoryImpl::Job::IsOrphaned() const { | 1136 bool HttpStreamFactoryImpl::Job::IsOrphaned() const { |
1137 return !IsPreconnecting() && !request_; | 1137 return !IsPreconnecting() && !request_; |
1138 } | 1138 } |
1139 | 1139 |
1140 bool HttpStreamFactoryImpl::Job::IsRequestEligibleForPipelining() const { | 1140 bool HttpStreamFactoryImpl::Job::IsRequestEligibleForPipelining() { |
1141 if (!HttpStreamFactory::http_pipelining_enabled()) { | 1141 if (!HttpStreamFactory::http_pipelining_enabled()) { |
1142 return false; | 1142 return false; |
1143 } | 1143 } |
1144 if (IsPreconnecting() || !request_) { | 1144 if (IsPreconnecting() || !request_) { |
1145 return false; | 1145 return false; |
1146 } | 1146 } |
1147 if (using_ssl_) { | 1147 if (using_ssl_) { |
1148 return false; | 1148 return false; |
1149 } | 1149 } |
1150 return request_info_.method == "GET" || request_info_.method == "HEAD"; | 1150 if (request_info_.method != "GET" && request_info_.method != "HEAD") { |
| 1151 return false; |
| 1152 } |
| 1153 return stream_factory_->http_pipelined_host_pool_.IsHostEligibleForPipelining( |
| 1154 origin_); |
1151 } | 1155 } |
1152 | 1156 |
1153 } // namespace net | 1157 } // namespace net |
OLD | NEW |