clang-format

pull/16190/head
Muxi Yan 6 years ago
parent cc58524994
commit 26108e1106
  1. 18
      src/objective-c/GRPCClient/GRPCCall.h
  2. 10
      src/objective-c/GRPCClient/GRPCCallOptions.m
  3. 2
      src/objective-c/GRPCClient/private/GRPCChannelPool.m
  4. 2
      src/objective-c/GRPCClient/private/GRPCHost.m
  5. 4
      src/objective-c/ProtoRPC/ProtoRPC.h
  6. 26
      src/objective-c/ProtoRPC/ProtoRPC.m

@ -156,9 +156,9 @@ extern NSString *const kGRPCTrailersKey;
@optional
/**
* Issued when initial metadata is received from the server. The task must be scheduled onto the
* dispatch queue in property \a dispatchQueue.
*/
* Issued when initial metadata is received from the server. The task must be scheduled onto the
* dispatch queue in property \a dispatchQueue.
*/
- (void)receivedInitialMetadata:(NSDictionary *_Nullable)initialMetadata;
/**
@ -309,7 +309,7 @@ NS_ASSUME_NONNULL_END
*
* The property is initialized to an empty NSMutableDictionary.
*/
@property(null_unspecified, atomic, readonly) NSMutableDictionary * requestHeaders;
@property(null_unspecified, atomic, readonly) NSMutableDictionary *requestHeaders;
/**
* This dictionary is populated with the HTTP headers received from the server. This happens before
@ -342,9 +342,9 @@ NS_ASSUME_NONNULL_END
* host parameter should not contain the scheme (http:// or https://), only the name or IP addr
* and the port number, for example @"localhost:5050".
*/
- (instancetype _Null_unspecified)initWithHost:(NSString * _Null_unspecified)host
path:(NSString * _Null_unspecified)path
requestsWriter:(GRXWriter * _Null_unspecified)requestWriter;
- (instancetype _Null_unspecified)initWithHost:(NSString *_Null_unspecified)host
path:(NSString *_Null_unspecified)path
requestsWriter:(GRXWriter *_Null_unspecified)requestWriter;
/**
* Finishes the request side of this call, notifies the server that the RPC should be cancelled, and
@ -355,7 +355,9 @@ NS_ASSUME_NONNULL_END
/**
* The following methods are deprecated.
*/
+ (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString * _Null_unspecified)host path:(NSString * _Null_unspecified)path;
+ (void)setCallSafety:(GRPCCallSafety)callSafety
host:(NSString *_Null_unspecified)host
path:(NSString *_Null_unspecified)path;
@property(null_unspecified, atomic, copy, readwrite) NSString *serverName;
@property NSTimeInterval timeout;
- (void)setResponseDispatchQueue:(dispatch_queue_t _Null_unspecified)queue;

@ -183,7 +183,7 @@ static const NSUInteger kDefaultChannelID = 0;
userAgentPrefix:_userAgentPrefix
responseSizeLimit:_responseSizeLimit
compressionAlgorithm:_compressionAlgorithm
retryEnabled:_retryEnabled
retryEnabled:_retryEnabled
keepaliveInterval:_keepaliveInterval
keepaliveTimeout:_keepaliveTimeout
connectMinTimeout:_connectMinTimeout
@ -211,7 +211,7 @@ static const NSUInteger kDefaultChannelID = 0;
userAgentPrefix:_userAgentPrefix
responseSizeLimit:_responseSizeLimit
compressionAlgorithm:_compressionAlgorithm
retryEnabled:_retryEnabled
retryEnabled:_retryEnabled
keepaliveInterval:_keepaliveInterval
keepaliveTimeout:_keepaliveTimeout
connectMinTimeout:_connectMinTimeout
@ -328,7 +328,7 @@ static const NSUInteger kDefaultChannelID = 0;
userAgentPrefix:kDefaultUserAgentPrefix
responseSizeLimit:kDefaultResponseSizeLimit
compressionAlgorithm:kDefaultCompressionAlgorithm
retryEnabled:kDefaultRetryEnabled
retryEnabled:kDefaultRetryEnabled
keepaliveInterval:kDefaultKeepaliveInterval
keepaliveTimeout:kDefaultKeepaliveTimeout
connectMinTimeout:kDefaultConnectMinTimeout
@ -355,7 +355,7 @@ static const NSUInteger kDefaultChannelID = 0;
userAgentPrefix:_userAgentPrefix
responseSizeLimit:_responseSizeLimit
compressionAlgorithm:_compressionAlgorithm
retryEnabled:_retryEnabled
retryEnabled:_retryEnabled
keepaliveInterval:_keepaliveInterval
keepaliveTimeout:_keepaliveTimeout
connectMinTimeout:_connectMinTimeout
@ -383,7 +383,7 @@ static const NSUInteger kDefaultChannelID = 0;
userAgentPrefix:_userAgentPrefix
responseSizeLimit:_responseSizeLimit
compressionAlgorithm:_compressionAlgorithm
retryEnabled:_retryEnabled
retryEnabled:_retryEnabled
keepaliveInterval:_keepaliveInterval
keepaliveTimeout:_keepaliveTimeout
connectMinTimeout:_connectMinTimeout

@ -18,6 +18,7 @@
#import <Foundation/Foundation.h>
#import "../internal/GRPCCallOptions+internal.h"
#import "GRPCChannel.h"
#import "GRPCChannelFactory.h"
#import "GRPCChannelPool.h"
@ -26,7 +27,6 @@
#import "GRPCInsecureChannelFactory.h"
#import "GRPCSecureChannelFactory.h"
#import "version.h"
#import "../internal/GRPCCallOptions+internal.h"
#import <GRPCClient/GRPCCall+Cronet.h>
#include <grpc/support/log.h>

@ -25,6 +25,7 @@
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#import "../internal/GRPCCallOptions+internal.h"
#import "GRPCChannelFactory.h"
#import "GRPCCompletionQueue.h"
#import "GRPCConnectivityMonitor.h"
@ -32,7 +33,6 @@
#import "GRPCSecureChannelFactory.h"
#import "NSDictionary+GRPC.h"
#import "version.h"
#import "../internal/GRPCCallOptions+internal.h"
NS_ASSUME_NONNULL_BEGIN

@ -31,8 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
@optional
/**
* Issued when initial metadata is received from the server. The task must be scheduled onto the
* dispatch queue in property \a dispatchQueue. */
* Issued when initial metadata is received from the server. The task must be scheduled onto the
* dispatch queue in property \a dispatchQueue. */
- (void)receivedInitialMetadata:(NSDictionary *_Nullable)initialMetadata;
/**

@ -28,19 +28,19 @@
#import <RxLibrary/GRXWriter+Transformations.h>
/**
* Generate an NSError object that represents a failure in parsing a proto class.
*/
* Generate an NSError object that represents a failure in parsing a proto class.
*/
static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsingError) {
NSDictionary *info = @{
NSLocalizedDescriptionKey : @"Unable to parse response from the server",
NSLocalizedRecoverySuggestionErrorKey :
@"If this RPC is idempotent, retry "
@"with exponential backoff. Otherwise, query the server status before "
@"retrying.",
NSUnderlyingErrorKey : parsingError,
@"Expected class" : expectedClass,
@"Received value" : proto,
};
NSLocalizedDescriptionKey : @"Unable to parse response from the server",
NSLocalizedRecoverySuggestionErrorKey :
@"If this RPC is idempotent, retry "
@"with exponential backoff. Otherwise, query the server status before "
@"retrying.",
NSUnderlyingErrorKey : parsingError,
@"Expected class" : expectedClass,
@"Received value" : proto,
};
// TODO(jcanizales): Use kGRPCErrorDomain and GRPCErrorCodeInternal when they're public.
return [NSError errorWithDomain:@"io.grpc" code:13 userInfo:info];
}
@ -190,7 +190,9 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing
}
} else {
if ([self->_handler respondsToSelector:@selector(closedWithTrailingMetadata:error:)]) {
[self->_handler closedWithTrailingMetadata:nil error:ErrorForBadProto(message, _responseClass, error)];
[self->_handler
closedWithTrailingMetadata:nil
error:ErrorForBadProto(message, _responseClass, error)];
}
self->_handler = nil;
[self->_call cancel];

Loading…
Cancel
Save