Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: components/cronet/android/cronet_url_request_context_adapter.cc

Issue 2901093004: Add and persist a new field in AlternativeServiceInfo to list QUIC verisons advertised (Closed)
Patch Set: fix Canonical test Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/cronet/ios/cronet_environment.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
56 #include "net/cookies/cookie_monster.h" 56 #include "net/cookies/cookie_monster.h"
57 #include "net/http/http_auth_handler_factory.h" 57 #include "net/http/http_auth_handler_factory.h"
58 #include "net/http/http_server_properties_manager.h" 58 #include "net/http/http_server_properties_manager.h"
59 #include "net/log/file_net_log_observer.h" 59 #include "net/log/file_net_log_observer.h"
60 #include "net/log/net_log_util.h" 60 #include "net/log/net_log_util.h"
61 #include "net/nqe/external_estimate_provider.h" 61 #include "net/nqe/external_estimate_provider.h"
62 #include "net/nqe/network_qualities_prefs_manager.h" 62 #include "net/nqe/network_qualities_prefs_manager.h"
63 #include "net/nqe/network_quality_estimator_params.h" 63 #include "net/nqe/network_quality_estimator_params.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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 quic_hint->alternate_port > std::numeric_limits<uint16_t>::max()) { 752 quic_hint->alternate_port > std::numeric_limits<uint16_t>::max()) {
752 LOG(ERROR) << "Invalid QUIC hint alternate port: " 753 LOG(ERROR) << "Invalid QUIC hint alternate port: "
753 << quic_hint->alternate_port; 754 << quic_hint->alternate_port;
754 continue; 755 continue;
755 } 756 }
756 757
757 url::SchemeHostPort quic_server("https", canon_host, quic_hint->port); 758 url::SchemeHostPort quic_server("https", canon_host, quic_hint->port);
758 net::AlternativeService alternative_service( 759 net::AlternativeService alternative_service(
759 net::kProtoQUIC, "", 760 net::kProtoQUIC, "",
760 static_cast<uint16_t>(quic_hint->alternate_port)); 761 static_cast<uint16_t>(quic_hint->alternate_port));
761 context_->http_server_properties()->SetAlternativeService( 762 context_->http_server_properties()->SetQuicAlternativeService(
762 quic_server, alternative_service, base::Time::Max()); 763 quic_server, alternative_service, base::Time::Max(),
764 net::QuicVersionVector());
763 } 765 }
764 } 766 }
765 767
766 // If there is a cert_verifier, then populate its cache with 768 // If there is a cert_verifier, then populate its cache with
767 // |cert_verifier_data|. 769 // |cert_verifier_data|.
768 if (!config->cert_verifier_data.empty() && context_->cert_verifier()) { 770 if (!config->cert_verifier_data.empty() && context_->cert_verifier()) {
769 SCOPED_UMA_HISTOGRAM_TIMER("Net.Cronet.CertVerifierCache.DeserializeTime"); 771 SCOPED_UMA_HISTOGRAM_TIMER("Net.Cronet.CertVerifierCache.DeserializeTime");
770 std::string data; 772 std::string data;
771 cronet_pb::CertVerificationCache cert_verification_cache; 773 cronet_pb::CertVerificationCache cert_verification_cache;
772 if (base::Base64Decode(config->cert_verifier_data, &data) && 774 if (base::Base64Decode(config->cert_verifier_data, &data) &&
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 JNIEnv* env, 1173 JNIEnv* env,
1172 const JavaParamRef<jclass>& jcaller) { 1174 const JavaParamRef<jclass>& jcaller) {
1173 DCHECK(base::StatisticsRecorder::IsActive()); 1175 DCHECK(base::StatisticsRecorder::IsActive());
1174 std::vector<uint8_t> data; 1176 std::vector<uint8_t> data;
1175 if (!HistogramManager::GetInstance()->GetDeltas(&data)) 1177 if (!HistogramManager::GetInstance()->GetDeltas(&data))
1176 return ScopedJavaLocalRef<jbyteArray>(); 1178 return ScopedJavaLocalRef<jbyteArray>();
1177 return base::android::ToJavaByteArray(env, &data[0], data.size()); 1179 return base::android::ToJavaByteArray(env, &data[0], data.size());
1178 } 1180 }
1179 1181
1180 } // namespace cronet 1182 } // namespace cronet
OLDNEW
« no previous file with comments | « no previous file | components/cronet/ios/cronet_environment.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698