Reformat the WebRTC code base

Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
This commit is contained in:
Yves Gerey
2018-06-19 15:03:05 +02:00
parent b602123a5a
commit 665174fdbb
1569 changed files with 30495 additions and 30309 deletions

View File

@ -18,8 +18,7 @@
@class RTCPeerConnectionFactory;
@interface ARDAppClient () <ARDSignalingChannelDelegate,
RTCPeerConnectionDelegate>
@interface ARDAppClient () <ARDSignalingChannelDelegate, RTCPeerConnectionDelegate>
// All properties should only be mutated from the main queue.
@property(nonatomic, strong) id<ARDRoomServerClient> roomServerClient;
@ -43,8 +42,7 @@
@property(nonatomic, strong) NSURL *webSocketRestURL;
@property(nonatomic, readonly) BOOL isLoopback;
@property(nonatomic, strong)
RTCMediaConstraints *defaultPeerConnectionConstraints;
@property(nonatomic, strong) RTCMediaConstraints *defaultPeerConnectionConstraints;
- (instancetype)initWithRoomServerClient:(id<ARDRoomServerClient>)rsClient
signalingChannel:(id<ARDSignalingChannel>)channel

View File

@ -32,30 +32,25 @@ typedef NS_ENUM(NSInteger, ARDAppClientState) {
// main queue.
@protocol ARDAppClientDelegate <NSObject>
- (void)appClient:(ARDAppClient *)client
didChangeState:(ARDAppClientState)state;
- (void)appClient:(ARDAppClient *)client didChangeState:(ARDAppClientState)state;
- (void)appClient:(ARDAppClient *)client
didChangeConnectionState:(RTCIceConnectionState)state;
- (void)appClient:(ARDAppClient *)client didChangeConnectionState:(RTCIceConnectionState)state;
- (void)appClient:(ARDAppClient *)client
didCreateLocalCapturer:(RTCCameraVideoCapturer *)localCapturer;
- (void)appClient:(ARDAppClient *)client
didReceiveLocalVideoTrack:(RTCVideoTrack *)localVideoTrack;
- (void)appClient:(ARDAppClient *)client didReceiveLocalVideoTrack:(RTCVideoTrack *)localVideoTrack;
- (void)appClient:(ARDAppClient *)client
didReceiveRemoteVideoTrack:(RTCVideoTrack *)remoteVideoTrack;
- (void)appClient:(ARDAppClient *)client
didError:(NSError *)error;
- (void)appClient:(ARDAppClient *)client didError:(NSError *)error;
- (void)appClient:(ARDAppClient *)client
didGetStats:(NSArray *)stats;
- (void)appClient:(ARDAppClient *)client didGetStats:(NSArray *)stats;
@optional
- (void)appClient:(ARDAppClient *)client
didCreateLocalFileCapturer:(RTCFileVideoCapturer *)fileCapturer;
didCreateLocalFileCapturer:(RTCFileVideoCapturer *)fileCapturer;
- (void)appClient:(ARDAppClient *)client
didCreateLocalExternalSampleCapturer:(ARDExternalSampleCapturer *)externalSampleCapturer;

View File

@ -10,5 +10,5 @@
#import "ARDRoomServerClient.h"
@interface ARDAppEngineClient : NSObject <ARDRoomServerClient>
@interface ARDAppEngineClient : NSObject<ARDRoomServerClient>
@end

View File

@ -14,10 +14,10 @@
@property(nonatomic, assign) ARDJoinResultType result;
@property(nonatomic, assign) BOOL isInitiator;
@property(nonatomic, strong) NSString *roomId;
@property(nonatomic, strong) NSString *clientId;
@property(nonatomic, strong) NSArray *messages;
@property(nonatomic, strong) NSURL *webSocketURL;
@property(nonatomic, strong) NSURL *webSocketRestURL;
@property(nonatomic, strong) NSString* roomId;
@property(nonatomic, strong) NSString* clientId;
@property(nonatomic, strong) NSArray* messages;
@property(nonatomic, strong) NSURL* webSocketURL;
@property(nonatomic, strong) NSURL* webSocketRestURL;
@end

View File

@ -18,14 +18,12 @@
- (void)joinRoomWithRoomId:(NSString *)roomId
isLoopback:(BOOL)isLoopback
completionHandler:(void (^)(ARDJoinResponse *response,
NSError *error))completionHandler;
completionHandler:(void (^)(ARDJoinResponse *response, NSError *error))completionHandler;
- (void)sendMessage:(ARDSignalingMessage *)message
forRoomId:(NSString *)roomId
clientId:(NSString *)clientId
completionHandler:(void (^)(ARDMessageResponse *response,
NSError *error))completionHandler;
completionHandler:(void (^)(ARDMessageResponse *response, NSError *error))completionHandler;
- (void)leaveRoomWithRoomId:(NSString *)roomId
clientId:(NSString *)clientId

View File

@ -26,11 +26,9 @@ typedef NS_ENUM(NSInteger, ARDSignalingChannelState) {
@protocol ARDSignalingChannel;
@protocol ARDSignalingChannelDelegate <NSObject>
- (void)channel:(id<ARDSignalingChannel>)channel
didChangeState:(ARDSignalingChannelState)state;
- (void)channel:(id<ARDSignalingChannel>)channel didChangeState:(ARDSignalingChannelState)state;
- (void)channel:(id<ARDSignalingChannel>)channel
didReceiveMessage:(ARDSignalingMessage *)message;
- (void)channel:(id<ARDSignalingChannel>)channel didReceiveMessage:(ARDSignalingMessage *)message;
@end
@ -42,11 +40,9 @@ typedef NS_ENUM(NSInteger, ARDSignalingChannelState) {
@property(nonatomic, weak) id<ARDSignalingChannelDelegate> delegate;
// Registers the channel for the given room and client id.
- (void)registerForRoomId:(NSString *)roomId
clientId:(NSString *)clientId;
- (void)registerForRoomId:(NSString *)roomId clientId:(NSString *)clientId;
// Sends signaling message over the channel.
- (void)sendMessage:(ARDSignalingMessage *)message;
@end

View File

@ -42,8 +42,7 @@ typedef enum {
@property(nonatomic, readonly) NSArray<RTCIceCandidate *> *candidates;
- (instancetype)initWithRemovedCandidates:
(NSArray<RTCIceCandidate *> *)candidates;
- (instancetype)initWithRemovedCandidates:(NSArray<RTCIceCandidate *> *)candidates;
@end

View File

@ -15,8 +15,7 @@
@protocol ARDTURNClient <NSObject>
// Returns TURN server urls if successful.
- (void)requestServersWithCompletionHandler:
(void (^)(NSArray *turnServers,
NSError *error))completionHandler;
- (void)requestServersWithCompletionHandler:(void (^)(NSArray *turnServers,
NSError *error))completionHandler;
@end

View File

@ -21,8 +21,7 @@
// Registers with the WebSocket server for the given room and client id once
// the web socket connection is open.
- (void)registerForRoomId:(NSString *)roomId
clientId:(NSString *)clientId;
- (void)registerForRoomId:(NSString *)roomId clientId:(NSString *)clientId;
// Sends message over the WebSocket connection if registered, otherwise POSTs to
// the web socket server instead.

View File

@ -13,8 +13,7 @@
@interface RTCIceCandidate (JSON)
+ (RTCIceCandidate *)candidateFromJSONDictionary:(NSDictionary *)dictionary;
+ (NSArray<RTCIceCandidate *> *)candidatesFromJSONDictionary:
(NSDictionary *)dictionary;
+ (NSArray<RTCIceCandidate *> *)candidatesFromJSONDictionary:(NSDictionary *)dictionary;
+ (NSData *)JSONDataForIceCandidates:(NSArray<RTCIceCandidate *> *)candidates
withType:(NSString *)typeValue;
- (NSData *)JSONData;

View File

@ -12,8 +12,6 @@
@interface RTCMediaConstraints (JSON)
+ (RTCMediaConstraints *)constraintsFromJSONDictionary:
(NSDictionary *)dictionary;
+ (RTCMediaConstraints *)constraintsFromJSONDictionary:(NSDictionary *)dictionary;
@end

View File

@ -12,8 +12,7 @@
@interface RTCSessionDescription (JSON)
+ (RTCSessionDescription *)descriptionFromJSONDictionary:
(NSDictionary *)dictionary;
+ (RTCSessionDescription *)descriptionFromJSONDictionary:(NSDictionary *)dictionary;
- (NSData *)JSONData;
@end

View File

@ -22,17 +22,14 @@
// Issues an asynchronous request that calls back on main queue.
+ (void)sendAsyncRequest:(NSURLRequest *)request
completionHandler:(void (^)(NSURLResponse *response,
NSData *data,
NSError *error))completionHandler;
completionHandler:
(void (^)(NSURLResponse *response, NSData *data, NSError *error))completionHandler;
// Posts data to the specified URL.
+ (void)sendAsyncPostToURL:(NSURL *)url
withData:(NSData *)data
completionHandler:(void (^)(BOOL succeeded,
NSData *data))completionHandler;
completionHandler:(void (^)(BOOL succeeded, NSData *data))completionHandler;
@end
NSInteger ARDGetCpuUsagePercentage(void);

View File

@ -13,5 +13,5 @@
// The main application class of the AppRTCMobile iOS app demonstrating
// interoperability between the Objective C implementation of PeerConnection
// and the appr.tc demo webapp.
@interface ARDAppDelegate : NSObject <UIApplicationDelegate>
@interface ARDAppDelegate : NSObject<UIApplicationDelegate>
@end