diff options
author | Muxi Yan <mxyan@google.com> | 2018-11-06 10:15:20 -0800 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2018-11-06 10:51:06 -0800 |
commit | 6b8f0ceae8f581cfd63b40c4e2ccab95783081ae (patch) | |
tree | 4c4cc199363c987e2f4bae1dee9038d18944b853 | |
parent | 17a67fdb0fb01fe34c75d2c6bf34e24214222a89 (diff) |
A few nits
-rw-r--r-- | src/objective-c/GRPCClient/GRPCCall+OAuth2.h | 2 | ||||
-rw-r--r-- | src/objective-c/GRPCClient/GRPCCall.h | 4 | ||||
-rw-r--r-- | src/objective-c/GRPCClient/GRPCCall.m | 9 | ||||
-rw-r--r-- | src/objective-c/ProtoRPC/ProtoRPC.h | 4 |
4 files changed, 12 insertions, 7 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall+OAuth2.h b/src/objective-c/GRPCClient/GRPCCall+OAuth2.h index 3054bfc5a7..60cdc50bfd 100644 --- a/src/objective-c/GRPCClient/GRPCCall+OAuth2.h +++ b/src/objective-c/GRPCClient/GRPCCall+OAuth2.h @@ -24,7 +24,7 @@ @interface GRPCCall (OAuth2) @property(atomic, copy) NSString* oauth2AccessToken; -@property(atomic, readonly) NSString* oauth2ChallengeHeader; +@property(atomic, copy, readonly) NSString* oauth2ChallengeHeader; @property(atomic, strong) id<GRPCAuthorizationProtocol> tokenProvider; @end diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h index a1f139fc18..4f0660d203 100644 --- a/src/objective-c/GRPCClient/GRPCCall.h +++ b/src/objective-c/GRPCClient/GRPCCall.h @@ -196,7 +196,7 @@ extern NSString *const kGRPCTrailersKey; - (instancetype)init NS_UNAVAILABLE; -+ (instancetype) new NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; /** Initialize with all properties. */ - (instancetype)initWithHost:(NSString *)host @@ -224,7 +224,7 @@ extern NSString *const kGRPCTrailersKey; - (instancetype)init NS_UNAVAILABLE; -+ (instancetype) new NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; /** * Designated initializer for a call. diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 2abc0fe8f3..2f727e62be 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -67,6 +67,7 @@ const char *kCFStreamVarName = "grpc_cfstream"; @implementation GRPCRequestOptions - (instancetype)initWithHost:(NSString *)host path:(NSString *)path safety:(GRPCCallSafety)safety { + NSAssert(host.length != 0 && path.length != 0, @"Host and Path cannot be empty"); if ((self = [super init])) { _host = [host copy]; _path = [path copy]; @@ -90,7 +91,7 @@ const char *kCFStreamVarName = "grpc_cfstream"; /** The handler of responses. */ id<GRPCResponseHandler> _handler; - // Thread safety of ivars below are protected by _dispatcheQueue. + // Thread safety of ivars below are protected by _dispatchQueue. /** * Make use of legacy GRPCCall to make calls. Nullified when call is finished. @@ -121,7 +122,11 @@ const char *kCFStreamVarName = "grpc_cfstream"; if ((self = [super init])) { _requestOptions = [requestOptions copy]; - _callOptions = [callOptions copy]; + if (callOptions == nil) { + _callOptions = [[GRPCCallOptions alloc] init]; + } else { + _callOptions = [callOptions copy]; + } _handler = responseHandler; _initialMetadataPublished = NO; _pipe = [GRXBufferedPipe pipe]; diff --git a/src/objective-c/ProtoRPC/ProtoRPC.h b/src/objective-c/ProtoRPC/ProtoRPC.h index b0f4ced99e..3d137a53ff 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.h +++ b/src/objective-c/ProtoRPC/ProtoRPC.h @@ -66,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init NS_UNAVAILABLE; -+ (instancetype) new NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; /** * Users should not use this initializer directly. Call objects will be created, initialized, and @@ -92,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init NS_UNAVAILABLE; -+ (instancetype) new NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; /** * Users should not use this initializer directly. Call objects will be created, initialized, and |