OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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_CERT_INTERNAL_CERT_ISSUER_SOURCE_AIA_H_ | |
6 #define NET_CERT_INTERNAL_CERT_ISSUER_SOURCE_AIA_H_ | |
7 | |
8 #include <unordered_map> | |
eroman
2016/06/03 16:28:52
unused
mattm
2016/06/03 21:27:26
Done.
| |
9 | |
10 #include "base/strings/string_piece.h" | |
11 #include "net/cert/cert_net_fetcher.h" | |
12 #include "net/cert/internal/cert_issuer_source.h" | |
13 | |
14 namespace net { | |
15 | |
16 class NET_EXPORT CertIssuerSourceAia : public CertIssuerSource { | |
17 public: | |
18 // Creates CertIssuerSource that will use |cert_fetcher| to retrieve issuers | |
19 // using AuthorityInfoAccess URIs. |cert_fetcher| must outlive the | |
20 // CertIssuerSourceAia. CertIssuerSourceAia must be created and used only on | |
21 // the network thread. | |
22 explicit CertIssuerSourceAia(CertNetFetcher* cert_fetcher); | |
23 ~CertIssuerSourceAia() override; | |
24 | |
25 // CertIssuerSource implementation: | |
26 void SyncGetIssuersOf( | |
27 const ParsedCertificate* cert, | |
28 std::vector<scoped_refptr<ParsedCertificate>>* issuers) override; | |
29 void AsyncGetIssuersOf(const ParsedCertificate* cert, | |
30 const IssuerCallback& issuers_callback, | |
31 std::unique_ptr<Request>* out_req) override; | |
32 | |
33 private: | |
34 class AiaRequest : public Request { | |
35 public: | |
36 explicit AiaRequest(const IssuerCallback& issuers_callback); | |
37 ~AiaRequest() override; | |
38 | |
39 // CertIssuerSource::Request implementation. | |
40 CompletionStatus GetNext( | |
41 scoped_refptr<ParsedCertificate>* out_cert) override; | |
42 | |
43 void AddCertFetcherRequest( | |
44 std::unique_ptr<CertNetFetcher::Request> cert_fetcher_request); | |
45 | |
46 void FetchCallback(Error, const std::vector<uint8_t>&); | |
47 | |
48 private: | |
49 IssuerCallback issuers_callback_; | |
50 std::vector<std::unique_ptr<CertNetFetcher::Request>> | |
51 cert_fetcher_requests_; | |
52 int pending_requests_ = 0; | |
eroman
2016/06/03 16:28:52
can this be unsigned?
mattm
2016/06/03 21:27:26
yeah. Done.
| |
53 std::vector<scoped_refptr<ParsedCertificate>> results_; | |
54 size_t current_result_ = 0; | |
55 | |
56 DISALLOW_COPY_AND_ASSIGN(AiaRequest); | |
57 }; | |
58 | |
59 CertNetFetcher* cert_fetcher_; | |
60 | |
61 DISALLOW_COPY_AND_ASSIGN(CertIssuerSourceAia); | |
62 }; | |
63 | |
64 } // namespace net | |
65 | |
66 #endif // NET_CERT_INTERNAL_CERT_ISSUER_SOURCE_AIA_H_ | |
OLD | NEW |