| 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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 (EndsWith(server_id.host(), canonical_suffixes_[i], false)) { | 907 if (base::EndsWith(server_id.host(), canonical_suffixes_[i], false)) { |
| 908 break; | 908 break; |
| 909 } | 909 } |
| 910 } | 910 } |
| 911 if (i == canonical_suffixes_.size()) { | 911 if (i == canonical_suffixes_.size()) { |
| 912 return false; | 912 return false; |
| 913 } | 913 } |
| 914 | 914 |
| 915 QuicServerId suffix_server_id(canonical_suffixes_[i], server_id.port(), | 915 QuicServerId suffix_server_id(canonical_suffixes_[i], server_id.port(), |
| 916 server_id.is_https(), | 916 server_id.is_https(), |
| 917 server_id.privacy_mode()); | 917 server_id.privacy_mode()); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 930 } | 930 } |
| 931 | 931 |
| 932 // Update canonical version to point at the "most recent" entry. | 932 // Update canonical version to point at the "most recent" entry. |
| 933 canonical_server_map_[suffix_server_id] = server_id; | 933 canonical_server_map_[suffix_server_id] = server_id; |
| 934 | 934 |
| 935 server_state->InitializeFrom(*canonical_state); | 935 server_state->InitializeFrom(*canonical_state); |
| 936 return true; | 936 return true; |
| 937 } | 937 } |
| 938 | 938 |
| 939 } // namespace net | 939 } // namespace net |
| OLD | NEW |