Chromium Code Reviews| Index: net/cert/internal/cert_issuer_source_aia.h |
| diff --git a/net/cert/internal/cert_issuer_source_aia.h b/net/cert/internal/cert_issuer_source_aia.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..26aee1ee4c125a16729a76b08bd28d29130ea747 |
| --- /dev/null |
| +++ b/net/cert/internal/cert_issuer_source_aia.h |
| @@ -0,0 +1,66 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef NET_CERT_INTERNAL_CERT_ISSUER_SOURCE_AIA_H_ |
| +#define NET_CERT_INTERNAL_CERT_ISSUER_SOURCE_AIA_H_ |
| + |
| +#include <unordered_map> |
|
eroman
2016/06/03 16:28:52
unused
mattm
2016/06/03 21:27:26
Done.
|
| + |
| +#include "base/strings/string_piece.h" |
| +#include "net/cert/cert_net_fetcher.h" |
| +#include "net/cert/internal/cert_issuer_source.h" |
| + |
| +namespace net { |
| + |
| +class NET_EXPORT CertIssuerSourceAia : public CertIssuerSource { |
| + public: |
| + // Creates CertIssuerSource that will use |cert_fetcher| to retrieve issuers |
| + // using AuthorityInfoAccess URIs. |cert_fetcher| must outlive the |
| + // CertIssuerSourceAia. CertIssuerSourceAia must be created and used only on |
| + // the network thread. |
| + explicit CertIssuerSourceAia(CertNetFetcher* cert_fetcher); |
| + ~CertIssuerSourceAia() override; |
| + |
| + // CertIssuerSource implementation: |
| + void SyncGetIssuersOf( |
| + const ParsedCertificate* cert, |
| + std::vector<scoped_refptr<ParsedCertificate>>* issuers) override; |
| + void AsyncGetIssuersOf(const ParsedCertificate* cert, |
| + const IssuerCallback& issuers_callback, |
| + std::unique_ptr<Request>* out_req) override; |
| + |
| + private: |
| + class AiaRequest : public Request { |
| + public: |
| + explicit AiaRequest(const IssuerCallback& issuers_callback); |
| + ~AiaRequest() override; |
| + |
| + // CertIssuerSource::Request implementation. |
| + CompletionStatus GetNext( |
| + scoped_refptr<ParsedCertificate>* out_cert) override; |
| + |
| + void AddCertFetcherRequest( |
| + std::unique_ptr<CertNetFetcher::Request> cert_fetcher_request); |
| + |
| + void FetchCallback(Error, const std::vector<uint8_t>&); |
| + |
| + private: |
| + IssuerCallback issuers_callback_; |
| + std::vector<std::unique_ptr<CertNetFetcher::Request>> |
| + cert_fetcher_requests_; |
| + int pending_requests_ = 0; |
|
eroman
2016/06/03 16:28:52
can this be unsigned?
mattm
2016/06/03 21:27:26
yeah. Done.
|
| + std::vector<scoped_refptr<ParsedCertificate>> results_; |
| + size_t current_result_ = 0; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AiaRequest); |
| + }; |
| + |
| + CertNetFetcher* cert_fetcher_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(CertIssuerSourceAia); |
| +}; |
| + |
| +} // namespace net |
| + |
| +#endif // NET_CERT_INTERNAL_CERT_ISSUER_SOURCE_AIA_H_ |