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

Unified Diff: webrtc/api/dtlsidentitystore.cc

Issue 1907083005: Stop preemptively generating an RSA key pair. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing bug where an extra identity is generated. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/api/dtlsidentitystore_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/dtlsidentitystore.cc
diff --git a/webrtc/api/dtlsidentitystore.cc b/webrtc/api/dtlsidentitystore.cc
index a4851880650a96c55c720047810d3a48607fde8b..a1a45b882e45adbb6503f8d4eeb70ce9557b4643 100644
--- a/webrtc/api/dtlsidentitystore.cc
+++ b/webrtc/api/dtlsidentitystore.cc
@@ -108,12 +108,6 @@ DtlsIdentityStoreImpl::DtlsIdentityStoreImpl(rtc::Thread* signaling_thread,
worker_thread_(worker_thread),
request_info_() {
RTC_DCHECK(signaling_thread_->IsCurrent());
- // Preemptively generate identities unless the worker thread and signaling
- // thread are the same (only do preemptive work in the background).
- if (worker_thread_ != signaling_thread_) {
- // Only necessary for RSA.
- GenerateIdentity(rtc::KT_RSA, nullptr);
- }
}
DtlsIdentityStoreImpl::~DtlsIdentityStoreImpl() {
@@ -226,7 +220,7 @@ void DtlsIdentityStoreImpl::OnIdentityGenerated(
if (worker_thread_ != signaling_thread_ && // Only do in background thread.
key_type == rtc::KT_RSA && // Only necessary for RSA.
!request_info_[key_type].free_identity_.get() &&
- request_info_[key_type].request_observers_.size() <=
+ request_info_[key_type].request_observers_.size() ==
request_info_[key_type].gen_in_progress_counts_) {
GenerateIdentity(key_type, nullptr);
}
« no previous file with comments | « no previous file | webrtc/api/dtlsidentitystore_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698