| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // This message always runs on the worker thread. | 67 // This message always runs on the worker thread. |
| 68 GenerateIdentity_w(); | 68 GenerateIdentity_w(); |
| 69 | 69 |
| 70 // Must delete |this|, owned by msg->pdata, on the signaling thread to | 70 // Must delete |this|, owned by msg->pdata, on the signaling thread to |
| 71 // avoid races on disconnecting the signal. | 71 // avoid races on disconnecting the signal. |
| 72 signaling_thread_->Post(this, MSG_DESTROY, msg->pdata); | 72 signaling_thread_->Post(this, MSG_DESTROY, msg->pdata); |
| 73 break; | 73 break; |
| 74 case MSG_GENERATE_IDENTITY_RESULT: | 74 case MSG_GENERATE_IDENTITY_RESULT: |
| 75 RTC_DCHECK(signaling_thread_->IsCurrent()); | 75 RTC_DCHECK(signaling_thread_->IsCurrent()); |
| 76 { | 76 { |
| 77 rtc::scoped_ptr<IdentityResultMessageData> pdata( | 77 std::unique_ptr<IdentityResultMessageData> pdata( |
| 78 static_cast<IdentityResultMessageData*>(msg->pdata)); | 78 static_cast<IdentityResultMessageData*>(msg->pdata)); |
| 79 if (store_) { | 79 if (store_) { |
| 80 store_->OnIdentityGenerated(pdata->data()->key_type_, | 80 store_->OnIdentityGenerated(pdata->data()->key_type_, |
| 81 std::move(pdata->data()->identity_)); | 81 std::move(pdata->data()->identity_)); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 break; | 84 break; |
| 85 case MSG_DESTROY: | 85 case MSG_DESTROY: |
| 86 RTC_DCHECK(signaling_thread_->IsCurrent()); | 86 RTC_DCHECK(signaling_thread_->IsCurrent()); |
| 87 delete msg->pdata; | 87 delete msg->pdata; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 // Dropping parameterization and |expires_ms|. | 125 // Dropping parameterization and |expires_ms|. |
| 126 // TODO(hbos,torbjorng): Use parameterizaton/expiration. webrtc:5092. | 126 // TODO(hbos,torbjorng): Use parameterizaton/expiration. webrtc:5092. |
| 127 GenerateIdentity(key_params.type(), observer); | 127 GenerateIdentity(key_params.type(), observer); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void DtlsIdentityStoreImpl::OnMessage(rtc::Message* msg) { | 130 void DtlsIdentityStoreImpl::OnMessage(rtc::Message* msg) { |
| 131 RTC_DCHECK(signaling_thread_->IsCurrent()); | 131 RTC_DCHECK(signaling_thread_->IsCurrent()); |
| 132 switch (msg->message_id) { | 132 switch (msg->message_id) { |
| 133 case MSG_GENERATE_IDENTITY_RESULT: { | 133 case MSG_GENERATE_IDENTITY_RESULT: { |
| 134 rtc::scoped_ptr<IdentityResultMessageData> pdata( | 134 std::unique_ptr<IdentityResultMessageData> pdata( |
| 135 static_cast<IdentityResultMessageData*>(msg->pdata)); | 135 static_cast<IdentityResultMessageData*>(msg->pdata)); |
| 136 OnIdentityGenerated(pdata->data()->key_type_, | 136 OnIdentityGenerated(pdata->data()->key_type_, |
| 137 std::move(pdata->data()->identity_)); | 137 std::move(pdata->data()->identity_)); |
| 138 break; | 138 break; |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 | 142 |
| 143 bool DtlsIdentityStoreImpl::HasFreeIdentityForTesting( | 143 bool DtlsIdentityStoreImpl::HasFreeIdentityForTesting( |
| 144 rtc::KeyType key_type) const { | 144 rtc::KeyType key_type) const { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 key_type == rtc::KT_RSA && // Only necessary for RSA. | 222 key_type == rtc::KT_RSA && // Only necessary for RSA. |
| 223 !request_info_[key_type].free_identity_.get() && | 223 !request_info_[key_type].free_identity_.get() && |
| 224 request_info_[key_type].request_observers_.size() == | 224 request_info_[key_type].request_observers_.size() == |
| 225 request_info_[key_type].gen_in_progress_counts_) { | 225 request_info_[key_type].gen_in_progress_counts_) { |
| 226 GenerateIdentity(key_type, nullptr); | 226 GenerateIdentity(key_type, nullptr); |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace webrtc | 231 } // namespace webrtc |
| OLD | NEW |