diff --git a/webrtc/api/objc/RTCConfiguration.h b/webrtc/api/objc/RTCConfiguration.h index ed4bfc2748..144c8d3bd5 100644 --- a/webrtc/api/objc/RTCConfiguration.h +++ b/webrtc/api/objc/RTCConfiguration.h @@ -12,8 +12,6 @@ @class RTCIceServer; -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 - /** * Represents the ice transport policy. This exposes the same states in C++, * which include one more state than what exists in the W3C spec. @@ -55,8 +53,7 @@ NS_ASSUME_NONNULL_BEGIN @interface RTCConfiguration : NSObject /** An array of Ice Servers available to be used by ICE. */ -@property(nonatomic, copy, nonnull) NSArray *iceServers; -// @property(nonatomic, copy) NSArray *iceServers; +@property(nonatomic, copy) NSArray *iceServers; /** Which candidates the ICE agent is allowed to use. The W3C calls it * |iceTransportPolicy|, while in C++ it is called |type|. */ @@ -75,7 +72,7 @@ NS_ASSUME_NONNULL_BEGIN /** Key type used to generate SSL identity. Default is ECDSA. */ @property(nonatomic, assign) RTCEncryptionKeyType keyType; -- (nonnull instancetype)init NS_DESIGNATED_INITIALIZER; +- (instancetype)init NS_DESIGNATED_INITIALIZER; @end diff --git a/webrtc/api/objc/RTCIceCandidate.h b/webrtc/api/objc/RTCIceCandidate.h index f7e27c21bb..41ea69e991 100644 --- a/webrtc/api/objc/RTCIceCandidate.h +++ b/webrtc/api/objc/RTCIceCandidate.h @@ -11,7 +11,6 @@ #import NS_ASSUME_NONNULL_BEGIN -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 @interface RTCIceCandidate : NSObject @@ -28,16 +27,16 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSInteger sdpMLineIndex; /** The SDP string for this candidate. */ -@property(nonatomic, readonly, nonnull) NSString *sdp; +@property(nonatomic, readonly) NSString *sdp; -- (nonnull instancetype)init NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; /** * Initialize an RTCIceCandidate from SDP. */ -- (nonnull instancetype)initWithSdp:(nonnull NSString *)sdp - sdpMLineIndex:(NSInteger)sdpMLineIndex - sdpMid:(nullable NSString *)sdpMid +- (instancetype)initWithSdp:(NSString *)sdp + sdpMLineIndex:(NSInteger)sdpMLineIndex + sdpMid:(nullable NSString *)sdpMid NS_DESIGNATED_INITIALIZER; @end diff --git a/webrtc/api/objc/RTCIceServer.h b/webrtc/api/objc/RTCIceServer.h index 8ca179f6a0..487588ebc4 100644 --- a/webrtc/api/objc/RTCIceServer.h +++ b/webrtc/api/objc/RTCIceServer.h @@ -11,13 +11,11 @@ #import NS_ASSUME_NONNULL_BEGIN -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 @interface RTCIceServer : NSObject /** URI(s) for this server represented as NSStrings. */ -@property(nonatomic, readonly, nonnull) NSArray *urlStrings; -// @property(nonatomic, readonly) NSArray *urlStrings; +@property(nonatomic, readonly) NSArray *urlStrings; /** Username to use if this RTCIceServer object is a TURN server. */ @property(nonatomic, readonly, nullable) NSString *username; @@ -28,17 +26,15 @@ NS_ASSUME_NONNULL_BEGIN - (nonnull instancetype)init NS_UNAVAILABLE; /** Convenience initializer for a server with no authentication (e.g. STUN). */ -- (nonnull instancetype)initWithURLStrings:(nonnull NSArray *)urlStrings; -// - (instancetype)initWithURLStrings:(NSArray *)urlStrings; +- (instancetype)initWithURLStrings:(NSArray *)urlStrings; /** * Initialize an RTCIceServer with its associated URLs, optional username, * optional credential, and credentialType. */ -- (nonnull instancetype)initWithURLStrings:(nonnull NSArray *)urlStrings -// - (instancetype)initWithURLStrings:(NSArray *)urlStrings - username:(nullable NSString *)username - credential:(nullable NSString *)credential +- (instancetype)initWithURLStrings:(NSArray *)urlStrings + username:(nullable NSString *)username + credential:(nullable NSString *)credential NS_DESIGNATED_INITIALIZER; @end diff --git a/webrtc/api/objc/RTCIceServer.mm b/webrtc/api/objc/RTCIceServer.mm index 9fc215429f..95c380e071 100644 --- a/webrtc/api/objc/RTCIceServer.mm +++ b/webrtc/api/objc/RTCIceServer.mm @@ -14,22 +14,19 @@ #import "webrtc/base/objc/NSString+StdString.h" @implementation RTCIceServer -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 @synthesize urlStrings = _urlStrings; @synthesize username = _username; @synthesize credential = _credential; -- (instancetype)initWithURLStrings:(NSArray *)urlStrings { -// - (instancetype)initWithURLStrings:(NSArray *)urlStrings { +- (instancetype)initWithURLStrings:(NSArray *)urlStrings { NSParameterAssert(urlStrings.count); return [self initWithURLStrings:urlStrings username:nil credential:nil]; } -- (instancetype)initWithURLStrings:(NSArray *)urlStrings -// - (instancetype)initWithURLStrings:(NSArray *)urlStrings +- (instancetype)initWithURLStrings:(NSArray *)urlStrings username:(NSString *)username credential:(NSString *)credential { NSParameterAssert(urlStrings.count); diff --git a/webrtc/api/objc/RTCMediaConstraints+Private.h b/webrtc/api/objc/RTCMediaConstraints+Private.h index 84966d137a..fa582ecae5 100644 --- a/webrtc/api/objc/RTCMediaConstraints+Private.h +++ b/webrtc/api/objc/RTCMediaConstraints+Private.h @@ -13,8 +13,6 @@ #include "webrtc/api/mediaconstraintsinterface.h" #include "webrtc/base/scoped_ptr.h" -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 - namespace webrtc { class MediaConstraints : public MediaConstraintsInterface { @@ -48,8 +46,7 @@ NS_ASSUME_NONNULL_BEGIN /** Return a native Constraints object representing these constraints */ + (webrtc::MediaConstraintsInterface::Constraints) nativeConstraintsForConstraints: - (NSDictionary *)constraints; - // (NSDictionary *)constraints; + (NSDictionary *)constraints; @end diff --git a/webrtc/api/objc/RTCMediaConstraints.h b/webrtc/api/objc/RTCMediaConstraints.h index 1ed456cf4e..a8ad39142e 100644 --- a/webrtc/api/objc/RTCMediaConstraints.h +++ b/webrtc/api/objc/RTCMediaConstraints.h @@ -11,23 +11,17 @@ #import NS_ASSUME_NONNULL_BEGIN -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 @interface RTCMediaConstraints : NSObject -- (nonnull instancetype)init NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; /** Initialize with mandatory and/or optional constraints. */ -- (nonnull instancetype)initWithMandatoryConstraints: - (nullable NSDictionary *)mandatory - optionalConstraints: - (nullable NSDictionary *)optional +- (instancetype)initWithMandatoryConstraints: + (nullable NSDictionary *)mandatory + optionalConstraints: + (nullable NSDictionary *)optional NS_DESIGNATED_INITIALIZER; -// - (instancetype)initWithMandatoryConstraints: -// (nullable NSDictionary *)mandatory -// optionalConstraints: -// (nullable NSDictionary *)optional -// NS_DESIGNATED_INITIALIZER; @end diff --git a/webrtc/api/objc/RTCMediaConstraints.mm b/webrtc/api/objc/RTCMediaConstraints.mm index 9d4e391d10..bf50668e1d 100644 --- a/webrtc/api/objc/RTCMediaConstraints.mm +++ b/webrtc/api/objc/RTCMediaConstraints.mm @@ -13,8 +13,6 @@ #import "webrtc/api/objc/RTCMediaConstraints+Private.h" #import "webrtc/base/objc/NSString+StdString.h" -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 - namespace webrtc { MediaConstraints::~MediaConstraints() {} @@ -40,18 +38,14 @@ MediaConstraints::GetOptional() const { @implementation RTCMediaConstraints { - NSDictionary *_mandatory; - // NSDictionary *_mandatory; - NSDictionary *_optional; - // NSDictionary *_optional; + NSDictionary *_mandatory; + NSDictionary *_optional; } - (instancetype)initWithMandatoryConstraints: - (NSDictionary *)mandatory - // (NSDictionary *)mandatory + (NSDictionary *)mandatory optionalConstraints: - (NSDictionary *)optional { - // (NSDictionary *)optional { + (NSDictionary *)optional { if (self = [super init]) { _mandatory = [[NSDictionary alloc] initWithDictionary:mandatory copyItems:YES]; @@ -82,8 +76,7 @@ MediaConstraints::GetOptional() const { + (webrtc::MediaConstraintsInterface::Constraints) nativeConstraintsForConstraints: - (NSDictionary *)constraints { - // (NSDictionary *)constraints { + (NSDictionary *)constraints { webrtc::MediaConstraintsInterface::Constraints nativeConstraints; for (NSString *key in constraints) { NSAssert([key isKindOfClass:[NSString class]], diff --git a/webrtc/api/objc/RTCMediaStream.h b/webrtc/api/objc/RTCMediaStream.h index 7df1ea8ea8..e3ab754f3a 100644 --- a/webrtc/api/objc/RTCMediaStream.h +++ b/webrtc/api/objc/RTCMediaStream.h @@ -11,7 +11,6 @@ #import NS_ASSUME_NONNULL_BEGIN -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 @class RTCAudioTrack; @class RTCPeerConnectionFactory; @@ -20,12 +19,10 @@ NS_ASSUME_NONNULL_BEGIN @interface RTCMediaStream : NSObject /** The audio tracks in this stream. */ -@property(nonatomic, strong, readonly) NSArray *audioTracks; -// @property(nonatomic, strong, readonly) NSArray *audioTracks; +@property(nonatomic, strong, readonly) NSArray *audioTracks; /** The video tracks in this stream. */ -@property(nonatomic, strong, readonly) NSArray *videoTracks; -// @property(nonatomic, strong, readonly) NSArray *videoTracks; +@property(nonatomic, strong, readonly) NSArray *videoTracks; /** An identifier for this media stream. */ @property(nonatomic, readonly) NSString *streamId; diff --git a/webrtc/api/objc/RTCMediaStream.mm b/webrtc/api/objc/RTCMediaStream.mm index 3c3e4d9064..666022301a 100644 --- a/webrtc/api/objc/RTCMediaStream.mm +++ b/webrtc/api/objc/RTCMediaStream.mm @@ -19,8 +19,6 @@ #import "webrtc/api/objc/RTCVideoTrack+Private.h" #import "webrtc/base/objc/NSString+StdString.h" -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 - @implementation RTCMediaStream { NSMutableArray *_audioTracks; NSMutableArray *_videoTracks; @@ -37,13 +35,11 @@ return [self initWithNativeMediaStream:stream]; } -- (NSArray *)audioTracks { -// - (NSArray *)audioTracks { +- (NSArray *)audioTracks { return [_audioTracks copy]; } -- (NSArray *)videoTracks { -// - (NSArray *)videoTracks { +- (NSArray *)videoTracks { return [_videoTracks copy]; } diff --git a/webrtc/api/objc/RTCPeerConnection+Stats.mm b/webrtc/api/objc/RTCPeerConnection+Stats.mm index 6a506d4aaa..5032c84e54 100644 --- a/webrtc/api/objc/RTCPeerConnection+Stats.mm +++ b/webrtc/api/objc/RTCPeerConnection+Stats.mm @@ -16,15 +16,12 @@ #import "webrtc/api/objc/RTCStatsReport+Private.h" #import "webrtc/base/objc/NSString+StdString.h" -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 - namespace webrtc { class StatsObserverAdapter : public StatsObserver { public: StatsObserverAdapter(void (^completionHandler) - (NSArray *stats)) { - // (NSArray *stats)) { + (NSArray *stats)) { completion_handler_ = completionHandler; } @@ -45,8 +42,7 @@ class StatsObserverAdapter : public StatsObserver { } private: - void (^completion_handler_)(NSArray *stats); - // void (^completion_handler_)(NSArray *stats); + void (^completion_handler_)(NSArray *stats); }; } // namespace webrtc @@ -55,8 +51,7 @@ class StatsObserverAdapter : public StatsObserver { - (void)statsForTrack:(RTCMediaStreamTrack *)mediaStreamTrack statsOutputLevel:(RTCStatsOutputLevel)statsOutputLevel completionHandler: - (void (^)(NSArray *stats))completionHandler { - // (void (^)(NSArray *stats))completionHandler { + (void (^)(NSArray *stats))completionHandler { rtc::scoped_refptr observer( new rtc::RefCountedObject (completionHandler)); diff --git a/webrtc/api/objc/RTCPeerConnection.h b/webrtc/api/objc/RTCPeerConnection.h index 72645b523f..80e8bf3d70 100644 --- a/webrtc/api/objc/RTCPeerConnection.h +++ b/webrtc/api/objc/RTCPeerConnection.h @@ -22,9 +22,8 @@ @class RTCStatsReport; NS_ASSUME_NONNULL_BEGIN -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 -extern NSString * _Nonnull const kRTCPeerConnectionErrorDomain; +extern NSString * const kRTCPeerConnectionErrorDomain; extern int const kRTCSessionDescriptionErrorCode; /** Represents the signaling state of the peer connection. */ @@ -67,36 +66,35 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) { @protocol RTCPeerConnectionDelegate /** Called when the SignalingState changed. */ -- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection +- (void)peerConnection:(RTCPeerConnection *)peerConnection didChangeSignalingState:(RTCSignalingState)stateChanged; /** Called when media is received on a new stream from remote peer. */ -- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection - didAddStream:(nonnull RTCMediaStream *)stream; +- (void)peerConnection:(RTCPeerConnection *)peerConnection + didAddStream:(RTCMediaStream *)stream; /** Called when a remote peer closes a stream. */ -- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection - didRemoveStream:(nonnull RTCMediaStream *)stream; +- (void)peerConnection:(RTCPeerConnection *)peerConnection + didRemoveStream:(RTCMediaStream *)stream; /** Called when negotiation is needed, for example ICE has restarted. */ -- (void)peerConnectionShouldNegotiate: - (nonnull RTCPeerConnection *)peerConnection; +- (void)peerConnectionShouldNegotiate:(RTCPeerConnection *)peerConnection; /** Called any time the IceConnectionState changes. */ -- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection +- (void)peerConnection:(RTCPeerConnection *)peerConnection didChangeIceConnectionState:(RTCIceConnectionState)newState; /** Called any time the IceGatheringState changes. */ -- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection +- (void)peerConnection:(RTCPeerConnection *)peerConnection didChangeIceGatheringState:(RTCIceGatheringState)newState; /** New ice candidate has been found. */ -- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection - didGenerateIceCandidate:(nonnull RTCIceCandidate *)candidate; +- (void)peerConnection:(RTCPeerConnection *)peerConnection + didGenerateIceCandidate:(RTCIceCandidate *)candidate; /** New data channel has been opened. */ -- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection - didOpenDataChannel:(nonnull RTCDataChannel *)dataChannel; +- (void)peerConnection:(RTCPeerConnection *)peerConnection + didOpenDataChannel:(RTCDataChannel *)dataChannel; @end @@ -107,7 +105,7 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) { * streams being added or removed. */ @property(nonatomic, weak, nullable) id delegate; -@property(nonatomic, readonly, nonnull) NSArray *localStreams; +@property(nonatomic, readonly) NSArray *localStreams; @property(nonatomic, readonly, nullable) RTCSessionDescription *localDescription; @property(nonatomic, readonly, nullable) @@ -116,18 +114,18 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) { @property(nonatomic, readonly) RTCIceConnectionState iceConnectionState; @property(nonatomic, readonly) RTCIceGatheringState iceGatheringState; -- (nonnull instancetype)init NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; /** Initialize an RTCPeerConnection with a configuration, constraints, and * delegate. */ -- (nonnull instancetype)initWithFactory: - (nonnull RTCPeerConnectionFactory *)factory - configuration: - (nonnull RTCConfiguration *)configuration - constraints: - (nonnull RTCMediaConstraints *)constraints - delegate: +- (instancetype)initWithFactory: + (RTCPeerConnectionFactory *)factory + configuration: + (RTCConfiguration *)configuration + constraints: + (RTCMediaConstraints *)constraints + delegate: (nullable id)delegate NS_DESIGNATED_INITIALIZER; @@ -135,33 +133,33 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) { - (void)close; /** Provide a remote candidate to the ICE Agent. */ -- (void)addIceCandidate:(nonnull RTCIceCandidate *)candidate; +- (void)addIceCandidate:(RTCIceCandidate *)candidate; /** Add a new media stream to be sent on this peer connection. */ -- (void)addStream:(nonnull RTCMediaStream *)stream; +- (void)addStream:(RTCMediaStream *)stream; /** Remove the given media stream from this peer connection. */ -- (void)removeStream:(nonnull RTCMediaStream *)stream; +- (void)removeStream:(RTCMediaStream *)stream; /** Generate an SDP offer. */ -- (void)offerForConstraints:(nonnull RTCMediaConstraints *)constraints +- (void)offerForConstraints:(RTCMediaConstraints *)constraints completionHandler:(nullable void (^) (RTCSessionDescription * _Nullable sdp, NSError * _Nullable error))completionHandler; /** Generate an SDP answer. */ -- (void)answerForConstraints:(nonnull RTCMediaConstraints *)constraints +- (void)answerForConstraints:(RTCMediaConstraints *)constraints completionHandler:(nullable void (^) (RTCSessionDescription * _Nullable sdp, NSError * _Nullable error))completionHandler; /** Apply the supplied RTCSessionDescription as the local description. */ -- (void)setLocalDescription:(nonnull RTCSessionDescription *)sdp +- (void)setLocalDescription:(RTCSessionDescription *)sdp completionHandler: (nullable void (^)(NSError * _Nullable error))completionHandler; /** Apply the supplied RTCSessionDescription as the remote description. */ -- (void)setRemoteDescription:(nonnull RTCSessionDescription *)sdp +- (void)setRemoteDescription:(RTCSessionDescription *)sdp completionHandler: (nullable void (^)(NSError * _Nullable error))completionHandler; @@ -170,8 +168,8 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) { @interface RTCPeerConnection (DataChannel) /** Create a new data channel with the given label and configuration. */ -- (nonnull RTCDataChannel *)dataChannelForLabel:(nonnull NSString *)label - configuration:(nonnull RTCDataChannelConfiguration *)configuration; +- (RTCDataChannel *)dataChannelForLabel:(NSString *)label + configuration:(RTCDataChannelConfiguration *)configuration; @end @@ -184,8 +182,7 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) { (nullable RTCMediaStreamTrack *)mediaStreamTrack statsOutputLevel:(RTCStatsOutputLevel)statsOutputLevel completionHandler: - (nullable void (^)(NSArray * _Nonnull stats))completionHandler; - // (nullable void (^)(NSArray *stats))completionHandler; + (nullable void (^)(NSArray *stats))completionHandler; @end diff --git a/webrtc/api/objc/RTCStatsReport.h b/webrtc/api/objc/RTCStatsReport.h index 9a120b9072..fc66faf2cf 100644 --- a/webrtc/api/objc/RTCStatsReport.h +++ b/webrtc/api/objc/RTCStatsReport.h @@ -11,7 +11,6 @@ #import NS_ASSUME_NONNULL_BEGIN -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 /** This does not currently conform to the spec. */ @interface RTCStatsReport : NSObject @@ -26,8 +25,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSString *statsId; /** A dictionary holding the actual stats. */ -@property(nonatomic, readonly) NSDictionary *values; -// @property(nonatomic, readonly) NSDictionary *values; +@property(nonatomic, readonly) NSDictionary *values; - (instancetype)init NS_UNAVAILABLE; diff --git a/webrtc/api/objc/RTCStatsReport.mm b/webrtc/api/objc/RTCStatsReport.mm index 76de95078c..b3cd1a19ef 100644 --- a/webrtc/api/objc/RTCStatsReport.mm +++ b/webrtc/api/objc/RTCStatsReport.mm @@ -16,8 +16,6 @@ #import "webrtc/base/objc/NSString+StdString.h" #import "webrtc/base/objc/RTCLogging.h" -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 - @implementation RTCStatsReport @synthesize timestamp = _timestamp; diff --git a/webrtc/api/objc/RTCVideoFrame.h b/webrtc/api/objc/RTCVideoFrame.h index c71029051a..8ed23ba82c 100644 --- a/webrtc/api/objc/RTCVideoFrame.h +++ b/webrtc/api/objc/RTCVideoFrame.h @@ -11,7 +11,6 @@ #import NS_ASSUME_NONNULL_BEGIN -// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592 @interface RTCVideoFrame : NSObject @@ -31,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) int32_t uPitch; @property(nonatomic, readonly) int32_t vPitch; -- (nonnull instancetype)init NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; @end