OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/cronet/android/cronet_url_request_context_adapter.h" | 5 #include "components/cronet/android/cronet_url_request_context_adapter.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 #include "net/cert/cert_verifier.h" | 56 #include "net/cert/cert_verifier.h" |
57 #include "net/cookies/cookie_monster.h" | 57 #include "net/cookies/cookie_monster.h" |
58 #include "net/http/http_auth_handler_factory.h" | 58 #include "net/http/http_auth_handler_factory.h" |
59 #include "net/http/http_server_properties_manager.h" | 59 #include "net/http/http_server_properties_manager.h" |
60 #include "net/log/file_net_log_observer.h" | 60 #include "net/log/file_net_log_observer.h" |
61 #include "net/log/net_log_util.h" | 61 #include "net/log/net_log_util.h" |
62 #include "net/nqe/external_estimate_provider.h" | 62 #include "net/nqe/external_estimate_provider.h" |
63 #include "net/nqe/network_qualities_prefs_manager.h" | 63 #include "net/nqe/network_qualities_prefs_manager.h" |
64 #include "net/proxy/proxy_config_service_android.h" | 64 #include "net/proxy/proxy_config_service_android.h" |
65 #include "net/proxy/proxy_service.h" | 65 #include "net/proxy/proxy_service.h" |
66 #include "net/quic/core/quic_versions.h" | |
66 #include "net/sdch/sdch_owner.h" | 67 #include "net/sdch/sdch_owner.h" |
67 #include "net/ssl/channel_id_service.h" | 68 #include "net/ssl/channel_id_service.h" |
68 #include "net/url_request/url_request_context.h" | 69 #include "net/url_request/url_request_context.h" |
69 #include "net/url_request/url_request_context_builder.h" | 70 #include "net/url_request/url_request_context_builder.h" |
70 #include "net/url_request/url_request_interceptor.h" | 71 #include "net/url_request/url_request_interceptor.h" |
71 | 72 |
72 using base::android::JavaParamRef; | 73 using base::android::JavaParamRef; |
73 using base::android::ScopedJavaLocalRef; | 74 using base::android::ScopedJavaLocalRef; |
74 | 75 |
75 namespace { | 76 namespace { |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
756 quic_hint.alternate_port > std::numeric_limits<uint16_t>::max()) { | 757 quic_hint.alternate_port > std::numeric_limits<uint16_t>::max()) { |
757 LOG(ERROR) << "Invalid QUIC hint alternate port: " | 758 LOG(ERROR) << "Invalid QUIC hint alternate port: " |
758 << quic_hint.alternate_port; | 759 << quic_hint.alternate_port; |
759 continue; | 760 continue; |
760 } | 761 } |
761 | 762 |
762 url::SchemeHostPort quic_server("https", canon_host, quic_hint.port); | 763 url::SchemeHostPort quic_server("https", canon_host, quic_hint.port); |
763 net::AlternativeService alternative_service( | 764 net::AlternativeService alternative_service( |
764 net::kProtoQUIC, "", static_cast<uint16_t>(quic_hint.alternate_port)); | 765 net::kProtoQUIC, "", static_cast<uint16_t>(quic_hint.alternate_port)); |
765 context_->http_server_properties()->SetAlternativeService( | 766 context_->http_server_properties()->SetAlternativeService( |
766 quic_server, alternative_service, base::Time::Max()); | 767 quic_server, alternative_service, base::Time::Max(), |
768 QuicVersionVector()); | |
Ryan Hamilton
2017/06/07 20:52:23
Would QuicSupportedVersions() be a better choice h
Zhongyi Shi
2017/06/08 23:11:16
Originally, an empty list should work, as the vers
| |
767 } | 769 } |
768 } | 770 } |
769 | 771 |
770 // If there is a cert_verifier, then populate its cache with | 772 // If there is a cert_verifier, then populate its cache with |
771 // |cert_verifier_data|. | 773 // |cert_verifier_data|. |
772 if (!config->cert_verifier_data.empty() && context_->cert_verifier()) { | 774 if (!config->cert_verifier_data.empty() && context_->cert_verifier()) { |
773 SCOPED_UMA_HISTOGRAM_TIMER("Net.Cronet.CertVerifierCache.DeserializeTime"); | 775 SCOPED_UMA_HISTOGRAM_TIMER("Net.Cronet.CertVerifierCache.DeserializeTime"); |
774 std::string data; | 776 std::string data; |
775 cronet_pb::CertVerificationCache cert_verification_cache; | 777 cronet_pb::CertVerificationCache cert_verification_cache; |
776 if (base::Base64Decode(config->cert_verifier_data, &data) && | 778 if (base::Base64Decode(config->cert_verifier_data, &data) && |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1175 JNIEnv* env, | 1177 JNIEnv* env, |
1176 const JavaParamRef<jclass>& jcaller) { | 1178 const JavaParamRef<jclass>& jcaller) { |
1177 DCHECK(base::StatisticsRecorder::IsActive()); | 1179 DCHECK(base::StatisticsRecorder::IsActive()); |
1178 std::vector<uint8_t> data; | 1180 std::vector<uint8_t> data; |
1179 if (!HistogramManager::GetInstance()->GetDeltas(&data)) | 1181 if (!HistogramManager::GetInstance()->GetDeltas(&data)) |
1180 return ScopedJavaLocalRef<jbyteArray>(); | 1182 return ScopedJavaLocalRef<jbyteArray>(); |
1181 return base::android::ToJavaByteArray(env, &data[0], data.size()); | 1183 return base::android::ToJavaByteArray(env, &data[0], data.size()); |
1182 } | 1184 } |
1183 | 1185 |
1184 } // namespace cronet | 1186 } // namespace cronet |
OLD | NEW |