Lots of random cleanups, mostly for native_theme_win.cc:
[chromium-blink-merge.git] / net / quic / crypto / proof_verifier_chromium.h
blobc67ce8c6c943fcc069760edc9fb086a4de2365d2
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_PROOF_VERIFIER_CHROMIUM_H_
6 #define NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_
8 #include <set>
9 #include <string>
10 #include <vector>
12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "net/base/net_export.h"
16 #include "net/base/net_log.h"
17 #include "net/cert/cert_verify_result.h"
18 #include "net/cert/x509_certificate.h"
19 #include "net/quic/crypto/proof_verifier.h"
21 namespace net {
23 class CertVerifier;
25 // ProofVerifyDetailsChromium is the implementation-specific information that a
26 // ProofVerifierChromium returns about a certificate verification.
27 struct ProofVerifyDetailsChromium : public ProofVerifyDetails {
28 public:
29 CertVerifyResult cert_verify_result;
32 // ProofVerifyContextChromium is the implementation-specific information that a
33 // ProofVerifierChromium needs in order to log correctly.
34 struct ProofVerifyContextChromium : public ProofVerifyContext {
35 public:
36 explicit ProofVerifyContextChromium(const BoundNetLog& net_log)
37 : net_log(net_log) {}
39 BoundNetLog net_log;
42 // ProofVerifierChromium implements the QUIC ProofVerifier interface. It is
43 // capable of handling multiple simultaneous requests.
44 class NET_EXPORT_PRIVATE ProofVerifierChromium : public ProofVerifier {
45 public:
46 explicit ProofVerifierChromium(CertVerifier* cert_verifier);
47 virtual ~ProofVerifierChromium();
49 // ProofVerifier interface
50 virtual QuicAsyncStatus VerifyProof(
51 const std::string& hostname,
52 const std::string& server_config,
53 const std::vector<std::string>& certs,
54 const std::string& signature,
55 const ProofVerifyContext* verify_context,
56 std::string* error_details,
57 scoped_ptr<ProofVerifyDetails>* verify_details,
58 ProofVerifierCallback* callback) OVERRIDE;
60 private:
61 class Job;
62 typedef std::set<Job*> JobSet;
64 void OnJobComplete(Job* job);
66 // Set owning pointers to active jobs.
67 JobSet active_jobs_;
69 // Underlying verifier used to verify certificates.
70 CertVerifier* const cert_verifier_;
72 DISALLOW_COPY_AND_ASSIGN(ProofVerifierChromium);
75 } // namespace net
77 #endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_