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

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

Issue 2496953002: Revert of Unify enum NextProto and enum AlternateProtocol. (Closed)
Patch Set: Created 4 years, 1 month 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 | net/http/bidirectional_stream_unittest.cc » ('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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::kProtoQUIC, "", static_cast<uint16_t>(quic_hint.alternate_port)); 683 net::AlternateProtocol::QUIC, "",
684 static_cast<uint16_t>(quic_hint.alternate_port));
684 context_->http_server_properties()->SetAlternativeService( 685 context_->http_server_properties()->SetAlternativeService(
685 quic_server, alternative_service, base::Time::Max()); 686 quic_server, alternative_service, base::Time::Max());
686 } 687 }
687 } 688 }
688 689
689 // If there is a cert_verifier, then populate its cache with 690 // If there is a cert_verifier, then populate its cache with
690 // |cert_verifier_data|. 691 // |cert_verifier_data|.
691 if (!config->cert_verifier_data.empty() && context_->cert_verifier()) { 692 if (!config->cert_verifier_data.empty() && context_->cert_verifier()) {
692 SCOPED_UMA_HISTOGRAM_TIMER("Net.Cronet.CertVerifierCache.DeserializeTime"); 693 SCOPED_UMA_HISTOGRAM_TIMER("Net.Cronet.CertVerifierCache.DeserializeTime");
693 std::string data; 694 std::string data;
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 JNIEnv* env, 1094 JNIEnv* env,
1094 const JavaParamRef<jclass>& jcaller) { 1095 const JavaParamRef<jclass>& jcaller) {
1095 base::StatisticsRecorder::Initialize(); 1096 base::StatisticsRecorder::Initialize();
1096 std::vector<uint8_t> data; 1097 std::vector<uint8_t> data;
1097 if (!HistogramManager::GetInstance()->GetDeltas(&data)) 1098 if (!HistogramManager::GetInstance()->GetDeltas(&data))
1098 return ScopedJavaLocalRef<jbyteArray>(); 1099 return ScopedJavaLocalRef<jbyteArray>();
1099 return base::android::ToJavaByteArray(env, &data[0], data.size()); 1100 return base::android::ToJavaByteArray(env, &data[0], data.size());
1100 } 1101 }
1101 1102
1102 } // namespace cronet 1103 } // namespace cronet
OLDNEW
« no previous file with comments | « no previous file | net/http/bidirectional_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698