Polishing code to handle certificate generation failure in .mm files.
This is a follow-up to https://codereview.webrtc.org/1965313002/ which was TBR-landed. Minor code clean-up/corrections: Property nativeConfiguration -> - method createNativeConfiguration. RTCLogWarning -> RTCLogError. setConfiguration returning NO instead of false. initWithFactory returning nil instead of nullptr. Braces around ifs. Review-Url: https://codereview.webrtc.org/1978233002 Cr-Commit-Position: refs/heads/master@{#12770}
This commit is contained in:
@ -199,9 +199,10 @@ void PeerConnectionDelegateAdapter::OnIceCandidate(
|
||||
delegate:(id<RTCPeerConnectionDelegate>)delegate {
|
||||
NSParameterAssert(factory);
|
||||
std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config(
|
||||
configuration.nativeConfiguration);
|
||||
if (!config)
|
||||
return nullptr;
|
||||
[configuration createNativeConfiguration]);
|
||||
if (!config) {
|
||||
return nil;
|
||||
}
|
||||
if (self = [super init]) {
|
||||
_observer.reset(new webrtc::PeerConnectionDelegateAdapter(self));
|
||||
std::unique_ptr<webrtc::MediaConstraints> nativeConstraints =
|
||||
@ -255,9 +256,10 @@ void PeerConnectionDelegateAdapter::OnIceCandidate(
|
||||
|
||||
- (BOOL)setConfiguration:(RTCConfiguration *)configuration {
|
||||
std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config(
|
||||
configuration.nativeConfiguration);
|
||||
if (!config)
|
||||
return false;
|
||||
[configuration createNativeConfiguration]);
|
||||
if (!config) {
|
||||
return NO;
|
||||
}
|
||||
return _peerConnection->SetConfiguration(*config);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user