Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: net/quic/crypto/strike_register_client.h

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/crypto/strike_register.cc ('k') | net/quic/crypto/strike_register_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_STRIKE_REGISTER_CLIENT_H_
6 #define NET_QUIC_CRYPTO_STRIKE_REGISTER_CLIENT_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "base/strings/string_piece.h"
12 #include "net/base/net_export.h"
13 #include "net/quic/crypto/strike_register.h"
14 #include "net/quic/quic_time.h"
15
16 namespace net {
17
18 // Interface implemented by clients that talk to strike registers
19 // implemented as local or remote services.
20 class NET_EXPORT_PRIVATE StrikeRegisterClient {
21 public:
22 // Single use callback that will be invoked once the validation
23 // operation is complete.
24 class NET_EXPORT_PRIVATE ResultCallback {
25 public:
26 ResultCallback() {}
27 virtual ~ResultCallback() {}
28 void Run(bool nonce_is_valid_and_unique, InsertStatus nonce_error) {
29 RunImpl(nonce_is_valid_and_unique, nonce_error);
30 delete this;
31 }
32
33 protected:
34 virtual void RunImpl(bool nonce_is_valid_and_unique,
35 InsertStatus nonce_error) = 0;
36
37 private:
38 DISALLOW_COPY_AND_ASSIGN(ResultCallback);
39 };
40
41 StrikeRegisterClient() {}
42 virtual ~StrikeRegisterClient() {}
43
44 // Returns true iff the strike register knows about the given orbit.
45 virtual bool IsKnownOrbit(base::StringPiece orbit) const = 0;
46 // Validate a nonce for freshness and uniqueness.
47 // Will invoke cb->Run(ValidateResponse::nonce_is_valid_and_unique(),
48 // ValidateResponse::nonce_error())
49 // once the asynchronous operation is complete.
50 virtual void VerifyNonceIsValidAndUnique(base::StringPiece nonce,
51 QuicWallTime now,
52 ResultCallback* cb) = 0;
53
54 private:
55 DISALLOW_COPY_AND_ASSIGN(StrikeRegisterClient);
56 };
57
58 } // namespace net
59
60 #endif // NET_QUIC_CRYPTO_STRIKE_REGISTER_CLIENT_H_
OLDNEW
« no previous file with comments | « net/quic/crypto/strike_register.cc ('k') | net/quic/crypto/strike_register_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698