| 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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 } | 855 } |
| 856 | 856 |
| 857 void HttpStreamFactoryImpl::JobController::ReportBrokenAlternativeService() { | 857 void HttpStreamFactoryImpl::JobController::ReportBrokenAlternativeService() { |
| 858 DCHECK(failed_alternative_service_.protocol != kProtoUnknown || | 858 DCHECK(failed_alternative_service_.protocol != kProtoUnknown || |
| 859 failed_alternative_proxy_server_.is_valid()); | 859 failed_alternative_proxy_server_.is_valid()); |
| 860 DCHECK_NE(OK, alternative_job_net_error_); | 860 DCHECK_NE(OK, alternative_job_net_error_); |
| 861 | 861 |
| 862 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.AlternateServiceFailed", | 862 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.AlternateServiceFailed", |
| 863 -alternative_job_net_error_); | 863 -alternative_job_net_error_); |
| 864 | 864 |
| 865 if (session_->params().quic_do_not_mark_as_broken_on_network_change && | 865 if (alternative_job_net_error_ == ERR_NETWORK_CHANGED || |
| 866 (alternative_job_net_error_ == ERR_NETWORK_CHANGED || | 866 alternative_job_net_error_ == ERR_INTERNET_DISCONNECTED) { |
| 867 alternative_job_net_error_ == ERR_INTERNET_DISCONNECTED)) { | |
| 868 // No need to mark alternative service or proxy as broken. | 867 // No need to mark alternative service or proxy as broken. |
| 869 return; | 868 return; |
| 870 } | 869 } |
| 871 | 870 |
| 872 if (failed_alternative_proxy_server_.is_valid()) { | 871 if (failed_alternative_proxy_server_.is_valid()) { |
| 873 ProxyDelegate* proxy_delegate = session_->params().proxy_delegate; | 872 ProxyDelegate* proxy_delegate = session_->params().proxy_delegate; |
| 874 if (proxy_delegate) { | 873 if (proxy_delegate) { |
| 875 proxy_delegate->OnAlternativeProxyBroken( | 874 proxy_delegate->OnAlternativeProxyBroken( |
| 876 failed_alternative_proxy_server_); | 875 failed_alternative_proxy_server_); |
| 877 } | 876 } |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 return; | 1128 return; |
| 1130 DCHECK(alternative_job_->alternative_proxy_server().is_valid()); | 1129 DCHECK(alternative_job_->alternative_proxy_server().is_valid()); |
| 1131 alternative_job_->Start(request_->stream_type()); | 1130 alternative_job_->Start(request_->stream_type()); |
| 1132 } | 1131 } |
| 1133 | 1132 |
| 1134 bool HttpStreamFactoryImpl::JobController::IsJobOrphaned(Job* job) const { | 1133 bool HttpStreamFactoryImpl::JobController::IsJobOrphaned(Job* job) const { |
| 1135 return !request_ || (job_bound_ && bound_job_ != job); | 1134 return !request_ || (job_bound_ && bound_job_ != job); |
| 1136 } | 1135 } |
| 1137 | 1136 |
| 1138 } // namespace net | 1137 } // namespace net |
| OLD | NEW |