aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-11-26 17:42:56 -0800
committerGravatar Muxi Yan <mxyan@google.com>2018-11-26 17:42:56 -0800
commitfdf4b8f2f76cf13f9d41c24775b78727de3c994b (patch)
treeb4c06a7e8547d1f6e0205c383a7847c09140c4e6
parent5ae61f5a5a267f5975248d4262133a740e09a66b (diff)
clang-format
-rw-r--r--src/objective-c/GRPCClient/GRPCCallOptions.h2
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannel.h3
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannel.m8
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannelPool.h7
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannelPool.m8
-rw-r--r--src/objective-c/ProtoRPC/ProtoRPC.m14
6 files changed, 23 insertions, 19 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCallOptions.h b/src/objective-c/GRPCClient/GRPCCallOptions.h
index 48bb11aeeb..158a4745d2 100644
--- a/src/objective-c/GRPCClient/GRPCCallOptions.h
+++ b/src/objective-c/GRPCClient/GRPCCallOptions.h
@@ -64,7 +64,7 @@ typedef NS_ENUM(NSUInteger, GRPCTransportType) {
* This method is called when gRPC is about to start the call. When OAuth token is acquired,
* \a handler is expected to be called with \a token being the new token to be used for this call.
*/
-- (void)getTokenWithHandler:(void (^ _Nullable)(NSString * _Nullable token))handler;
+- (void)getTokenWithHandler:(void (^_Nullable)(NSString *_Nullable token))handler;
@end
@interface GRPCCallOptions : NSObject<NSCopying, NSMutableCopying>
diff --git a/src/objective-c/GRPCClient/private/GRPCChannel.h b/src/objective-c/GRPCClient/private/GRPCChannel.h
index 147015bed1..c01aeccf81 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannel.h
+++ b/src/objective-c/GRPCClient/private/GRPCChannel.h
@@ -51,7 +51,8 @@ NS_ASSUME_NONNULL_BEGIN
/** Acquire the dictionary of channel args with current configurations. */
@property(copy, readonly) NSDictionary *channelArgs;
-- (nullable instancetype)initWithHost:(NSString *)host callOptions:(GRPCCallOptions *)callOptions NS_DESIGNATED_INITIALIZER;
+- (nullable instancetype)initWithHost:(NSString *)host
+ callOptions:(GRPCCallOptions *)callOptions NS_DESIGNATED_INITIALIZER;
@end
diff --git a/src/objective-c/GRPCClient/private/GRPCChannel.m b/src/objective-c/GRPCClient/private/GRPCChannel.m
index 24cf670d1b..9432e7ab39 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannel.m
+++ b/src/objective-c/GRPCClient/private/GRPCChannel.m
@@ -226,7 +226,7 @@
if (_unmanagedChannel == NULL) return NULL;
NSString *serverAuthority =
- callOptions.transportType == GRPCTransportTypeCronet ? nil : callOptions.serverAuthority;
+ callOptions.transportType == GRPCTransportTypeCronet ? nil : callOptions.serverAuthority;
NSTimeInterval timeout = callOptions.timeout;
NSAssert(timeout >= 0, @"Invalid timeout");
if (timeout < 0) return NULL;
@@ -236,9 +236,9 @@
}
grpc_slice path_slice = grpc_slice_from_copied_string(path.UTF8String);
gpr_timespec deadline_ms =
- timeout == 0 ? gpr_inf_future(GPR_CLOCK_REALTIME)
- : gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
- gpr_time_from_millis((int64_t)(timeout * 1000), GPR_TIMESPAN));
+ timeout == 0 ? gpr_inf_future(GPR_CLOCK_REALTIME)
+ : gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
+ gpr_time_from_millis((int64_t)(timeout * 1000), GPR_TIMESPAN));
call = grpc_channel_create_call(_unmanagedChannel, NULL, GRPC_PROPAGATE_DEFAULTS,
queue.unmanagedQueue, path_slice,
serverAuthority ? &host_slice : NULL, deadline_ms, NULL);
diff --git a/src/objective-c/GRPCClient/private/GRPCChannelPool.h b/src/objective-c/GRPCClient/private/GRPCChannelPool.h
index 26600ef3a9..7f8ee19fe5 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannelPool.h
+++ b/src/objective-c/GRPCClient/private/GRPCChannelPool.h
@@ -41,14 +41,15 @@ NS_ASSUME_NONNULL_BEGIN
- (nullable instancetype)init NS_UNAVAILABLE;
-+ (nullable instancetype)new NS_UNAVAILABLE;
++ (nullable instancetype) new NS_UNAVAILABLE;
/**
* Initialize with an actual channel object \a channel and a reference to the channel pool.
*/
- (nullable instancetype)initWithChannelConfiguration:
(GRPCChannelConfiguration *)channelConfiguration
- channelPool:(GRPCChannelPool *)channelPool NS_DESIGNATED_INITIALIZER;
+ channelPool:(GRPCChannelPool *)channelPool
+ NS_DESIGNATED_INITIALIZER;
/**
* Create a grpc core call object (grpc_call) from this channel. If channel is disconnected, get a
@@ -91,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN
- (nullable instancetype)init NS_UNAVAILABLE;
-+ (nullable instancetype)new NS_UNAVAILABLE;
++ (nullable instancetype) new NS_UNAVAILABLE;
/**
* Get the global channel pool.
diff --git a/src/objective-c/GRPCClient/private/GRPCChannelPool.m b/src/objective-c/GRPCClient/private/GRPCChannelPool.m
index f6615b5840..646f1e4b86 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannelPool.m
+++ b/src/objective-c/GRPCClient/private/GRPCChannelPool.m
@@ -74,8 +74,9 @@ static const NSTimeInterval kDefaultChannelDestroyDelay = 30;
}
- (void)dealloc {
- NSAssert([_unmanagedCalls count] == 0 && _wrappedChannel == nil, @"Pooled channel should only be"
- "destroyed after the wrapped channel is destroyed");
+ NSAssert([_unmanagedCalls count] == 0 && _wrappedChannel == nil,
+ @"Pooled channel should only be"
+ "destroyed after the wrapped channel is destroyed");
}
- (grpc_call *)unmanagedCallWithPath:(NSString *)path
@@ -183,7 +184,8 @@ static const NSTimeInterval kDefaultChannelDestroyDelay = 30;
+ (instancetype)sharedInstance {
dispatch_once(&gInitChannelPool, ^{
- gChannelPool = [[GRPCChannelPool alloc] initInstanceWithDestroyDelay:kDefaultChannelDestroyDelay];
+ gChannelPool =
+ [[GRPCChannelPool alloc] initInstanceWithDestroyDelay:kDefaultChannelDestroyDelay];
NSAssert(gChannelPool != nil, @"Cannot initialize global channel pool.");
});
return gChannelPool;
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m
index dff88b8591..1db04894d5 100644
--- a/src/objective-c/ProtoRPC/ProtoRPC.m
+++ b/src/objective-c/ProtoRPC/ProtoRPC.m
@@ -145,12 +145,12 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing
self->_handler = nil;
}
[copiedHandler closedWithTrailingMetadata:nil
- error:[NSError errorWithDomain:kGRPCErrorDomain
- code:GRPCErrorCodeCancelled
- userInfo:@{
- NSLocalizedDescriptionKey :
- @"Canceled by app"
- }]];
+ error:[NSError errorWithDomain:kGRPCErrorDomain
+ code:GRPCErrorCodeCancelled
+ userInfo:@{
+ NSLocalizedDescriptionKey :
+ @"Canceled by app"
+ }]];
});
} else {
_handler = nil;
@@ -217,7 +217,7 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing
self->_handler = nil;
}
[copiedHandler closedWithTrailingMetadata:nil
- error:ErrorForBadProto(message, _responseClass, error)];
+ error:ErrorForBadProto(message, _responseClass, error)];
});
[_call cancel];
_call = nil;