| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_QUIC_CRYPTO_LOCAL_STRIKE_REGISTER_CLIENT_H_ | |
| 6 #define NET_QUIC_CRYPTO_LOCAL_STRIKE_REGISTER_CLIENT_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/strings/string_piece.h" | |
| 12 #include "base/synchronization/lock.h" | |
| 13 #include "net/base/net_export.h" | |
| 14 #include "net/quic/crypto/strike_register.h" | |
| 15 #include "net/quic/crypto/strike_register_client.h" | |
| 16 #include "net/quic/quic_time.h" | |
| 17 | |
| 18 namespace net { | |
| 19 | |
| 20 // StrikeRegisterClient implementation that wraps a local in-memory | |
| 21 // strike register. | |
| 22 class NET_EXPORT_PRIVATE LocalStrikeRegisterClient | |
| 23 : public StrikeRegisterClient { | |
| 24 public: | |
| 25 LocalStrikeRegisterClient(unsigned max_entries, | |
| 26 uint32_t current_time_external, | |
| 27 uint32_t window_secs, | |
| 28 const uint8_t orbit[8], | |
| 29 StrikeRegister::StartupType startup); | |
| 30 | |
| 31 bool IsKnownOrbit(base::StringPiece orbit) const override; | |
| 32 void VerifyNonceIsValidAndUnique(base::StringPiece nonce, | |
| 33 QuicWallTime now, | |
| 34 ResultCallback* cb) override; | |
| 35 | |
| 36 private: | |
| 37 mutable base::Lock m_; | |
| 38 StrikeRegister strike_register_; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(LocalStrikeRegisterClient); | |
| 41 }; | |
| 42 | |
| 43 } // namespace net | |
| 44 | |
| 45 #endif // NET_QUIC_CRYPTO_LOCAL_STRIKE_REGISTER_CLIENT_H_ | |
| OLD | NEW |