Index: talk/app/webrtc/dtlsidentitystore.cc |
diff --git a/talk/app/webrtc/dtlsidentitystore.cc b/talk/app/webrtc/dtlsidentitystore.cc |
index dd9bc5d68b501898b1ceada01b7555232953e48e..945429a67125592cf868e88bdb966bf014e3ac57 100644 |
--- a/talk/app/webrtc/dtlsidentitystore.cc |
+++ b/talk/app/webrtc/dtlsidentitystore.cc |
@@ -116,6 +116,7 @@ DtlsIdentityStore::~DtlsIdentityStore() { |
} |
void DtlsIdentityStore::Initialize() { |
+ DCHECK(rtc::Thread::Current() == signaling_thread_); |
// Do not aggressively generate the free identity if the worker thread and the |
// signaling thread are the same. |
if (worker_thread_ != signaling_thread_) { |
@@ -156,10 +157,12 @@ void DtlsIdentityStore::OnMessage(rtc::Message* msg) { |
} |
bool DtlsIdentityStore::HasFreeIdentityForTesting() const { |
- return free_identity_.get(); |
+ DCHECK(rtc::Thread::Current() == signaling_thread_); |
+ return free_identity_.get() != nullptr; |
} |
void DtlsIdentityStore::GenerateIdentity() { |
hbos
2015/06/09 12:59:11
It's confusing that we have two GenerateIdentity i
tommi
2015/06/09 13:17:17
I added the _w() post fix to the one that runs on
|
+ DCHECK(rtc::Thread::Current() == signaling_thread_); |
pending_jobs_++; |
LOG(LS_VERBOSE) << "New DTLS identity generation is posted, " |
<< "pending_identities=" << pending_jobs_; |
@@ -191,6 +194,7 @@ void DtlsIdentityStore::OnIdentityGenerated( |
void DtlsIdentityStore::ReturnIdentity( |
rtc::scoped_ptr<rtc::SSLIdentity> identity) { |
+ DCHECK(rtc::Thread::Current() == signaling_thread_); |
DCHECK(!free_identity_.get()); |
DCHECK(!pending_observers_.empty()); |
@@ -211,8 +215,8 @@ void DtlsIdentityStore::ReturnIdentity( |
if (worker_thread_ != signaling_thread_ && |
pending_observers_.empty() && |
pending_jobs_ == 0) { |
- // Generate a free identity in the background. |
- GenerateIdentity(); |
+ // Generate a free identity in the background. |
+ GenerateIdentity(); |
hbos
2015/06/09 12:59:12
(This generates in case we want to request another
tommi
2015/06/09 13:17:17
yes. I guess that's what the "free identity" refe
|
} |
} |