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

Side by Side Diff: webrtc/api/jsepsessiondescription.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/jsepsessiondescription.h ('k') | webrtc/api/jsepsessiondescription_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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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
11 #include "webrtc/api/jsepsessiondescription.h" 11 #include "webrtc/api/jsepsessiondescription.h"
12 12
13 #include <memory>
14
13 #include "webrtc/api/webrtcsdp.h" 15 #include "webrtc/api/webrtcsdp.h"
14 #include "webrtc/base/arraysize.h" 16 #include "webrtc/base/arraysize.h"
15 #include "webrtc/base/stringencode.h" 17 #include "webrtc/base/stringencode.h"
16 #include "webrtc/pc/mediasession.h" 18 #include "webrtc/pc/mediasession.h"
17 19
18 using rtc::scoped_ptr;
19 using cricket::SessionDescription; 20 using cricket::SessionDescription;
20 21
21 namespace webrtc { 22 namespace webrtc {
22 23
23 static const char* kSupportedTypes[] = { 24 static const char* kSupportedTypes[] = {
24 JsepSessionDescription::kOffer, 25 JsepSessionDescription::kOffer,
25 JsepSessionDescription::kPrAnswer, 26 JsepSessionDescription::kPrAnswer,
26 JsepSessionDescription::kAnswer 27 JsepSessionDescription::kAnswer
27 }; 28 };
28 29
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 118 }
118 119
119 cricket::Candidate updated_candidate = candidate->candidate(); 120 cricket::Candidate updated_candidate = candidate->candidate();
120 if (updated_candidate.username().empty()) { 121 if (updated_candidate.username().empty()) {
121 updated_candidate.set_username(transport_info->description.ice_ufrag); 122 updated_candidate.set_username(transport_info->description.ice_ufrag);
122 } 123 }
123 if (updated_candidate.password().empty()) { 124 if (updated_candidate.password().empty()) {
124 updated_candidate.set_password(transport_info->description.ice_pwd); 125 updated_candidate.set_password(transport_info->description.ice_pwd);
125 } 126 }
126 127
127 scoped_ptr<JsepIceCandidate> updated_candidate_wrapper( 128 std::unique_ptr<JsepIceCandidate> updated_candidate_wrapper(
128 new JsepIceCandidate(candidate->sdp_mid(), 129 new JsepIceCandidate(candidate->sdp_mid(),
129 static_cast<int>(mediasection_index), 130 static_cast<int>(mediasection_index),
130 updated_candidate)); 131 updated_candidate));
131 if (!candidate_collection_[mediasection_index].HasCandidate( 132 if (!candidate_collection_[mediasection_index].HasCandidate(
132 updated_candidate_wrapper.get())) 133 updated_candidate_wrapper.get()))
133 candidate_collection_[mediasection_index].add( 134 candidate_collection_[mediasection_index].add(
134 updated_candidate_wrapper.release()); 135 updated_candidate_wrapper.release());
135 136
136 return true; 137 return true;
137 } 138 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 const std::string& transport_name = candidate.transport_name(); 204 const std::string& transport_name = candidate.transport_name();
204 for (size_t i = 0; i < description_->contents().size(); ++i) { 205 for (size_t i = 0; i < description_->contents().size(); ++i) {
205 if (transport_name == description_->contents().at(i).name) { 206 if (transport_name == description_->contents().at(i).name) {
206 return static_cast<int>(i); 207 return static_cast<int>(i);
207 } 208 }
208 } 209 }
209 return -1; 210 return -1;
210 } 211 }
211 212
212 } // namespace webrtc 213 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/jsepsessiondescription.h ('k') | webrtc/api/jsepsessiondescription_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698