Prefix bool variable with "should".
This is to address a comment in a CL landed earlier.
BUG=
Review-Url: https://codereview.webrtc.org/2137223002
Cr-Commit-Position: refs/heads/master@{#13435}
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm b/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm
index 74b5c5d..be662888 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm
@@ -33,8 +33,9 @@
_iceBackupCandidatePairPingInterval;
@synthesize keyType = _keyType;
@synthesize iceCandidatePoolSize = _iceCandidatePoolSize;
-@synthesize pruneTurnPorts = _pruneTurnPorts;
-@synthesize presumeWritableWhenFullyRelayed = _presumeWritableWhenFullyRelayed;
+@synthesize shouldPruneTurnPorts = _shouldPruneTurnPorts;
+@synthesize shouldPresumeWritableWhenFullyRelayed =
+ _shouldPresumeWritableWhenFullyRelayed;
- (instancetype)init {
if (self = [super init]) {
@@ -61,8 +62,8 @@
config.ice_backup_candidate_pair_ping_interval;
_keyType = RTCEncryptionKeyTypeECDSA;
_iceCandidatePoolSize = config.ice_candidate_pool_size;
- _pruneTurnPorts = config.prune_turn_ports;
- _presumeWritableWhenFullyRelayed =
+ _shouldPruneTurnPorts = config.prune_turn_ports;
+ _shouldPresumeWritableWhenFullyRelayed =
config.presume_writable_when_fully_relayed;
}
return self;
@@ -83,8 +84,8 @@
_iceConnectionReceivingTimeout,
_iceBackupCandidatePairPingInterval,
_iceCandidatePoolSize,
- _pruneTurnPorts,
- _presumeWritableWhenFullyRelayed];
+ _shouldPruneTurnPorts,
+ _shouldPresumeWritableWhenFullyRelayed];
}
#pragma mark - Private
@@ -128,9 +129,9 @@
nativeConfig->certificates.push_back(certificate);
}
nativeConfig->ice_candidate_pool_size = _iceCandidatePoolSize;
- nativeConfig->prune_turn_ports = _pruneTurnPorts;
+ nativeConfig->prune_turn_ports = _shouldPruneTurnPorts ? true : false;
nativeConfig->presume_writable_when_fully_relayed =
- _presumeWritableWhenFullyRelayed;
+ _shouldPresumeWritableWhenFullyRelayed ? true : false;
return nativeConfig.release();
}
diff --git a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h
index fcd2244..a510776 100644
--- a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h
+++ b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h
@@ -93,13 +93,15 @@
/** ICE candidate pool size as defined in JSEP. Default is 0. */
@property(nonatomic, assign) int iceCandidatePoolSize;
-/** Prune turn ports on the same network to the same turn server. Default is false. */
-@property(nonatomic, assign) bool pruneTurnPorts;
+/** Prune turn ports on the same network to the same turn server.
+ * Default is NO.
+ */
+@property(nonatomic, assign) BOOL shouldPruneTurnPorts;
-/** If set to true, this means the ICE transport should presume TURN-to-TURN
+/** If set to YES, this means the ICE transport should presume TURN-to-TURN
* candidate pairs will succeed, even before a binding response is received.
*/
-@property(nonatomic, assign) bool presumeWritableWhenFullyRelayed;
+@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
diff --git a/webrtc/sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm b/webrtc/sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm
index 51591f4..1fca960 100644
--- a/webrtc/sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm
+++ b/webrtc/sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm
@@ -44,7 +44,7 @@
config.iceBackupCandidatePairPingInterval = interval;
config.continualGatheringPolicy =
RTCContinualGatheringPolicyGatherContinually;
- config.pruneTurnPorts = true;
+ config.shouldPruneTurnPorts = YES;
std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration>
nativeConfig([config createNativeConfiguration]);