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