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