| OLD | NEW |
| 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.h" | 7 #include "base/metrics/histogram.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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 void QuicCryptoClientConfig::DisableEcdsa() { | 874 void QuicCryptoClientConfig::DisableEcdsa() { |
| 875 disable_ecdsa_ = true; | 875 disable_ecdsa_ = true; |
| 876 } | 876 } |
| 877 | 877 |
| 878 bool QuicCryptoClientConfig::PopulateFromCanonicalConfig( | 878 bool QuicCryptoClientConfig::PopulateFromCanonicalConfig( |
| 879 const QuicServerId& server_id, | 879 const QuicServerId& server_id, |
| 880 CachedState* server_state) { | 880 CachedState* server_state) { |
| 881 DCHECK(server_state->IsEmpty()); | 881 DCHECK(server_state->IsEmpty()); |
| 882 size_t i = 0; | 882 size_t i = 0; |
| 883 for (; i < canonical_suffixes_.size(); ++i) { | 883 for (; i < canonical_suffixes_.size(); ++i) { |
| 884 if (EndsWith(server_id.host(), canonical_suffixes_[i], false)) { | 884 if (base::EndsWith(server_id.host(), canonical_suffixes_[i], |
| 885 base::CompareCase::INSENSITIVE_ASCII)) { |
| 885 break; | 886 break; |
| 886 } | 887 } |
| 887 } | 888 } |
| 888 if (i == canonical_suffixes_.size()) { | 889 if (i == canonical_suffixes_.size()) { |
| 889 return false; | 890 return false; |
| 890 } | 891 } |
| 891 | 892 |
| 892 QuicServerId suffix_server_id(canonical_suffixes_[i], server_id.port(), | 893 QuicServerId suffix_server_id(canonical_suffixes_[i], server_id.port(), |
| 893 server_id.is_https(), | 894 server_id.is_https(), |
| 894 server_id.privacy_mode()); | 895 server_id.privacy_mode()); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 907 } | 908 } |
| 908 | 909 |
| 909 // Update canonical version to point at the "most recent" entry. | 910 // Update canonical version to point at the "most recent" entry. |
| 910 canonical_server_map_[suffix_server_id] = server_id; | 911 canonical_server_map_[suffix_server_id] = server_id; |
| 911 | 912 |
| 912 server_state->InitializeFrom(*canonical_state); | 913 server_state->InitializeFrom(*canonical_state); |
| 913 return true; | 914 return true; |
| 914 } | 915 } |
| 915 | 916 |
| 916 } // namespace net | 917 } // namespace net |
| OLD | NEW |