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

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

Issue 1878143005: SHP 4: Change AlternativeServiceMap to use SchemeHostPort as the key. No change to Pref data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SHP_3
Patch Set: fix cronet && SpdyNetworkTransactionUnittests Created 4 years, 8 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
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 #include <map> 10 #include <map>
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 continue; 595 continue;
596 } 596 }
597 597
598 if (quic_hint.alternate_port <= std::numeric_limits<uint16_t>::min() || 598 if (quic_hint.alternate_port <= std::numeric_limits<uint16_t>::min() ||
599 quic_hint.alternate_port > std::numeric_limits<uint16_t>::max()) { 599 quic_hint.alternate_port > std::numeric_limits<uint16_t>::max()) {
600 LOG(ERROR) << "Invalid QUIC hint alternate port: " 600 LOG(ERROR) << "Invalid QUIC hint alternate port: "
601 << quic_hint.alternate_port; 601 << quic_hint.alternate_port;
602 continue; 602 continue;
603 } 603 }
604 604
605 net::HostPortPair quic_hint_host_port_pair(canon_host, 605 url::SchemeHostPort quic_server("https", canon_host, quic_hint.port);
606 quic_hint.port);
607 net::AlternativeService alternative_service( 606 net::AlternativeService alternative_service(
608 net::AlternateProtocol::QUIC, "", 607 net::AlternateProtocol::QUIC, "",
609 static_cast<uint16_t>(quic_hint.alternate_port)); 608 static_cast<uint16_t>(quic_hint.alternate_port));
610 context_->http_server_properties()->SetAlternativeService( 609 context_->http_server_properties()->SetAlternativeService(
611 quic_hint_host_port_pair, alternative_service, base::Time::Max()); 610 quic_server, alternative_service, base::Time::Max());
612 } 611 }
613 } 612 }
614 613
615 // Iterate through PKP configuration for every host. 614 // Iterate through PKP configuration for every host.
616 for (const auto& pkp : config->pkp_list) { 615 for (const auto& pkp : config->pkp_list) {
617 // Add the host pinning. 616 // Add the host pinning.
618 context_->transport_security_state()->AddHPKP( 617 context_->transport_security_state()->AddHPKP(
619 pkp->host, pkp->expiration_date, pkp->include_subdomains, 618 pkp->host, pkp->expiration_date, pkp->include_subdomains,
620 pkp->pin_hashes, GURL::EmptyGURL()); 619 pkp->pin_hashes, GURL::EmptyGURL());
621 } 620 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 JNIEnv* env, 884 JNIEnv* env,
886 const JavaParamRef<jclass>& jcaller) { 885 const JavaParamRef<jclass>& jcaller) {
887 base::StatisticsRecorder::Initialize(); 886 base::StatisticsRecorder::Initialize();
888 std::vector<uint8_t> data; 887 std::vector<uint8_t> data;
889 if (!HistogramManager::GetInstance()->GetDeltas(&data)) 888 if (!HistogramManager::GetInstance()->GetDeltas(&data))
890 return ScopedJavaLocalRef<jbyteArray>(); 889 return ScopedJavaLocalRef<jbyteArray>();
891 return base::android::ToJavaByteArray(env, &data[0], data.size()); 890 return base::android::ToJavaByteArray(env, &data[0], data.size());
892 } 891 }
893 892
894 } // namespace cronet 893 } // namespace cronet
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/url_request_context_adapter.cc » ('j') | components/cronet/ios/cronet_environment.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698