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_CORE_CRYPTO_STRIKE_REGISTER_CLIENT_H_ | 5 #ifndef NET_QUIC_CORE_CRYPTO_STRIKE_REGISTER_CLIENT_H_ |
6 #define NET_QUIC_CORE_CRYPTO_STRIKE_REGISTER_CLIENT_H_ | 6 #define NET_QUIC_CORE_CRYPTO_STRIKE_REGISTER_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/strings/string_piece.h" | |
12 #include "net/quic/core/crypto/strike_register.h" | 11 #include "net/quic/core/crypto/strike_register.h" |
13 #include "net/quic/core/quic_time.h" | 12 #include "net/quic/core/quic_time.h" |
14 #include "net/quic/platform/api/quic_export.h" | 13 #include "net/quic/platform/api/quic_export.h" |
| 14 #include "net/quic/platform/api/quic_string_piece.h" |
15 | 15 |
16 namespace net { | 16 namespace net { |
17 | 17 |
18 // Interface implemented by clients that talk to strike registers | 18 // Interface implemented by clients that talk to strike registers |
19 // implemented as local or remote services. | 19 // implemented as local or remote services. |
20 class QUIC_EXPORT_PRIVATE StrikeRegisterClient { | 20 class QUIC_EXPORT_PRIVATE StrikeRegisterClient { |
21 public: | 21 public: |
22 // Single use callback that will be invoked once the validation | 22 // Single use callback that will be invoked once the validation |
23 // operation is complete. | 23 // operation is complete. |
24 class QUIC_EXPORT_PRIVATE ResultCallback { | 24 class QUIC_EXPORT_PRIVATE ResultCallback { |
(...skipping 10 matching lines...) Expand all Loading... |
35 InsertStatus nonce_error) = 0; | 35 InsertStatus nonce_error) = 0; |
36 | 36 |
37 private: | 37 private: |
38 DISALLOW_COPY_AND_ASSIGN(ResultCallback); | 38 DISALLOW_COPY_AND_ASSIGN(ResultCallback); |
39 }; | 39 }; |
40 | 40 |
41 StrikeRegisterClient() {} | 41 StrikeRegisterClient() {} |
42 virtual ~StrikeRegisterClient() {} | 42 virtual ~StrikeRegisterClient() {} |
43 | 43 |
44 // Returns true iff the strike register knows about the given orbit. | 44 // Returns true iff the strike register knows about the given orbit. |
45 virtual bool IsKnownOrbit(base::StringPiece orbit) const = 0; | 45 virtual bool IsKnownOrbit(QuicStringPiece orbit) const = 0; |
46 // Validate a nonce for freshness and uniqueness. | 46 // Validate a nonce for freshness and uniqueness. |
47 // Will invoke cb->Run(ValidateResponse::nonce_is_valid_and_unique(), | 47 // Will invoke cb->Run(ValidateResponse::nonce_is_valid_and_unique(), |
48 // ValidateResponse::nonce_error()) | 48 // ValidateResponse::nonce_error()) |
49 // once the asynchronous operation is complete. | 49 // once the asynchronous operation is complete. |
50 virtual void VerifyNonceIsValidAndUnique(base::StringPiece nonce, | 50 virtual void VerifyNonceIsValidAndUnique(QuicStringPiece nonce, |
51 QuicWallTime now, | 51 QuicWallTime now, |
52 ResultCallback* cb) = 0; | 52 ResultCallback* cb) = 0; |
53 | 53 |
54 private: | 54 private: |
55 DISALLOW_COPY_AND_ASSIGN(StrikeRegisterClient); | 55 DISALLOW_COPY_AND_ASSIGN(StrikeRegisterClient); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace net | 58 } // namespace net |
59 | 59 |
60 #endif // NET_QUIC_CORE_CRYPTO_STRIKE_REGISTER_CLIENT_H_ | 60 #endif // NET_QUIC_CORE_CRYPTO_STRIKE_REGISTER_CLIENT_H_ |
OLD | NEW |