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_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 base::Value* HttpStreamFactoryImpl::PipelineInfoToValue() const { | 182 base::Value* HttpStreamFactoryImpl::PipelineInfoToValue() const { |
183 return http_pipelined_host_pool_.PipelineInfoToValue(); | 183 return http_pipelined_host_pool_.PipelineInfoToValue(); |
184 } | 184 } |
185 | 185 |
186 const HostMappingRules* HttpStreamFactoryImpl::GetHostMappingRules() const { | 186 const HostMappingRules* HttpStreamFactoryImpl::GetHostMappingRules() const { |
187 return session_->params().host_mapping_rules; | 187 return session_->params().host_mapping_rules; |
188 } | 188 } |
189 | 189 |
190 PortAlternateProtocolPair HttpStreamFactoryImpl::GetAlternateProtocolRequestFor( | 190 PortAlternateProtocolPair HttpStreamFactoryImpl::GetAlternateProtocolRequestFor( |
191 const GURL& original_url, | 191 const GURL& original_url, |
192 GURL* alternate_url) { | 192 GURL* alternate_url) const { |
193 if (!use_alternate_protocols()) | 193 if (!use_alternate_protocols()) |
194 return kNoAlternateProtocol; | 194 return kNoAlternateProtocol; |
195 | 195 |
196 if (original_url.SchemeIs("ftp")) | 196 if (original_url.SchemeIs("ftp")) |
197 return kNoAlternateProtocol; | 197 return kNoAlternateProtocol; |
198 | 198 |
199 HostPortPair origin = HostPortPair(original_url.HostNoBrackets(), | 199 HostPortPair origin = HostPortPair(original_url.HostNoBrackets(), |
200 original_url.EffectiveIntPort()); | 200 original_url.EffectiveIntPort()); |
201 | 201 |
202 HttpServerProperties& http_server_properties = | 202 const HttpServerProperties& http_server_properties = |
203 *session_->http_server_properties(); | 203 *session_->http_server_properties(); |
204 if (!http_server_properties.HasAlternateProtocol(origin)) | 204 if (!http_server_properties.HasAlternateProtocol(origin)) |
205 return kNoAlternateProtocol; | 205 return kNoAlternateProtocol; |
206 | 206 |
207 PortAlternateProtocolPair alternate = | 207 PortAlternateProtocolPair alternate = |
208 http_server_properties.GetAlternateProtocol(origin); | 208 http_server_properties.GetAlternateProtocol(origin); |
209 if (alternate.protocol == ALTERNATE_PROTOCOL_BROKEN) | 209 if (alternate.protocol == ALTERNATE_PROTOCOL_BROKEN) |
210 return kNoAlternateProtocol; | 210 return kNoAlternateProtocol; |
211 | 211 |
212 if (!IsAlternateProtocolValid(alternate.protocol)) { | 212 if (!IsAlternateProtocolValid(alternate.protocol)) { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 it != requests_to_fail.end(); ++it) { | 347 it != requests_to_fail.end(); ++it) { |
348 Request* request = *it; | 348 Request* request = *it; |
349 if (request == request_map_[job]) { | 349 if (request == request_map_[job]) { |
350 continue; | 350 continue; |
351 } | 351 } |
352 request->OnStreamFailed(NULL, status, used_ssl_config); | 352 request->OnStreamFailed(NULL, status, used_ssl_config); |
353 } | 353 } |
354 } | 354 } |
355 | 355 |
356 } // namespace net | 356 } // namespace net |
OLD | NEW |