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

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: 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_);
eroman 2016/08/23 18:48:54 suggest also adding DCHECK(store) -- or do you wan
mattm 2016/08/27 00:37:01 Done.
14 primary_store_ = store;
15 }
16
17 void TrustStoreCollection::AddTrustStoreSynchronousOnly(TrustStore* store) {
18 sync_only_stores_.push_back(store);
19 }
20
21 void TrustStoreCollection::FindTrustAnchorsForCert(
22 const ParsedCertificate* cert,
23 const TrustAnchorCallback& callback,
24 TrustAnchors* out_matches,
25 std::unique_ptr<Request>* out_req) const {
26 if (primary_store_)
27 primary_store_->FindTrustAnchorsForCert(cert, callback, out_matches,
28 out_req);
29
30 for (auto* store : sync_only_stores_) {
31 std::unique_ptr<Request> unused_req;
eroman 2016/08/23 18:48:54 should nullptr be allowed in the case where null c
mattm 2016/08/27 00:37:01 Done.
32 store->FindTrustAnchorsForCert(cert, TrustAnchorCallback(), out_matches,
33 &unused_req);
34 DCHECK(!unused_req);
35 }
36 }
37
38 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698