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:
@ -75,7 +75,8 @@
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
- (webrtc::PeerConnectionInterface::RTCConfiguration*)nativeConfiguration {
|
||||
- (webrtc::PeerConnectionInterface::RTCConfiguration *)
|
||||
createNativeConfiguration {
|
||||
std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration>
|
||||
nativeConfig(new webrtc::PeerConnectionInterface::RTCConfiguration());
|
||||
|
||||
@ -105,7 +106,7 @@
|
||||
rtc::RTCCertificateGenerator::GenerateCertificate(
|
||||
rtc::KeyParams(keyType), rtc::Optional<uint64_t>());
|
||||
if (!certificate) {
|
||||
RTCLogWarning(@"Failed to generate certificate.");
|
||||
RTCLogError(@"Failed to generate certificate.");
|
||||
return nullptr;
|
||||
}
|
||||
nativeConfig->certificates.push_back(certificate);
|
||||
|
||||
Reference in New Issue
Block a user