| 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_IN_MEMORY_H_ | 5 #ifndef NET_CERT_INTERNAL_TRUST_STORE_IN_MEMORY_H_ |
| 6 #define NET_CERT_INTERNAL_TRUST_STORE_IN_MEMORY_H_ | 6 #define NET_CERT_INTERNAL_TRUST_STORE_IN_MEMORY_H_ |
| 7 | 7 |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // Empties the trust store, resetting it to original state. | 24 // Empties the trust store, resetting it to original state. |
| 25 void Clear(); | 25 void Clear(); |
| 26 | 26 |
| 27 void AddTrustAnchor(scoped_refptr<TrustAnchor> anchor); | 27 void AddTrustAnchor(scoped_refptr<TrustAnchor> anchor); |
| 28 | 28 |
| 29 // TrustStore implementation: | 29 // TrustStore implementation: |
| 30 void FindTrustAnchorsForCert(const scoped_refptr<ParsedCertificate>& cert, | 30 void FindTrustAnchorsForCert(const scoped_refptr<ParsedCertificate>& cert, |
| 31 TrustAnchors* matches) const override; | 31 TrustAnchors* matches) const override; |
| 32 | 32 |
| 33 // Returns true if the trust store contains the given TrustAnchor instance. |
| 34 // Note that this considers only pointer equality and not a more |
| 35 // broad notion of equivalence based on the object's content. |
| 36 bool Contains(const TrustAnchor* anchor) const; |
| 37 |
| 33 private: | 38 private: |
| 34 // Multimap from normalized subject -> TrustAnchor. | 39 // Multimap from normalized subject -> TrustAnchor. |
| 35 std::unordered_multimap<base::StringPiece, | 40 std::unordered_multimap<base::StringPiece, |
| 36 scoped_refptr<TrustAnchor>, | 41 scoped_refptr<TrustAnchor>, |
| 37 base::StringPieceHash> | 42 base::StringPieceHash> |
| 38 anchors_; | 43 anchors_; |
| 39 | 44 |
| 40 DISALLOW_COPY_AND_ASSIGN(TrustStoreInMemory); | 45 DISALLOW_COPY_AND_ASSIGN(TrustStoreInMemory); |
| 41 }; | 46 }; |
| 42 | 47 |
| 43 } // namespace net | 48 } // namespace net |
| 44 | 49 |
| 45 #endif // NET_CERT_INTERNAL_TRUST_STORE_IN_MEMORY_H_ | 50 #endif // NET_CERT_INTERNAL_TRUST_STORE_IN_MEMORY_H_ |
| OLD | NEW |