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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 : signaling_thread_(rtc::Thread::Current()), | 58 : signaling_thread_(rtc::Thread::Current()), |
59 store_(store), | 59 store_(store), |
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() { DCHECK(signaling_thread_->IsCurrent()); } | 64 virtual ~WorkerTask() { DCHECK(signaling_thread_->IsCurrent()); } |
65 | 65 |
66 private: | 66 private: |
67 void GenerateIdentity_w() { | 67 void GenerateIdentity_w() { |
68 // TODO(hbos): Use key_type_ when torbjorng's CL has landed. | 68 LOG(LS_INFO) << "Generating identity, using keytype " << key_type_; |
69 LOG(LS_INFO) << "Generating identity. Key type (TODO(hbos): should use): " | |
70 << key_type_; | |
71 rtc::scoped_ptr<rtc::SSLIdentity> identity( | 69 rtc::scoped_ptr<rtc::SSLIdentity> identity( |
72 rtc::SSLIdentity::Generate(kIdentityName)); | 70 rtc::SSLIdentity::Generate(kIdentityName, key_type_)); |
73 | 71 |
74 // Posting to |this| avoids touching |store_| on threads other than | 72 // Posting to |this| avoids touching |store_| on threads other than |
75 // |signaling_thread_| and thus avoids having to use locks. | 73 // |signaling_thread_| and thus avoids having to use locks. |
76 IdentityResultMessageData* msg = new IdentityResultMessageData( | 74 IdentityResultMessageData* msg = new IdentityResultMessageData( |
77 new IdentityResult(key_type_, identity.Pass())); | 75 new IdentityResult(key_type_, identity.Pass())); |
78 signaling_thread_->Post(this, MSG_GENERATE_IDENTITY_RESULT, msg); | 76 signaling_thread_->Post(this, MSG_GENERATE_IDENTITY_RESULT, msg); |
79 } | 77 } |
80 | 78 |
81 void OnMessage(rtc::Message* msg) override { | 79 void OnMessage(rtc::Message* msg) override { |
82 switch (msg->message_id) { | 80 switch (msg->message_id) { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 key_type == rtc::KT_RSA && // Only necessary for RSA. | 239 key_type == rtc::KT_RSA && // Only necessary for RSA. |
242 !request_info_[key_type].free_identity_.get() && | 240 !request_info_[key_type].free_identity_.get() && |
243 request_info_[key_type].request_observers_.size() <= | 241 request_info_[key_type].request_observers_.size() <= |
244 request_info_[key_type].gen_in_progress_counts_) { | 242 request_info_[key_type].gen_in_progress_counts_) { |
245 GenerateIdentity(key_type, nullptr); | 243 GenerateIdentity(key_type, nullptr); |
246 } | 244 } |
247 } | 245 } |
248 } | 246 } |
249 | 247 |
250 } // namespace webrtc | 248 } // namespace webrtc |
OLD | NEW |