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/core/crypto/quic_crypto_client_config.h" | 5 #include "net/quic/core/crypto/quic_crypto_client_config.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 scfg_ = std::move(new_scfg_storage); | 186 scfg_ = std::move(new_scfg_storage); |
187 } | 187 } |
188 return SERVER_CONFIG_VALID; | 188 return SERVER_CONFIG_VALID; |
189 } | 189 } |
190 | 190 |
191 void QuicCryptoClientConfig::CachedState::InvalidateServerConfig() { | 191 void QuicCryptoClientConfig::CachedState::InvalidateServerConfig() { |
192 server_config_.clear(); | 192 server_config_.clear(); |
193 scfg_.reset(); | 193 scfg_.reset(); |
194 SetProofInvalid(); | 194 SetProofInvalid(); |
195 std::queue<QuicConnectionId> empty_queue; | 195 std::queue<QuicConnectionId> empty_queue; |
| 196 using std::swap; |
196 swap(server_designated_connection_ids_, empty_queue); | 197 swap(server_designated_connection_ids_, empty_queue); |
197 } | 198 } |
198 | 199 |
199 void QuicCryptoClientConfig::CachedState::SetProof( | 200 void QuicCryptoClientConfig::CachedState::SetProof( |
200 const std::vector<string>& certs, | 201 const std::vector<string>& certs, |
201 QuicStringPiece cert_sct, | 202 QuicStringPiece cert_sct, |
202 QuicStringPiece chlo_hash, | 203 QuicStringPiece chlo_hash, |
203 QuicStringPiece signature) { | 204 QuicStringPiece signature) { |
204 bool has_changed = signature != server_config_sig_ || | 205 bool has_changed = signature != server_config_sig_ || |
205 chlo_hash != chlo_hash_ || certs_.size() != certs.size(); | 206 chlo_hash != chlo_hash_ || certs_.size() != certs.size(); |
(...skipping 24 matching lines...) Expand all Loading... |
230 source_address_token_.clear(); | 231 source_address_token_.clear(); |
231 certs_.clear(); | 232 certs_.clear(); |
232 cert_sct_.clear(); | 233 cert_sct_.clear(); |
233 chlo_hash_.clear(); | 234 chlo_hash_.clear(); |
234 server_config_sig_.clear(); | 235 server_config_sig_.clear(); |
235 server_config_valid_ = false; | 236 server_config_valid_ = false; |
236 proof_verify_details_.reset(); | 237 proof_verify_details_.reset(); |
237 scfg_.reset(); | 238 scfg_.reset(); |
238 ++generation_counter_; | 239 ++generation_counter_; |
239 std::queue<QuicConnectionId> empty_queue; | 240 std::queue<QuicConnectionId> empty_queue; |
| 241 using std::swap; |
240 swap(server_designated_connection_ids_, empty_queue); | 242 swap(server_designated_connection_ids_, empty_queue); |
241 } | 243 } |
242 | 244 |
243 void QuicCryptoClientConfig::CachedState::ClearProof() { | 245 void QuicCryptoClientConfig::CachedState::ClearProof() { |
244 SetProofInvalid(); | 246 SetProofInvalid(); |
245 certs_.clear(); | 247 certs_.clear(); |
246 cert_sct_.clear(); | 248 cert_sct_.clear(); |
247 chlo_hash_.clear(); | 249 chlo_hash_.clear(); |
248 server_config_sig_.clear(); | 250 server_config_sig_.clear(); |
249 } | 251 } |
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 } | 992 } |
991 | 993 |
992 // Update canonical version to point at the "most recent" entry. | 994 // Update canonical version to point at the "most recent" entry. |
993 canonical_server_map_[suffix_server_id] = server_id; | 995 canonical_server_map_[suffix_server_id] = server_id; |
994 | 996 |
995 server_state->InitializeFrom(*canonical_state); | 997 server_state->InitializeFrom(*canonical_state); |
996 return true; | 998 return true; |
997 } | 999 } |
998 | 1000 |
999 } // namespace net | 1001 } // namespace net |
OLD | NEW |