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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 key_type_(key_type) { | 60 key_type_(key_type) { |
61 store_->SignalDestroyed.connect(this, &WorkerTask::OnStoreDestroyed); | 61 store_->SignalDestroyed.connect(this, &WorkerTask::OnStoreDestroyed); |
62 } | 62 } |
63 | 63 |
64 virtual ~WorkerTask() { RTC_DCHECK(signaling_thread_->IsCurrent()); } | 64 virtual ~WorkerTask() { RTC_DCHECK(signaling_thread_->IsCurrent()); } |
65 | 65 |
66 private: | 66 private: |
67 void GenerateIdentity_w() { | 67 void GenerateIdentity_w() { |
68 LOG(LS_INFO) << "Generating identity, using keytype " << key_type_; | 68 LOG(LS_INFO) << "Generating identity, using keytype " << key_type_; |
69 rtc::scoped_ptr<rtc::SSLIdentity> identity( | 69 rtc::scoped_ptr<rtc::SSLIdentity> identity( |
70 rtc::SSLIdentity::Generate(kIdentityName, key_type_)); | 70 rtc::SSLIdentity::Generate(kIdentityName, rtc::KeyTypeFull(key_type_))); |
71 | 71 |
72 // Posting to |this| avoids touching |store_| on threads other than | 72 // Posting to |this| avoids touching |store_| on threads other than |
73 // |signaling_thread_| and thus avoids having to use locks. | 73 // |signaling_thread_| and thus avoids having to use locks. |
74 IdentityResultMessageData* msg = new IdentityResultMessageData( | 74 IdentityResultMessageData* msg = new IdentityResultMessageData( |
75 new IdentityResult(key_type_, identity.Pass())); | 75 new IdentityResult(key_type_, identity.Pass())); |
76 signaling_thread_->Post(this, MSG_GENERATE_IDENTITY_RESULT, msg); | 76 signaling_thread_->Post(this, MSG_GENERATE_IDENTITY_RESULT, msg); |
77 } | 77 } |
78 | 78 |
79 void OnMessage(rtc::Message* msg) override { | 79 void OnMessage(rtc::Message* msg) override { |
80 switch (msg->message_id) { | 80 switch (msg->message_id) { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 key_type == rtc::KT_RSA && // Only necessary for RSA. | 239 key_type == rtc::KT_RSA && // Only necessary for RSA. |
240 !request_info_[key_type].free_identity_.get() && | 240 !request_info_[key_type].free_identity_.get() && |
241 request_info_[key_type].request_observers_.size() <= | 241 request_info_[key_type].request_observers_.size() <= |
242 request_info_[key_type].gen_in_progress_counts_) { | 242 request_info_[key_type].gen_in_progress_counts_) { |
243 GenerateIdentity(key_type, nullptr); | 243 GenerateIdentity(key_type, nullptr); |
244 } | 244 } |
245 } | 245 } |
246 } | 246 } |
247 | 247 |
248 } // namespace webrtc | 248 } // namespace webrtc |
OLD | NEW |