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

Side by Side Diff: net/quic/crypto/quic_crypto_client_config.cc

Issue 1239493005: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "net/quic/crypto/quic_crypto_client_config.h" 5 #include "net/quic/crypto/quic_crypto_client_config.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/metrics/sparse_histogram.h" 8 #include "base/metrics/sparse_histogram.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 void QuicCryptoClientConfig::DisableEcdsa() { 897 void QuicCryptoClientConfig::DisableEcdsa() {
898 disable_ecdsa_ = true; 898 disable_ecdsa_ = true;
899 } 899 }
900 900
901 bool QuicCryptoClientConfig::PopulateFromCanonicalConfig( 901 bool QuicCryptoClientConfig::PopulateFromCanonicalConfig(
902 const QuicServerId& server_id, 902 const QuicServerId& server_id,
903 CachedState* server_state) { 903 CachedState* server_state) {
904 DCHECK(server_state->IsEmpty()); 904 DCHECK(server_state->IsEmpty());
905 size_t i = 0; 905 size_t i = 0;
906 for (; i < canonical_suffixes_.size(); ++i) { 906 for (; i < canonical_suffixes_.size(); ++i) {
907 if (base::EndsWith(server_id.host(), canonical_suffixes_[i], false)) { 907 if (base::EndsWith(server_id.host(), canonical_suffixes_[i],
908 base::CompareCase::INSENSITIVE_ASCII)) {
908 break; 909 break;
909 } 910 }
910 } 911 }
911 if (i == canonical_suffixes_.size()) { 912 if (i == canonical_suffixes_.size()) {
912 return false; 913 return false;
913 } 914 }
914 915
915 QuicServerId suffix_server_id(canonical_suffixes_[i], server_id.port(), 916 QuicServerId suffix_server_id(canonical_suffixes_[i], server_id.port(),
916 server_id.is_https(), 917 server_id.is_https(),
917 server_id.privacy_mode()); 918 server_id.privacy_mode());
(...skipping 12 matching lines...) Expand all
930 } 931 }
931 932
932 // Update canonical version to point at the "most recent" entry. 933 // Update canonical version to point at the "most recent" entry.
933 canonical_server_map_[suffix_server_id] = server_id; 934 canonical_server_map_[suffix_server_id] = server_id;
934 935
935 server_state->InitializeFrom(*canonical_state); 936 server_state->InitializeFrom(*canonical_state);
936 return true; 937 return true;
937 } 938 }
938 939
939 } // namespace net 940 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698