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

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

Issue 2240633004: Return nil from RTCPeerConnectionFactory when creation fails (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 if (self = [super init]) { 225 if (self = [super init]) {
226 _observer.reset(new webrtc::PeerConnectionDelegateAdapter(self)); 226 _observer.reset(new webrtc::PeerConnectionDelegateAdapter(self));
227 std::unique_ptr<webrtc::MediaConstraints> nativeConstraints = 227 std::unique_ptr<webrtc::MediaConstraints> nativeConstraints =
228 constraints.nativeConstraints; 228 constraints.nativeConstraints;
229 _peerConnection = 229 _peerConnection =
230 factory.nativeFactory->CreatePeerConnection(*config, 230 factory.nativeFactory->CreatePeerConnection(*config,
231 nativeConstraints.get(), 231 nativeConstraints.get(),
232 nullptr, 232 nullptr,
233 nullptr, 233 nullptr,
234 _observer.get()); 234 _observer.get());
235 if (!_peerConnection) {
236 return nil;
237 }
235 _localStreams = [[NSMutableArray alloc] init]; 238 _localStreams = [[NSMutableArray alloc] init];
236 _delegate = delegate; 239 _delegate = delegate;
237 } 240 }
238 return self; 241 return self;
239 } 242 }
240 243
241 - (NSArray *)localStreams { 244 - (NSArray *)localStreams {
242 return [_localStreams copy]; 245 return [_localStreams copy];
243 } 246 }
244 247
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 case RTCStatsOutputLevelDebug: 583 case RTCStatsOutputLevelDebug:
581 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug; 584 return webrtc::PeerConnectionInterface::kStatsOutputLevelDebug;
582 } 585 }
583 } 586 }
584 587
585 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection { 588 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)nativePeerConnection {
586 return _peerConnection; 589 return _peerConnection;
587 } 590 }
588 591
589 @end 592 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698