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

Side by Side 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: rebase Created 4 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/cert/internal/trust_store_collection.h"
6
7 namespace net {
8
9 TrustStoreCollection::TrustStoreCollection() = default;
10 TrustStoreCollection::~TrustStoreCollection() = default;
11
12 void TrustStoreCollection::SetPrimaryTrustStore(TrustStore* store) {
13 DCHECK(!primary_store_);
14 DCHECK(store);
15 primary_store_ = store;
16 }
17
18 void TrustStoreCollection::AddTrustStoreSynchronousOnly(TrustStore* store) {
19 DCHECK(store);
20 sync_only_stores_.push_back(store);
21 }
22
23 void TrustStoreCollection::FindTrustAnchorsForCert(
24 const scoped_refptr<ParsedCertificate>& cert,
25 const TrustAnchorsCallback& callback,
26 TrustAnchors* synchronous_matches,
27 std::unique_ptr<Request>* out_req) const {
28 if (primary_store_)
29 primary_store_->FindTrustAnchorsForCert(cert, callback, synchronous_matches,
30 out_req);
31
32 for (auto* store : sync_only_stores_) {
33 store->FindTrustAnchorsForCert(cert, TrustAnchorsCallback(),
34 synchronous_matches, nullptr);
35 }
36 }
37
38 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/trust_store_collection.h ('k') | net/cert/internal/trust_store_collection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698