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

Unified Diff: net/cert/internal/trust_store_collection.cc

Issue 2272493002: Add TrustStoreNSS and TrustStoreCollection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert-trust-store-interface3-nss
Patch Set: rebaes 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_collection.cc
diff --git a/net/cert/internal/trust_store_collection.cc b/net/cert/internal/trust_store_collection.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b1ef37a3bb856b6763953289929ef0d4f0642da3
--- /dev/null
+++ b/net/cert/internal/trust_store_collection.cc
@@ -0,0 +1,38 @@
+// 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.
+
+#include "net/cert/internal/trust_store_collection.h"
+
+namespace net {
+
+TrustStoreCollection::TrustStoreCollection() = default;
+TrustStoreCollection::~TrustStoreCollection() = default;
+
+void TrustStoreCollection::SetPrimaryTrustStore(TrustStore* store) {
+ DCHECK(!primary_store_);
+ DCHECK(store);
+ primary_store_ = store;
+}
+
+void TrustStoreCollection::AddTrustStoreSynchronousOnly(TrustStore* store) {
+ DCHECK(store);
+ sync_only_stores_.push_back(store);
+}
+
+void TrustStoreCollection::FindTrustAnchorsForCert(
+ scoped_refptr<ParsedCertificate> cert,
+ const TrustAnchorsCallback& callback,
+ TrustAnchors* synchronous_matches,
+ std::unique_ptr<Request>* out_req) const {
+ if (primary_store_)
+ primary_store_->FindTrustAnchorsForCert(cert, callback, synchronous_matches,
+ out_req);
+
+ for (auto* store : sync_only_stores_) {
+ store->FindTrustAnchorsForCert(cert, TrustAnchorsCallback(),
+ synchronous_matches, nullptr);
+ }
+}
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698