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_server_config.h" | 5 #include "net/quic/crypto/quic_crypto_server_config.h" |
6 | 6 |
7 #include <stdarg.h> | 7 #include <stdarg.h> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" | 10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 const QuicCryptoServerConfig* server_config_; | 200 const QuicCryptoServerConfig* server_config_; |
201 }; | 201 }; |
202 | 202 |
203 class TestStrikeRegisterClient : public StrikeRegisterClient { | 203 class TestStrikeRegisterClient : public StrikeRegisterClient { |
204 public: | 204 public: |
205 explicit TestStrikeRegisterClient(QuicCryptoServerConfig* config) | 205 explicit TestStrikeRegisterClient(QuicCryptoServerConfig* config) |
206 : config_(config), | 206 : config_(config), |
207 is_known_orbit_called_(false) { | 207 is_known_orbit_called_(false) { |
208 } | 208 } |
209 | 209 |
210 virtual bool IsKnownOrbit(StringPiece orbit) const override { | 210 bool IsKnownOrbit(StringPiece orbit) const override { |
211 // Ensure that the strike register client lock is not held. | 211 // Ensure that the strike register client lock is not held. |
212 QuicCryptoServerConfigPeer peer(config_); | 212 QuicCryptoServerConfigPeer peer(config_); |
213 base::Lock* m = peer.GetStrikeRegisterClientLock(); | 213 base::Lock* m = peer.GetStrikeRegisterClientLock(); |
214 // In Chromium, we will dead lock if the lock is held by the current thread. | 214 // In Chromium, we will dead lock if the lock is held by the current thread. |
215 // Chromium doesn't have AssertNotHeld API call. | 215 // Chromium doesn't have AssertNotHeld API call. |
216 // m->AssertNotHeld(); | 216 // m->AssertNotHeld(); |
217 base::AutoLock lock(*m); | 217 base::AutoLock lock(*m); |
218 | 218 |
219 is_known_orbit_called_ = true; | 219 is_known_orbit_called_ = true; |
220 return true; | 220 return true; |
221 } | 221 } |
222 | 222 |
223 virtual void VerifyNonceIsValidAndUnique( | 223 void VerifyNonceIsValidAndUnique(StringPiece nonce, |
224 StringPiece nonce, | 224 QuicWallTime now, |
225 QuicWallTime now, | 225 ResultCallback* cb) override { |
226 ResultCallback* cb) override { | |
227 LOG(FATAL) << "Not implemented"; | 226 LOG(FATAL) << "Not implemented"; |
228 } | 227 } |
229 | 228 |
230 bool is_known_orbit_called() { return is_known_orbit_called_; } | 229 bool is_known_orbit_called() { return is_known_orbit_called_; } |
231 | 230 |
232 private: | 231 private: |
233 QuicCryptoServerConfig* config_; | 232 QuicCryptoServerConfig* config_; |
234 mutable bool is_known_orbit_called_; | 233 mutable bool is_known_orbit_called_; |
235 }; | 234 }; |
236 | 235 |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 nullptr); | 695 nullptr); |
697 test_peer_.CheckConfigs( | 696 test_peer_.CheckConfigs( |
698 "a", false, | 697 "a", false, |
699 "b", true, | 698 "b", true, |
700 "c", false, | 699 "c", false, |
701 nullptr); | 700 nullptr); |
702 } | 701 } |
703 | 702 |
704 } // namespace test | 703 } // namespace test |
705 } // namespace net | 704 } // namespace net |
OLD | NEW |