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

Side by Side Diff: webrtc/api/dtlsidentitystore.h

Issue 2001103002: RTCCertificateGeneratorInterface and RTCCertificateGeneratorStoreWrapper added. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed nits 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
« no previous file with comments | « no previous file | webrtc/api/dtlsidentitystore.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 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_API_DTLSIDENTITYSTORE_H_ 11 #ifndef WEBRTC_API_DTLSIDENTITYSTORE_H_
12 #define WEBRTC_API_DTLSIDENTITYSTORE_H_ 12 #define WEBRTC_API_DTLSIDENTITYSTORE_H_
13 13
14 #include <memory> 14 #include <memory>
15 #include <queue> 15 #include <queue>
16 #include <string> 16 #include <string>
17 #include <utility> 17 #include <utility>
18 18
19 #include "webrtc/base/messagehandler.h" 19 #include "webrtc/base/messagehandler.h"
20 #include "webrtc/base/messagequeue.h" 20 #include "webrtc/base/messagequeue.h"
21 #include "webrtc/base/optional.h" 21 #include "webrtc/base/optional.h"
22 #include "webrtc/base/refcount.h" 22 #include "webrtc/base/refcount.h"
23 #include "webrtc/base/rtccertificategenerator.h"
23 #include "webrtc/base/scoped_ref_ptr.h" 24 #include "webrtc/base/scoped_ref_ptr.h"
24 #include "webrtc/base/sslidentity.h" 25 #include "webrtc/base/sslidentity.h"
25 #include "webrtc/base/thread.h" 26 #include "webrtc/base/thread.h"
26 27
27 namespace webrtc { 28 namespace webrtc {
28 29
29 // Passed to SSLIdentity::Generate. 30 // Passed to SSLIdentity::Generate.
30 extern const char kIdentityName[]; 31 extern const char kIdentityName[];
31 32
32 class SSLIdentity; 33 class SSLIdentity;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 std::queue<rtc::scoped_refptr<DtlsIdentityRequestObserver>> 125 std::queue<rtc::scoped_refptr<DtlsIdentityRequestObserver>>
125 request_observers_; 126 request_observers_;
126 size_t gen_in_progress_counts_; 127 size_t gen_in_progress_counts_;
127 std::unique_ptr<rtc::SSLIdentity> free_identity_; 128 std::unique_ptr<rtc::SSLIdentity> free_identity_;
128 }; 129 };
129 130
130 // One RequestInfo per KeyType. Only touch on the |signaling_thread_|. 131 // One RequestInfo per KeyType. Only touch on the |signaling_thread_|.
131 RequestInfo request_info_[rtc::KT_LAST]; 132 RequestInfo request_info_[rtc::KT_LAST];
132 }; 133 };
133 134
135 // Implements the |RTCCertificateGeneratorInterface| using the old |SSLIdentity|
136 // generator API, |DtlsIdentityStoreInterface|. This will be used while
137 // transitioning from store to generator, see bugs.webrtc.org/5707,
138 // bugs.webrtc.org/5708. Once those bugs have been fixed, this will be removed.
139 class RTCCertificateGeneratorStoreWrapper
140 : public rtc::RTCCertificateGeneratorInterface {
141 public:
142 RTCCertificateGeneratorStoreWrapper(
143 std::unique_ptr<DtlsIdentityStoreInterface> store);
144
145 // |RTCCertificateGeneratorInterface| overrides.
146 void GenerateCertificateAsync(
147 const rtc::KeyParams& key_params,
148 const rtc::Optional<uint64_t>& expires_ms,
149 const rtc::scoped_refptr<rtc::RTCCertificateGeneratorCallback>& callback)
150 override;
151
152 private:
153 const std::unique_ptr<DtlsIdentityStoreInterface> store_;
154 };
155
134 } // namespace webrtc 156 } // namespace webrtc
135 157
136 #endif // WEBRTC_API_DTLSIDENTITYSTORE_H_ 158 #endif // WEBRTC_API_DTLSIDENTITYSTORE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/dtlsidentitystore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698