OLD | NEW |
(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 |
OLD | NEW |