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