OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 public: | 56 public: |
57 explicit WorkerTask(DtlsIdentityStore* store) | 57 explicit WorkerTask(DtlsIdentityStore* store) |
58 : signaling_thread_(rtc::Thread::Current()), store_(store) { | 58 : signaling_thread_(rtc::Thread::Current()), store_(store) { |
59 store_->SignalDestroyed.connect(this, &WorkerTask::OnStoreDestroyed); | 59 store_->SignalDestroyed.connect(this, &WorkerTask::OnStoreDestroyed); |
60 } | 60 } |
61 | 61 |
62 virtual ~WorkerTask() { DCHECK(rtc::Thread::Current() == signaling_thread_); } | 62 virtual ~WorkerTask() { DCHECK(rtc::Thread::Current() == signaling_thread_); } |
63 | 63 |
64 private: | 64 private: |
65 void GenerateIdentity_w() { | 65 void GenerateIdentity_w() { |
66 rtc::scoped_ptr<rtc::SSLIdentity> identity( | 66 rtc::scoped_ptr<rtc::SSLIdentity> identity(rtc::SSLIdentity::Generate( |
67 rtc::SSLIdentity::Generate(DtlsIdentityStore::kIdentityName)); | 67 DtlsIdentityStore::kIdentityName, rtc::KT_RSA)); |
68 | 68 |
69 { | 69 { |
70 rtc::CritScope cs(&cs_); | 70 rtc::CritScope cs(&cs_); |
71 if (store_) { | 71 if (store_) { |
72 store_->PostGenerateIdentityResult_w(identity.Pass()); | 72 store_->PostGenerateIdentityResult_w(identity.Pass()); |
73 } | 73 } |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 void OnMessage(rtc::Message* msg) override { | 77 void OnMessage(rtc::Message* msg) override { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 void DtlsIdentityStore::PostGenerateIdentityResult_w( | 227 void DtlsIdentityStore::PostGenerateIdentityResult_w( |
228 rtc::scoped_ptr<rtc::SSLIdentity> identity) { | 228 rtc::scoped_ptr<rtc::SSLIdentity> identity) { |
229 DCHECK(rtc::Thread::Current() == worker_thread_); | 229 DCHECK(rtc::Thread::Current() == worker_thread_); |
230 | 230 |
231 IdentityResultMessageData* msg = | 231 IdentityResultMessageData* msg = |
232 new IdentityResultMessageData(identity.release()); | 232 new IdentityResultMessageData(identity.release()); |
233 signaling_thread_->Post(this, MSG_GENERATE_IDENTITY_RESULT, msg); | 233 signaling_thread_->Post(this, MSG_GENERATE_IDENTITY_RESULT, msg); |
234 } | 234 } |
235 } // namespace webrtc | 235 } // namespace webrtc |
OLD | NEW |