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

Side by Side Diff: net/cert/internal/trust_store.h

Issue 2266333002: Allow TrustStore queries to be asynchronous. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo 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
« no previous file with comments | « net/cert/internal/path_builder_unittest.cc ('k') | net/cert/internal/trust_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_CERT_INTERNAL_TRUST_STORE_H_ 5 #ifndef NET_CERT_INTERNAL_TRUST_STORE_H_
6 #define NET_CERT_INTERNAL_TRUST_STORE_H_ 6 #define NET_CERT_INTERNAL_TRUST_STORE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h"
10 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
11 #include "net/base/net_export.h" 12 #include "net/base/net_export.h"
12 #include "net/cert/internal/parsed_certificate.h" 13 #include "net/cert/internal/parsed_certificate.h"
13 14
14 namespace net { 15 namespace net {
15 16
16 namespace der { 17 namespace der {
17 class Input; 18 class Input;
18 } 19 }
19 20
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 108
108 scoped_refptr<ParsedCertificate> cert_; 109 scoped_refptr<ParsedCertificate> cert_;
109 bool enforces_constraints_ = false; 110 bool enforces_constraints_ = false;
110 }; 111 };
111 112
112 using TrustAnchors = std::vector<scoped_refptr<TrustAnchor>>; 113 using TrustAnchors = std::vector<scoped_refptr<TrustAnchor>>;
113 114
114 // Interface for finding trust anchors. 115 // Interface for finding trust anchors.
115 class NET_EXPORT TrustStore { 116 class NET_EXPORT TrustStore {
116 public: 117 public:
118 class NET_EXPORT Request {
119 public:
120 Request();
121 // Destruction of the Request cancels it.
122 virtual ~Request();
123 };
124
117 TrustStore(); 125 TrustStore();
118 virtual ~TrustStore(); 126 virtual ~TrustStore();
119 127
120 // Returns the trust anchors that match |name| in |*matches|, if any. 128 using TrustAnchorsCallback = base::Callback<void(TrustAnchors)>;
121 virtual void FindTrustAnchorsByNormalizedName( 129
122 const der::Input& normalized_name, 130 // Returns the trust anchors that match |cert|'s issuer name in
123 TrustAnchors* matches) const = 0; 131 // |*synchronous_matches| and/or through |callback|. |cert| and
132 // |synchronous_matches| must not be null.
133 //
134 // If results are available synchronously, they will be appended to
135 // |*synchronous_matches|. |*synchronous_matches| will not be modified
136 // asynchronously.
137 //
138 // If |callback| is not null and results may be available asynchronously,
139 // |*out_req| will be filled with a Request, and |callback| will be called
140 // when results are available. The Request may be destroyed to cancel
141 // the callback if it has not occurred yet.
142 virtual void FindTrustAnchorsForCert(
143 const ParsedCertificate* cert,
144 const TrustAnchorsCallback& callback,
145 TrustAnchors* synchronous_matches,
146 std::unique_ptr<Request>* out_req) const = 0;
124 147
125 private: 148 private:
126 DISALLOW_COPY_AND_ASSIGN(TrustStore); 149 DISALLOW_COPY_AND_ASSIGN(TrustStore);
127 }; 150 };
128 151
129 } // namespace net 152 } // namespace net
130 153
131 #endif // NET_CERT_INTERNAL_TRUST_STORE_H_ 154 #endif // NET_CERT_INTERNAL_TRUST_STORE_H_
OLDNEW
« no previous file with comments | « net/cert/internal/path_builder_unittest.cc ('k') | net/cert/internal/trust_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698