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

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

Issue 2030693002: Add CertIssuerSource interface and CertIssuerSourceStatic implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert-parsing-base
Patch Set: renamed Created 4 years, 6 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/cert_issuer_source_static.h"
6
7 #include "net/cert/internal/parsed_certificate.h"
8
9 namespace net {
10
11 CertIssuerSourceStatic::CertIssuerSourceStatic() = default;
12 CertIssuerSourceStatic::~CertIssuerSourceStatic() = default;
13
14 void CertIssuerSourceStatic::AddCert(scoped_refptr<ParsedCertificate> cert) {
15 intermediates_.insert(std::make_pair(
16 cert->normalized_subject().AsStringPiece(), std::move(cert)));
17 }
18
19 void CertIssuerSourceStatic::SyncGetIssuersOf(
20 const ParsedCertificate* cert,
21 std::vector<scoped_refptr<ParsedCertificate>>* issuers) {
22 auto range =
23 intermediates_.equal_range(cert->normalized_issuer().AsStringPiece());
24 for (auto it = range.first; it != range.second; ++it)
25 issuers->push_back(it->second);
26 }
27
28 void CertIssuerSourceStatic::AsyncGetIssuersOf(
29 const ParsedCertificate* cert,
30 const IssuerCallback& issuers_callback,
31 std::unique_ptr<Request>* out_req) {
32 // CertIssuerSourceStatic never returns asynchronous results.
33 out_req->reset();
eroman 2016/06/01 23:30:23 should we reset out_req too?
mattm 2016/06/01 23:48:33 Isn't that what it's doing?
eroman 2016/06/01 23:53:06 .... yeah..... sorry, dunno what my brain did righ
34 }
35
36 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698