OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ | 5 #ifndef NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ |
6 #define NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ | 6 #define NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "net/base/net_export.h" | 9 #include "net/base/net_export.h" |
10 #include "net/cert/internal/trust_store.h" | 10 #include "net/cert/internal/trust_store.h" |
11 | 11 |
12 namespace base { | |
13 class TaskRunner; | |
14 } | |
15 | |
16 namespace net { | 12 namespace net { |
17 | 13 |
18 // TrustStoreCollection is an implementation of TrustStore which combines the | 14 // TrustStoreCollection is an implementation of TrustStore which combines the |
19 // results from multiple TrustStores. | 15 // results from multiple TrustStores. |
20 // | 16 // |
21 // The order of the matches will correspond to a concatenation of matches in | 17 // The order of the matches will correspond to a concatenation of matches in |
22 // the order the stores were added. | 18 // the order the stores were added. |
23 class NET_EXPORT TrustStoreCollection : public TrustStore { | 19 class NET_EXPORT TrustStoreCollection : public TrustStore { |
24 public: | 20 public: |
25 TrustStoreCollection(); | 21 TrustStoreCollection(); |
26 ~TrustStoreCollection() override; | 22 ~TrustStoreCollection() override; |
27 | 23 |
28 // Includes results from |store| in the combined output. |store| must | 24 // Includes results from |store| in the combined output. |store| must |
29 // outlive the TrustStoreCollection. | 25 // outlive the TrustStoreCollection. |
30 void AddTrustStore(TrustStore* store); | 26 void AddTrustStore(TrustStore* store); |
31 | 27 |
32 // TrustStore implementation: | 28 // TrustStore implementation: |
33 void FindTrustAnchorsForCert(const scoped_refptr<ParsedCertificate>& cert, | 29 void FindTrustAnchorsForCert(const scoped_refptr<ParsedCertificate>& cert, |
34 TrustAnchors* matches) const override; | 30 TrustAnchors* matches) const override; |
35 | 31 |
36 private: | 32 private: |
37 std::vector<TrustStore*> stores_; | 33 std::vector<TrustStore*> stores_; |
38 | 34 |
39 DISALLOW_COPY_AND_ASSIGN(TrustStoreCollection); | 35 DISALLOW_COPY_AND_ASSIGN(TrustStoreCollection); |
40 }; | 36 }; |
41 | 37 |
42 } // namespace net | 38 } // namespace net |
43 | 39 |
44 #endif // NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ | 40 #endif // NET_CERT_INTERNAL_TRUST_STORE_COLLECTION_H_ |
OLD | NEW |