| 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_STRIKE_REGISTER_CLIENT_H_ | 5 #ifndef NET_QUIC_CRYPTO_STRIKE_REGISTER_CLIENT_H_ |
| 6 #define NET_QUIC_CRYPTO_STRIKE_REGISTER_CLIENT_H_ | 6 #define NET_QUIC_CRYPTO_STRIKE_REGISTER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 protected: | 31 protected: |
| 32 virtual void RunImpl(bool nonce_is_valid_and_unique) = 0; | 32 virtual void RunImpl(bool nonce_is_valid_and_unique) = 0; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 DISALLOW_COPY_AND_ASSIGN(ResultCallback); | 35 DISALLOW_COPY_AND_ASSIGN(ResultCallback); |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 StrikeRegisterClient() {} | 38 StrikeRegisterClient() {} |
| 39 virtual ~StrikeRegisterClient() {} | 39 virtual ~StrikeRegisterClient() {} |
| 40 | 40 |
| 41 // Returns the strike server orbit if known, else empty string. | 41 // Returns true iff the strike register knows about the given orbit. |
| 42 virtual std::string orbit() = 0; | 42 virtual bool IsKnownOrbit(base::StringPiece orbit) const = 0; |
| 43 // Validate a nonce for freshness and uniqueness. | 43 // Validate a nonce for freshness and uniqueness. |
| 44 // Will invoke cb->Run(ValidateResponse::nonce_is_valid_and_unique()) | 44 // Will invoke cb->Run(ValidateResponse::nonce_is_valid_and_unique()) |
| 45 // once the asynchronous operation is complete. | 45 // once the asynchronous operation is complete. |
| 46 virtual void VerifyNonceIsValidAndUnique( | 46 virtual void VerifyNonceIsValidAndUnique( |
| 47 base::StringPiece nonce, | 47 base::StringPiece nonce, |
| 48 QuicWallTime now, | 48 QuicWallTime now, |
| 49 ResultCallback* cb) = 0; | 49 ResultCallback* cb) = 0; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 DISALLOW_COPY_AND_ASSIGN(StrikeRegisterClient); | 52 DISALLOW_COPY_AND_ASSIGN(StrikeRegisterClient); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace net | 55 } // namespace net |
| 56 | 56 |
| 57 #endif // NET_QUIC_CRYPTO_STRIKE_REGISTER_CLIENT_H_ | 57 #endif // NET_QUIC_CRYPTO_STRIKE_REGISTER_CLIENT_H_ |
| OLD | NEW |