| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 return kNoAlternateProtocol; | 183 return kNoAlternateProtocol; |
| 184 | 184 |
| 185 HostPortPair origin = HostPortPair::FromURL(original_url); | 185 HostPortPair origin = HostPortPair::FromURL(original_url); |
| 186 HttpServerProperties& http_server_properties = | 186 HttpServerProperties& http_server_properties = |
| 187 *session_->http_server_properties(); | 187 *session_->http_server_properties(); |
| 188 const AlternateProtocolInfo alternate = | 188 const AlternateProtocolInfo alternate = |
| 189 http_server_properties.GetAlternateProtocol(origin); | 189 http_server_properties.GetAlternateProtocol(origin); |
| 190 | 190 |
| 191 if (alternate.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) | 191 if (alternate.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) |
| 192 return kNoAlternateProtocol; | 192 return kNoAlternateProtocol; |
| 193 const AlternativeService alternative_service(alternate.protocol, | 193 if (alternate.is_broken) { |
| 194 origin.host(), alternate.port); | |
| 195 if (http_server_properties.IsAlternativeServiceBroken(alternative_service)) { | |
| 196 HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_BROKEN); | 194 HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_BROKEN); |
| 197 return kNoAlternateProtocol; | 195 return kNoAlternateProtocol; |
| 198 } | 196 } |
| 199 if (!IsAlternateProtocolValid(alternate.protocol)) { | 197 if (!IsAlternateProtocolValid(alternate.protocol)) { |
| 200 NOTREACHED(); | 198 NOTREACHED(); |
| 201 return kNoAlternateProtocol; | 199 return kNoAlternateProtocol; |
| 202 } | 200 } |
| 203 | 201 |
| 204 // Some shared unix systems may have user home directories (like | 202 // Some shared unix systems may have user home directories (like |
| 205 // http://foo.com/~mike) which allow users to emit headers. This is a bad | 203 // http://foo.com/~mike) which allow users to emit headers. This is a bad |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 delete job; | 294 delete job; |
| 297 } | 295 } |
| 298 | 296 |
| 299 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { | 297 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { |
| 300 preconnect_job_set_.erase(job); | 298 preconnect_job_set_.erase(job); |
| 301 delete job; | 299 delete job; |
| 302 OnPreconnectsCompleteInternal(); | 300 OnPreconnectsCompleteInternal(); |
| 303 } | 301 } |
| 304 | 302 |
| 305 } // namespace net | 303 } // namespace net |
| OLD | NEW |