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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 | 673 |
674 if (quic_hint.alternate_port <= std::numeric_limits<uint16_t>::min() || | 674 if (quic_hint.alternate_port <= std::numeric_limits<uint16_t>::min() || |
675 quic_hint.alternate_port > std::numeric_limits<uint16_t>::max()) { | 675 quic_hint.alternate_port > std::numeric_limits<uint16_t>::max()) { |
676 LOG(ERROR) << "Invalid QUIC hint alternate port: " | 676 LOG(ERROR) << "Invalid QUIC hint alternate port: " |
677 << quic_hint.alternate_port; | 677 << quic_hint.alternate_port; |
678 continue; | 678 continue; |
679 } | 679 } |
680 | 680 |
681 url::SchemeHostPort quic_server("https", canon_host, quic_hint.port); | 681 url::SchemeHostPort quic_server("https", canon_host, quic_hint.port); |
682 net::AlternativeService alternative_service( | 682 net::AlternativeService alternative_service( |
683 net::AlternateProtocol::QUIC, "", | 683 net::kProtoQUIC, "", static_cast<uint16_t>(quic_hint.alternate_port)); |
684 static_cast<uint16_t>(quic_hint.alternate_port)); | |
685 context_->http_server_properties()->SetAlternativeService( | 684 context_->http_server_properties()->SetAlternativeService( |
686 quic_server, alternative_service, base::Time::Max()); | 685 quic_server, alternative_service, base::Time::Max()); |
687 } | 686 } |
688 } | 687 } |
689 | 688 |
690 // If there is a cert_verifier, then populate its cache with | 689 // If there is a cert_verifier, then populate its cache with |
691 // |cert_verifier_data|. | 690 // |cert_verifier_data|. |
692 if (!config->cert_verifier_data.empty() && context_->cert_verifier()) { | 691 if (!config->cert_verifier_data.empty() && context_->cert_verifier()) { |
693 SCOPED_UMA_HISTOGRAM_TIMER("Net.Cronet.CertVerifierCache.DeserializeTime"); | 692 SCOPED_UMA_HISTOGRAM_TIMER("Net.Cronet.CertVerifierCache.DeserializeTime"); |
694 std::string data; | 693 std::string data; |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 JNIEnv* env, | 1093 JNIEnv* env, |
1095 const JavaParamRef<jclass>& jcaller) { | 1094 const JavaParamRef<jclass>& jcaller) { |
1096 base::StatisticsRecorder::Initialize(); | 1095 base::StatisticsRecorder::Initialize(); |
1097 std::vector<uint8_t> data; | 1096 std::vector<uint8_t> data; |
1098 if (!HistogramManager::GetInstance()->GetDeltas(&data)) | 1097 if (!HistogramManager::GetInstance()->GetDeltas(&data)) |
1099 return ScopedJavaLocalRef<jbyteArray>(); | 1098 return ScopedJavaLocalRef<jbyteArray>(); |
1100 return base::android::ToJavaByteArray(env, &data[0], data.size()); | 1099 return base::android::ToJavaByteArray(env, &data[0], data.size()); |
1101 } | 1100 } |
1102 | 1101 |
1103 } // namespace cronet | 1102 } // namespace cronet |
OLD | NEW |