Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: webrtc/api/dtlsidentitystore.cc

Issue 1930463002: Replace scoped_ptr with unique_ptr in webrtc/api/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/api/datachannel_unittest.cc ('k') | webrtc/api/dtmfsender_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « webrtc/api/datachannel_unittest.cc ('k') | webrtc/api/dtmfsender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698