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}
diff --git a/examples/objc/AppRTCMobile/ARDAppClient+Internal.h b/examples/objc/AppRTCMobile/ARDAppClient+Internal.h
index 3cf4040..8e96b16 100644
--- a/examples/objc/AppRTCMobile/ARDAppClient+Internal.h
+++ b/examples/objc/AppRTCMobile/ARDAppClient+Internal.h
@@ -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
diff --git a/examples/objc/AppRTCMobile/ARDAppClient.h b/examples/objc/AppRTCMobile/ARDAppClient.h
index e513db1..07cd53d 100644
--- a/examples/objc/AppRTCMobile/ARDAppClient.h
+++ b/examples/objc/AppRTCMobile/ARDAppClient.h
@@ -32,30 +32,25 @@
// 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;
diff --git a/examples/objc/AppRTCMobile/ARDAppEngineClient.h b/examples/objc/AppRTCMobile/ARDAppEngineClient.h
index 7514f36..db4e2ef 100644
--- a/examples/objc/AppRTCMobile/ARDAppEngineClient.h
+++ b/examples/objc/AppRTCMobile/ARDAppEngineClient.h
@@ -10,5 +10,5 @@
#import "ARDRoomServerClient.h"
-@interface ARDAppEngineClient : NSObject <ARDRoomServerClient>
+@interface ARDAppEngineClient : NSObject<ARDRoomServerClient>
@end
diff --git a/examples/objc/AppRTCMobile/ARDJoinResponse+Internal.h b/examples/objc/AppRTCMobile/ARDJoinResponse+Internal.h
index b320299..0edf708 100644
--- a/examples/objc/AppRTCMobile/ARDJoinResponse+Internal.h
+++ b/examples/objc/AppRTCMobile/ARDJoinResponse+Internal.h
@@ -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
diff --git a/examples/objc/AppRTCMobile/ARDRoomServerClient.h b/examples/objc/AppRTCMobile/ARDRoomServerClient.h
index 70694a8..3a5818d 100644
--- a/examples/objc/AppRTCMobile/ARDRoomServerClient.h
+++ b/examples/objc/AppRTCMobile/ARDRoomServerClient.h
@@ -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
diff --git a/examples/objc/AppRTCMobile/ARDSignalingChannel.h b/examples/objc/AppRTCMobile/ARDSignalingChannel.h
index 70ba2ff..396b117 100644
--- a/examples/objc/AppRTCMobile/ARDSignalingChannel.h
+++ b/examples/objc/AppRTCMobile/ARDSignalingChannel.h
@@ -26,11 +26,9 @@
@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 @@
@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
-
diff --git a/examples/objc/AppRTCMobile/ARDSignalingMessage.h b/examples/objc/AppRTCMobile/ARDSignalingMessage.h
index e605172..93ff486 100644
--- a/examples/objc/AppRTCMobile/ARDSignalingMessage.h
+++ b/examples/objc/AppRTCMobile/ARDSignalingMessage.h
@@ -42,8 +42,7 @@
@property(nonatomic, readonly) NSArray<RTCIceCandidate *> *candidates;
-- (instancetype)initWithRemovedCandidates:
- (NSArray<RTCIceCandidate *> *)candidates;
+- (instancetype)initWithRemovedCandidates:(NSArray<RTCIceCandidate *> *)candidates;
@end
diff --git a/examples/objc/AppRTCMobile/ARDTURNClient.h b/examples/objc/AppRTCMobile/ARDTURNClient.h
index 75ccffc..0cefaf6 100644
--- a/examples/objc/AppRTCMobile/ARDTURNClient.h
+++ b/examples/objc/AppRTCMobile/ARDTURNClient.h
@@ -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
diff --git a/examples/objc/AppRTCMobile/ARDWebSocketChannel.h b/examples/objc/AppRTCMobile/ARDWebSocketChannel.h
index ffb0b72..81888e6 100644
--- a/examples/objc/AppRTCMobile/ARDWebSocketChannel.h
+++ b/examples/objc/AppRTCMobile/ARDWebSocketChannel.h
@@ -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.
diff --git a/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.h b/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.h
index d2e5e33..1826555 100644
--- a/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.h
+++ b/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.h
@@ -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;
diff --git a/examples/objc/AppRTCMobile/RTCMediaConstraints+JSON.h b/examples/objc/AppRTCMobile/RTCMediaConstraints+JSON.h
index 74f89a9..42d7ab0 100644
--- a/examples/objc/AppRTCMobile/RTCMediaConstraints+JSON.h
+++ b/examples/objc/AppRTCMobile/RTCMediaConstraints+JSON.h
@@ -12,8 +12,6 @@
@interface RTCMediaConstraints (JSON)
-+ (RTCMediaConstraints *)constraintsFromJSONDictionary:
- (NSDictionary *)dictionary;
++ (RTCMediaConstraints *)constraintsFromJSONDictionary:(NSDictionary *)dictionary;
@end
-
diff --git a/examples/objc/AppRTCMobile/RTCSessionDescription+JSON.h b/examples/objc/AppRTCMobile/RTCSessionDescription+JSON.h
index cccff9a..f567121 100644
--- a/examples/objc/AppRTCMobile/RTCSessionDescription+JSON.h
+++ b/examples/objc/AppRTCMobile/RTCSessionDescription+JSON.h
@@ -12,8 +12,7 @@
@interface RTCSessionDescription (JSON)
-+ (RTCSessionDescription *)descriptionFromJSONDictionary:
- (NSDictionary *)dictionary;
++ (RTCSessionDescription *)descriptionFromJSONDictionary:(NSDictionary *)dictionary;
- (NSData *)JSONData;
@end
diff --git a/examples/objc/AppRTCMobile/common/ARDUtilities.h b/examples/objc/AppRTCMobile/common/ARDUtilities.h
index 5795ff1..5f0d7db 100644
--- a/examples/objc/AppRTCMobile/common/ARDUtilities.h
+++ b/examples/objc/AppRTCMobile/common/ARDUtilities.h
@@ -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);
-
diff --git a/examples/objc/AppRTCMobile/ios/ARDAppDelegate.h b/examples/objc/AppRTCMobile/ios/ARDAppDelegate.h
index 7eafff8..623e859 100644
--- a/examples/objc/AppRTCMobile/ios/ARDAppDelegate.h
+++ b/examples/objc/AppRTCMobile/ios/ARDAppDelegate.h
@@ -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