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

Side by Side Diff: net/cert/internal/trust_store_in_memory.cc

Issue 2252933002: Make TrustStore into an interface, move impl to TrustStoreInMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update cast_cert_validator_unittest.cc 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 unified diff | Download patch
« no previous file with comments | « net/cert/internal/trust_store_in_memory.h ('k') | net/net.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_in_memory.h"
6
7 namespace net {
8
9 TrustStoreInMemory::TrustStoreInMemory() = default;
10 TrustStoreInMemory::~TrustStoreInMemory() = default;
11
12 void TrustStoreInMemory::Clear() {
13 anchors_.clear();
14 }
15
16 void TrustStoreInMemory::AddTrustAnchor(scoped_refptr<TrustAnchor> anchor) {
17 // TODO(mattm): should this check for duplicate anchors?
18 anchors_.insert(std::make_pair(anchor->normalized_subject().AsStringPiece(),
19 std::move(anchor)));
20 }
21
22 void TrustStoreInMemory::FindTrustAnchorsByNormalizedName(
23 const der::Input& normalized_name,
24 TrustAnchors* matches) const {
25 auto range = anchors_.equal_range(normalized_name.AsStringPiece());
26 for (auto it = range.first; it != range.second; ++it)
27 matches->push_back(it->second);
28 }
29
30 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/trust_store_in_memory.h ('k') | net/net.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698