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

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm

Issue 1978233002: Polishing code to handle certificate generation failure in .mm files. (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
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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 191 }
192 192
193 @synthesize delegate = _delegate; 193 @synthesize delegate = _delegate;
194 194
195 - (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory 195 - (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory
196 configuration:(RTCConfiguration *)configuration 196 configuration:(RTCConfiguration *)configuration
197 constraints:(RTCMediaConstraints *)constraints 197 constraints:(RTCMediaConstraints *)constraints
198 delegate:(id<RTCPeerConnectionDelegate>)delegate { 198 delegate:(id<RTCPeerConnectionDelegate>)delegate {
199 NSParameterAssert(factory); 199 NSParameterAssert(factory);
200 std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config( 200 std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config(
201 configuration.nativeConfiguration); 201 configuration.createNativeConfiguration);
tkchin_webrtc 2016/05/16 21:01:32 not a property, so use [configuration createNative
hbos 2016/05/17 09:05:03 Done. *Pretending to know objective-c++ when I don
202 if (!config) 202 if (!config)
tkchin_webrtc 2016/05/16 21:01:32 braces if (!config) { return nil; }
hbos 2016/05/17 09:05:03 Done. (I think you asked me in the other CL and I
203 return nullptr; 203 return nil;
204 if (self = [super init]) { 204 if (self = [super init]) {
205 _observer.reset(new webrtc::PeerConnectionDelegateAdapter(self)); 205 _observer.reset(new webrtc::PeerConnectionDelegateAdapter(self));
206 std::unique_ptr<webrtc::MediaConstraints> nativeConstraints = 206 std::unique_ptr<webrtc::MediaConstraints> nativeConstraints =
207 constraints.nativeConstraints; 207 constraints.nativeConstraints;
208 _peerConnection = 208 _peerConnection =
209 factory.nativeFactory->CreatePeerConnection(*config, 209 factory.nativeFactory->CreatePeerConnection(*config,
210 nativeConstraints.get(), 210 nativeConstraints.get(),
211 nullptr, 211 nullptr,
212 nullptr, 212 nullptr,
213 _observer.get()); 213 _observer.get());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 _peerConnection->ice_connection_state()]; 247 _peerConnection->ice_connection_state()];
248 } 248 }
249 249
250 - (RTCIceGatheringState)iceGatheringState { 250 - (RTCIceGatheringState)iceGatheringState {
251 return [[self class] iceGatheringStateForNativeState: 251 return [[self class] iceGatheringStateForNativeState:
252 _peerConnection->ice_gathering_state()]; 252 _peerConnection->ice_gathering_state()];
253 } 253 }
254 254
255 - (BOOL)setConfiguration:(RTCConfiguration *)configuration { 255 - (BOOL)setConfiguration:(RTCConfiguration *)configuration {
256 std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config( 256 std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config(
257 configuration.nativeConfiguration); 257 configuration.createNativeConfiguration);
tkchin_webrtc 2016/05/16 21:01:32 ditto [] and {}
hbos 2016/05/17 09:05:03 Done.
258 if (!config) 258 if (!config)
259 return false; 259 return NO;
260 return _peerConnection->SetConfiguration(*config); 260 return _peerConnection->SetConfiguration(*config);
261 } 261 }
262 262
263 - (void)close { 263 - (void)close {
264 _peerConnection->Close(); 264 _peerConnection->Close();
265 } 265 }
266 266
267 - (void)addIceCandidate:(RTCIceCandidate *)candidate { 267 - (void)addIceCandidate:(RTCIceCandidate *)candidate {
268 std::unique_ptr<const webrtc::IceCandidateInterface> iceCandidate( 268 std::unique_ptr<const webrtc::IceCandidateInterface> iceCandidate(
269 candidate.nativeCandidate); 269 candidate.nativeCandidate);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 case RTCStatsOutputLevelDebug: 505 case RTCStatsOutputLevelDebug:
506 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; 506 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug;
507 } 507 }
508 } 508 }
509 509
510 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { 510 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection {
511 return _peerConnection; 511 return _peerConnection;
512 } 512 }
513 513
514 @end 514 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698