Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: net/cert/internal/trust_store.h

Issue 2252933002: Make TrustStore into an interface, move impl to TrustStoreInMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update cast_cert_validator_unittest.cc Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/cert/internal/trust_store.h
diff --git a/net/cert/internal/trust_store.h b/net/cert/internal/trust_store.h
index cb74feb71bba907417a8b8a89aafc5c454dbaed6..e8706e78d1da765f8a9be8fe5ed394b66531ed80 100644
--- a/net/cert/internal/trust_store.h
+++ b/net/cert/internal/trust_store.h
@@ -5,11 +5,9 @@
#ifndef NET_CERT_INTERNAL_TRUST_STORE_H_
#define NET_CERT_INTERNAL_TRUST_STORE_H_
-#include <unordered_map>
#include <vector>
#include "base/memory/ref_counted.h"
-#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
#include "net/cert/internal/parsed_certificate.h"
@@ -113,32 +111,18 @@ class NET_EXPORT TrustAnchor : public base::RefCountedThreadSafe<TrustAnchor> {
using TrustAnchors = std::vector<scoped_refptr<TrustAnchor>>;
-// A very simple implementation of a TrustStore, which contains a set of
-// trust anchors.
-//
-// TODO(mattm): convert this into an interface, provide implementations that
-// interface with OS trust store.
+// Interface for finding trust anchors.
class NET_EXPORT TrustStore {
public:
TrustStore();
- ~TrustStore();
-
- // Empties the trust store, resetting it to original state.
- void Clear();
-
- void AddTrustAnchor(scoped_refptr<TrustAnchor> anchor);
+ virtual ~TrustStore();
// Returns the trust anchors that match |name| in |*matches|, if any.
- void FindTrustAnchorsByNormalizedName(const der::Input& normalized_name,
- TrustAnchors* matches) const;
+ virtual void FindTrustAnchorsByNormalizedName(
+ const der::Input& normalized_name,
+ TrustAnchors* matches) const = 0;
private:
- // Multimap from normalized subject -> TrustAnchor.
- std::unordered_multimap<base::StringPiece,
- scoped_refptr<TrustAnchor>,
- base::StringPieceHash>
- anchors_;
-
DISALLOW_COPY_AND_ASSIGN(TrustStore);
};
« no previous file with comments | « net/cert/internal/path_builder_verify_certificate_chain_unittest.cc ('k') | net/cert/internal/trust_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698