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

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

Issue 14816006: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_PRIVATE_EXPORT to QuicWallTime Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/crypto/cert_compressor_test.cc ('k') | net/quic/crypto/common_cert_set.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_COMMON_CERT_SET_H_ 5 #ifndef NET_QUIC_CRYPTO_COMMON_CERT_SET_H_
6 #define NET_QUIC_CRYPTO_COMMON_CERT_SET_H_ 6 #define NET_QUIC_CRYPTO_COMMON_CERT_SET_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
11 #include "net/base/net_export.h" 11 #include "net/base/net_export.h"
12 #include "net/quic/crypto/crypto_protocol.h" 12 #include "net/quic/crypto/crypto_protocol.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 // CommonCertSet is an interface to an object that contains a number of common 16 // CommonCertSets is an interface to an object that contains a number of common
17 // certificate sets and can match against them. 17 // certificate sets and can match against them.
18 class NET_EXPORT_PRIVATE CommonCertSet { 18 class NET_EXPORT_PRIVATE CommonCertSets {
19 public: 19 public:
20 virtual ~CommonCertSet(); 20 virtual ~CommonCertSets();
21 21
22 // GetCommonHashes returns a StringPiece containing the hashes of common sets 22 // GetCommonHashes returns a StringPiece containing the hashes of common sets
23 // supported by this object. 23 // supported by this object.
24 virtual base::StringPiece GetCommonHashes() = 0; 24 virtual base::StringPiece GetCommonHashes() const = 0;
25 25
26 // GetCert returns a specific certificate in the common set identified by 26 // GetCert returns a specific certificate in the common set identified by
27 // |hash|. If no such certificate is known, an empty StringPiece is returned. 27 // |hash|. If no such certificate is known, an empty StringPiece is returned.
28 virtual base::StringPiece GetCert(uint64 hash, uint32 index) = 0; 28 virtual base::StringPiece GetCert(uint64 hash, uint32 index) const = 0;
29 29
30 // MatchCert tries to find |cert| in one of the common certificate sets 30 // MatchCert tries to find |cert| in one of the common certificate sets
31 // identified by |common_set_hashes|. On success it puts the hash in 31 // identified by |common_set_hashes|. On success it puts the hash in
32 // |out_hash|, the index in the set in |out_index| and returns true. Otherwise 32 // |out_hash|, the index in the set in |out_index| and returns true. Otherwise
33 // it returns false. 33 // it returns false.
34 virtual bool MatchCert(base::StringPiece cert, 34 virtual bool MatchCert(base::StringPiece cert,
35 base::StringPiece common_set_hashes, 35 base::StringPiece common_set_hashes,
36 uint64* out_hash, 36 uint64* out_hash,
37 uint32* out_index) = 0; 37 uint32* out_index) const = 0;
38 }; 38 };
39 39
40 // CommonCertSetQUIC implements the CommonCertSet interface using the default 40 // CommonCertSetsQUIC implements the CommonCertSet interface using the default
41 // certificate sets. 41 // certificate sets.
42 class NET_EXPORT_PRIVATE CommonCertSetQUIC : public CommonCertSet { 42 class NET_EXPORT_PRIVATE CommonCertSetsQUIC : public CommonCertSets {
43 public: 43 public:
44 CommonCertSetQUIC(); 44 CommonCertSetsQUIC();
45 45
46 // CommonCertSet interface. 46 // CommonCertSets interface.
47 virtual base::StringPiece GetCommonHashes() OVERRIDE; 47 virtual base::StringPiece GetCommonHashes() const OVERRIDE;
48 48
49 virtual base::StringPiece GetCert(uint64 hash, uint32 index) OVERRIDE; 49 virtual base::StringPiece GetCert(uint64 hash, uint32 index) const OVERRIDE;
50 50
51 virtual bool MatchCert(base::StringPiece cert, 51 virtual bool MatchCert(base::StringPiece cert,
52 base::StringPiece common_set_hashes, 52 base::StringPiece common_set_hashes,
53 uint64* out_hash, 53 uint64* out_hash,
54 uint32* out_index) OVERRIDE; 54 uint32* out_index) const OVERRIDE;
55 55
56 private: 56 private:
57 DISALLOW_COPY_AND_ASSIGN(CommonCertSetQUIC); 57 DISALLOW_COPY_AND_ASSIGN(CommonCertSetsQUIC);
58 }; 58 };
59 59
60 } // namespace net 60 } // namespace net
61 61
62 #endif // NET_QUIC_CRYPTO_COMMON_CERT_SET_H_ 62 #endif // NET_QUIC_CRYPTO_COMMON_CERT_SET_H_
OLDNEW
« no previous file with comments | « net/quic/crypto/cert_compressor_test.cc ('k') | net/quic/crypto/common_cert_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698