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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 const QuicCryptoServerConfig* server_config_; | 181 const QuicCryptoServerConfig* server_config_; |
182 }; | 182 }; |
183 | 183 |
184 class TestStrikeRegisterClient : public StrikeRegisterClient { | 184 class TestStrikeRegisterClient : public StrikeRegisterClient { |
185 public: | 185 public: |
186 explicit TestStrikeRegisterClient(QuicCryptoServerConfig* config) | 186 explicit TestStrikeRegisterClient(QuicCryptoServerConfig* config) |
187 : config_(config), | 187 : config_(config), |
188 is_known_orbit_called_(false) { | 188 is_known_orbit_called_(false) { |
189 } | 189 } |
190 | 190 |
191 virtual bool IsKnownOrbit(StringPiece orbit) const OVERRIDE { | 191 virtual bool IsKnownOrbit(StringPiece orbit) const override { |
192 // Ensure that the strike register client lock is not held. | 192 // Ensure that the strike register client lock is not held. |
193 QuicCryptoServerConfigPeer peer(config_); | 193 QuicCryptoServerConfigPeer peer(config_); |
194 base::Lock* m = peer.GetStrikeRegisterClientLock(); | 194 base::Lock* m = peer.GetStrikeRegisterClientLock(); |
195 // In Chromium, we will dead lock if the lock is held by the current thread. | 195 // In Chromium, we will dead lock if the lock is held by the current thread. |
196 // Chromium doesn't have AssertNotHeld API call. | 196 // Chromium doesn't have AssertNotHeld API call. |
197 // m->AssertNotHeld(); | 197 // m->AssertNotHeld(); |
198 base::AutoLock lock(*m); | 198 base::AutoLock lock(*m); |
199 | 199 |
200 is_known_orbit_called_ = true; | 200 is_known_orbit_called_ = true; |
201 return true; | 201 return true; |
202 } | 202 } |
203 | 203 |
204 virtual void VerifyNonceIsValidAndUnique( | 204 virtual void VerifyNonceIsValidAndUnique( |
205 StringPiece nonce, | 205 StringPiece nonce, |
206 QuicWallTime now, | 206 QuicWallTime now, |
207 ResultCallback* cb) OVERRIDE { | 207 ResultCallback* cb) override { |
208 LOG(FATAL) << "Not implemented"; | 208 LOG(FATAL) << "Not implemented"; |
209 } | 209 } |
210 | 210 |
211 bool is_known_orbit_called() { return is_known_orbit_called_; } | 211 bool is_known_orbit_called() { return is_known_orbit_called_; } |
212 | 212 |
213 private: | 213 private: |
214 QuicCryptoServerConfig* config_; | 214 QuicCryptoServerConfig* config_; |
215 mutable bool is_known_orbit_called_; | 215 mutable bool is_known_orbit_called_; |
216 }; | 216 }; |
217 | 217 |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 nullptr); | 660 nullptr); |
661 test_peer_.CheckConfigs( | 661 test_peer_.CheckConfigs( |
662 "a", false, | 662 "a", false, |
663 "b", true, | 663 "b", true, |
664 "c", false, | 664 "c", false, |
665 nullptr); | 665 nullptr); |
666 } | 666 } |
667 | 667 |
668 } // namespace test | 668 } // namespace test |
669 } // namespace net | 669 } // namespace net |
OLD | NEW |