Chromium Code Reviews| 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_); | |
|
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 | |
| OLD | NEW |