| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_controller.h" | 5 #include "net/http/http_stream_factory_impl_job_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 HttpStreamFactoryImpl::JobController::GetAlternativeServiceFor( | 845 HttpStreamFactoryImpl::JobController::GetAlternativeServiceFor( |
| 846 const HttpRequestInfo& request_info, | 846 const HttpRequestInfo& request_info, |
| 847 HttpStreamRequest::Delegate* delegate, | 847 HttpStreamRequest::Delegate* delegate, |
| 848 HttpStreamRequest::StreamType stream_type) { | 848 HttpStreamRequest::StreamType stream_type) { |
| 849 AlternativeService alternative_service = | 849 AlternativeService alternative_service = |
| 850 GetAlternativeServiceForInternal(request_info, delegate, stream_type); | 850 GetAlternativeServiceForInternal(request_info, delegate, stream_type); |
| 851 AlternativeServiceType type; | 851 AlternativeServiceType type; |
| 852 if (alternative_service.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) { | 852 if (alternative_service.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) { |
| 853 type = NO_ALTERNATIVE_SERVICE; | 853 type = NO_ALTERNATIVE_SERVICE; |
| 854 } else if (alternative_service.protocol == QUIC) { | 854 } else if (alternative_service.protocol == QUIC) { |
| 855 if (request_info.url.host() == alternative_service.host) { | 855 if (request_info.url.host_piece() == alternative_service.host) { |
| 856 type = QUIC_SAME_DESTINATION; | 856 type = QUIC_SAME_DESTINATION; |
| 857 } else { | 857 } else { |
| 858 type = QUIC_DIFFERENT_DESTINATION; | 858 type = QUIC_DIFFERENT_DESTINATION; |
| 859 } | 859 } |
| 860 } else { | 860 } else { |
| 861 if (request_info.url.host() == alternative_service.host) { | 861 if (request_info.url.host_piece() == alternative_service.host) { |
| 862 type = NOT_QUIC_SAME_DESTINATION; | 862 type = NOT_QUIC_SAME_DESTINATION; |
| 863 } else { | 863 } else { |
| 864 type = NOT_QUIC_DIFFERENT_DESTINATION; | 864 type = NOT_QUIC_DIFFERENT_DESTINATION; |
| 865 } | 865 } |
| 866 } | 866 } |
| 867 UMA_HISTOGRAM_ENUMERATION("Net.AlternativeServiceTypeForRequest", type, | 867 UMA_HISTOGRAM_ENUMERATION("Net.AlternativeServiceTypeForRequest", type, |
| 868 MAX_ALTERNATIVE_SERVICE_TYPE); | 868 MAX_ALTERNATIVE_SERVICE_TYPE); |
| 869 return alternative_service; | 869 return alternative_service; |
| 870 } | 870 } |
| 871 | 871 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 } | 1073 } |
| 1074 | 1074 |
| 1075 void HttpStreamFactoryImpl::JobController::StartAlternativeProxyServerJob() { | 1075 void HttpStreamFactoryImpl::JobController::StartAlternativeProxyServerJob() { |
| 1076 if (!alternative_job_ || !request_) | 1076 if (!alternative_job_ || !request_) |
| 1077 return; | 1077 return; |
| 1078 DCHECK(alternative_job_->alternative_proxy_server().is_valid()); | 1078 DCHECK(alternative_job_->alternative_proxy_server().is_valid()); |
| 1079 alternative_job_->Start(request_->stream_type()); | 1079 alternative_job_->Start(request_->stream_type()); |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 } // namespace net | 1082 } // namespace net |
| OLD | NEW |