diff --git a/src/objective-c/GRPCClient/GRPCCall+Cronet.h b/src/objective-c/GRPCClient/GRPCCall+Cronet.h index d107ada3672..10cea963631 100644 --- a/src/objective-c/GRPCClient/GRPCCall+Cronet.h +++ b/src/objective-c/GRPCClient/GRPCCall+Cronet.h @@ -22,7 +22,7 @@ typedef struct stream_engine stream_engine; // Transport id for Cronet transport -extern const GRPCTransportId gGRPCCoreCronetId; +extern const GRPCTransportID gGRPCCoreCronetId; // Deprecated class. Please use the gGRPCCoreCronetId with GRPCCallOptions.transport instead. @interface GRPCCall (Cronet) diff --git a/src/objective-c/GRPCClient/GRPCCall+Cronet.m b/src/objective-c/GRPCClient/GRPCCall+Cronet.m index a732208e1f6..33b09136b33 100644 --- a/src/objective-c/GRPCClient/GRPCCall+Cronet.m +++ b/src/objective-c/GRPCClient/GRPCCall+Cronet.m @@ -18,7 +18,7 @@ #import "GRPCCall+Cronet.h" -const GRPCTransportId gGRPCCoreCronetId = "io.grpc.transport.core.cronet"; +const GRPCTransportID gGRPCCoreCronetId = "io.grpc.transport.core.cronet"; static BOOL useCronet = NO; static stream_engine *globalCronetEngine; diff --git a/src/objective-c/GRPCClient/GRPCCallOptions.h b/src/objective-c/GRPCClient/GRPCCallOptions.h index e4261b5b5f9..adb4ecad48e 100644 --- a/src/objective-c/GRPCClient/GRPCCallOptions.h +++ b/src/objective-c/GRPCClient/GRPCCallOptions.h @@ -161,7 +161,7 @@ NS_ASSUME_NONNULL_BEGIN * * This is currently an experimental option. */ -@property(readonly) GRPCTransportId transport; +@property(readonly) GRPCTransportID transport; /** * Override the hostname during the TLS hostname validation process. @@ -339,7 +339,7 @@ NS_ASSUME_NONNULL_BEGIN * * An interceptor must not change the value of this option. */ -@property(readwrite) GRPCTransportId transport; +@property(readwrite) GRPCTransportID transport; /** * Override the hostname during the TLS hostname validation process. diff --git a/src/objective-c/GRPCClient/GRPCCallOptions.m b/src/objective-c/GRPCClient/GRPCCallOptions.m index 7f88098eb6f..f9044ddcd34 100644 --- a/src/objective-c/GRPCClient/GRPCCallOptions.m +++ b/src/objective-c/GRPCClient/GRPCCallOptions.m @@ -42,7 +42,7 @@ static NSString *const kDefaultPEMCertificateChain = nil; static NSString *const kDefaultOauth2AccessToken = nil; static const id kDefaultAuthTokenProvider = nil; static const GRPCTransportType kDefaultTransportType = GRPCTransportTypeChttp2BoringSSL; -static const GRPCTransportId kDefaultTransport = NULL; +static const GRPCTransportID kDefaultTransport = NULL; static NSString *const kDefaultHostNameOverride = nil; static const id kDefaultLogContext = nil; static NSString *const kDefaultChannelPoolDomain = nil; @@ -82,7 +82,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) { NSString *_PEMPrivateKey; NSString *_PEMCertificateChain; GRPCTransportType _transportType; - GRPCTransportId _transport; + GRPCTransportID _transport; NSString *_hostNameOverride; id _logContext; NSString *_channelPoolDomain; @@ -166,7 +166,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) { PEMPrivateKey:(NSString *)PEMPrivateKey PEMCertificateChain:(NSString *)PEMCertificateChain transportType:(GRPCTransportType)transportType - transport:(GRPCTransportId)transport + transport:(GRPCTransportID)transport hostNameOverride:(NSString *)hostNameOverride logContext:(id)logContext channelPoolDomain:(NSString *)channelPoolDomain @@ -553,7 +553,7 @@ static BOOL areObjectsEqual(id obj1, id obj2) { _transportType = transportType; } -- (void)setTransport:(GRPCTransportId)transport { +- (void)setTransport:(GRPCTransportID)transport { _transport = transport; } diff --git a/src/objective-c/GRPCClient/GRPCInterceptor.h b/src/objective-c/GRPCClient/GRPCInterceptor.h index 509749769b3..1794ef4b892 100644 --- a/src/objective-c/GRPCClient/GRPCInterceptor.h +++ b/src/objective-c/GRPCClient/GRPCInterceptor.h @@ -177,7 +177,7 @@ NS_ASSUME_NONNULL_BEGIN - (nullable instancetype)initWithFactories:(nullable NSArray> *)factories previousInterceptor:(nullable id)previousInterceptor - transportId:(GRPCTransportId)transportId; + transportId:(GRPCTransportID)transportId; /** * Notify the manager that the interceptor has shut down and the manager should release references diff --git a/src/objective-c/GRPCClient/GRPCInterceptor.m b/src/objective-c/GRPCClient/GRPCInterceptor.m index a7ffe05bddc..abada5a80c1 100644 --- a/src/objective-c/GRPCClient/GRPCInterceptor.m +++ b/src/objective-c/GRPCClient/GRPCInterceptor.m @@ -31,13 +31,13 @@ GRPCInterceptor *_thisInterceptor; dispatch_queue_t _dispatchQueue; NSArray> *_factories; - GRPCTransportId _transportId; + GRPCTransportID _transportId; BOOL _shutDown; } - (instancetype)initWithFactories:(NSArray> *)factories previousInterceptor:(id)previousInterceptor - transportId:(nonnull GRPCTransportId)transportId { + transportId:(nonnull GRPCTransportID)transportId { if ((self = [super init])) { if (factories.count == 0) { [NSException raise:NSInternalInconsistencyException diff --git a/src/objective-c/GRPCClient/GRPCTransport.h b/src/objective-c/GRPCClient/GRPCTransport.h index d5637922152..d9f341d08a3 100644 --- a/src/objective-c/GRPCClient/GRPCTransport.h +++ b/src/objective-c/GRPCClient/GRPCTransport.h @@ -29,15 +29,15 @@ NS_ASSUME_NONNULL_BEGIN * by gRPC by default unless explicitly excluded. */ extern const struct GRPCDefaultTransportImplList { - const GRPCTransportId core_secure; - const GRPCTransportId core_insecure; + const GRPCTransportID core_secure; + const GRPCTransportID core_insecure; } GRPCDefaultTransportImplList; /** Returns whether two transport id's are identical. */ -BOOL TransportIdIsEqual(GRPCTransportId lhs, GRPCTransportId rhs); +BOOL TransportIdIsEqual(GRPCTransportID lhs, GRPCTransportID rhs); /** Returns the hash value of a transport id. */ -NSUInteger TransportIdHash(GRPCTransportId); +NSUInteger TransportIdHash(GRPCTransportID); #pragma mark Transport and factory @@ -66,7 +66,7 @@ NSUInteger TransportIdHash(GRPCTransportId); * Parameter \a transportId is the identifier of the implementation, and \a factory is the factory * object to create the corresponding transport instance. */ -- (void)registerTransportWithId:(GRPCTransportId)transportId +- (void)registerTransportWithId:(GRPCTransportID)transportId factory:(id)factory; @end diff --git a/src/objective-c/GRPCClient/GRPCTransport.m b/src/objective-c/GRPCClient/GRPCTransport.m index 439acfb9cc2..966dc50d64d 100644 --- a/src/objective-c/GRPCClient/GRPCTransport.m +++ b/src/objective-c/GRPCClient/GRPCTransport.m @@ -18,24 +18,24 @@ #import "GRPCTransport.h" -static const GRPCTransportId gGRPCCoreSecureId = "io.grpc.transport.core.secure"; -static const GRPCTransportId gGRPCCoreInsecureId = "io.grpc.transport.core.insecure"; +static const GRPCTransportID gGRPCCoreSecureId = "io.grpc.transport.core.secure"; +static const GRPCTransportID gGRPCCoreInsecureId = "io.grpc.transport.core.insecure"; const struct GRPCDefaultTransportImplList GRPCDefaultTransportImplList = { .core_secure = gGRPCCoreSecureId, .core_insecure = gGRPCCoreInsecureId}; -static const GRPCTransportId gDefaultTransportId = gGRPCCoreSecureId; +static const GRPCTransportID gDefaultTransportId = gGRPCCoreSecureId; static GRPCTransportRegistry *gTransportRegistry = nil; static dispatch_once_t initTransportRegistry; -BOOL TransportIdIsEqual(GRPCTransportId lhs, GRPCTransportId rhs) { +BOOL TransportIdIsEqual(GRPCTransportID lhs, GRPCTransportID rhs) { // Directly comparing pointers works because we require users to use the id provided by each // implementation, not coming up with their own string. return lhs == rhs; } -NSUInteger TransportIdHash(GRPCTransportId transportId) { +NSUInteger TransportIdHash(GRPCTransportID transportId) { if (transportId == NULL) { transportId = gDefaultTransportId; } @@ -66,7 +66,7 @@ NSUInteger TransportIdHash(GRPCTransportId transportId) { return self; } -- (void)registerTransportWithId:(GRPCTransportId)transportId +- (void)registerTransportWithId:(GRPCTransportID)transportId factory:(id)factory { NSString *nsTransportId = [NSString stringWithCString:transportId encoding:NSUTF8StringEncoding]; NSAssert(_registry[nsTransportId] == nil, @"The transport %@ has already been registered.", @@ -83,7 +83,7 @@ NSUInteger TransportIdHash(GRPCTransportId transportId) { } } -- (id)getTransportFactoryWithId:(GRPCTransportId)transportId { +- (id)getTransportFactoryWithId:(GRPCTransportID)transportId { if (transportId == NULL) { if (_defaultFactory == nil) { [NSException raise:NSInvalidArgumentException diff --git a/src/objective-c/GRPCClient/GRPCTypes.h b/src/objective-c/GRPCClient/GRPCTypes.h index c804bca4eaa..8d434851aa6 100644 --- a/src/objective-c/GRPCClient/GRPCTypes.h +++ b/src/objective-c/GRPCClient/GRPCTypes.h @@ -171,7 +171,7 @@ extern NSString* _Nonnull const kGRPCHeadersKey; extern NSString* _Nonnull const kGRPCTrailersKey; /** The id of a transport implementation. */ -typedef char* _Nonnull GRPCTransportId; +typedef char* _Nonnull GRPCTransportID; /** * Implement this protocol to provide a token to gRPC when a call is initiated. diff --git a/src/objective-c/GRPCClient/private/GRPCTransport+Private.h b/src/objective-c/GRPCClient/private/GRPCTransport+Private.h index 2dc7357c363..075d185e5d7 100644 --- a/src/objective-c/GRPCClient/private/GRPCTransport+Private.h +++ b/src/objective-c/GRPCClient/private/GRPCTransport+Private.h @@ -31,13 +31,13 @@ NS_ASSUME_NONNULL_BEGIN * registered with the registry, the default transport factory (core + secure) is returned. If the * default transport does not exist, an exception is thrown. */ -- (id)getTransportFactoryWithId:(GRPCTransportId)transportId; +- (id)getTransportFactoryWithId:(GRPCTransportID)transportId; @end @interface GRPCTransportManager : NSObject -- (instancetype)initWithTransportId:(GRPCTransportId)transportId +- (instancetype)initWithTransportId:(GRPCTransportID)transportId previousInterceptor:(id)previousInterceptor; /** diff --git a/src/objective-c/GRPCClient/private/GRPCTransport+Private.m b/src/objective-c/GRPCClient/private/GRPCTransport+Private.m index 9072f7afbe2..5e9c2b52ab4 100644 --- a/src/objective-c/GRPCClient/private/GRPCTransport+Private.m +++ b/src/objective-c/GRPCClient/private/GRPCTransport+Private.m @@ -21,13 +21,13 @@ #import @implementation GRPCTransportManager { - GRPCTransportId _transportId; + GRPCTransportID _transportId; GRPCTransport *_transport; id _previousInterceptor; dispatch_queue_t _dispatchQueue; } -- (instancetype)initWithTransportId:(GRPCTransportId)transportId +- (instancetype)initWithTransportId:(GRPCTransportID)transportId previousInterceptor:(id)previousInterceptor { if ((self = [super init])) { id factory = diff --git a/src/objective-c/tests/CronetTests/InteropTestsRemoteWithCronet.m b/src/objective-c/tests/CronetTests/InteropTestsRemoteWithCronet.m index aa1af301b96..f4cd9e064d2 100644 --- a/src/objective-c/tests/CronetTests/InteropTestsRemoteWithCronet.m +++ b/src/objective-c/tests/CronetTests/InteropTestsRemoteWithCronet.m @@ -52,7 +52,7 @@ static int32_t kRemoteInteropServerOverhead = 12; return kRemoteSSLHost; } -+ (GRPCTransportId)transport { ++ (GRPCTransportID)transport { return gGRPCCoreCronetId; } diff --git a/src/objective-c/tests/InteropTests/InteropTests.h b/src/objective-c/tests/InteropTests/InteropTests.h index a4adecd5415..4ebce5c961d 100644 --- a/src/objective-c/tests/InteropTests/InteropTests.h +++ b/src/objective-c/tests/InteropTests/InteropTests.h @@ -59,7 +59,7 @@ * The transport to be used. The base implementation returns NULL. Subclasses should override to * appropriate settings. */ -+ (GRPCTransportId)transport; ++ (GRPCTransportID)transport; /** * The root certificates to be used. The base implementation returns nil. Subclasses should override diff --git a/src/objective-c/tests/InteropTests/InteropTests.m b/src/objective-c/tests/InteropTests/InteropTests.m index 21198f7bad9..0c7ef44e0fa 100644 --- a/src/objective-c/tests/InteropTests/InteropTests.m +++ b/src/objective-c/tests/InteropTests/InteropTests.m @@ -404,7 +404,7 @@ static dispatch_once_t initGlobalInterceptorFactory; return GRPCTransportTypeChttp2BoringSSL; } -+ (GRPCTransportId)transport { ++ (GRPCTransportID)transport { return NULL; } diff --git a/src/objective-c/tests/InteropTests/InteropTestsLocalCleartext.m b/src/objective-c/tests/InteropTests/InteropTestsLocalCleartext.m index 2e638099e1e..23f39401230 100644 --- a/src/objective-c/tests/InteropTests/InteropTestsLocalCleartext.m +++ b/src/objective-c/tests/InteropTests/InteropTestsLocalCleartext.m @@ -61,7 +61,7 @@ static int32_t kLocalInteropServerOverhead = 10; [GRPCCall useInsecureConnectionsForHost:kLocalCleartextHost]; } -+ (GRPCTransportId)transport { ++ (GRPCTransportID)transport { return GRPCDefaultTransportImplList.core_insecure; } diff --git a/src/objective-c/tests/InteropTests/InteropTestsLocalSSL.m b/src/objective-c/tests/InteropTests/InteropTestsLocalSSL.m index 30d8f4c34af..9c8ce7fe810 100644 --- a/src/objective-c/tests/InteropTests/InteropTestsLocalSSL.m +++ b/src/objective-c/tests/InteropTests/InteropTestsLocalSSL.m @@ -57,7 +57,7 @@ static int32_t kLocalInteropServerOverhead = 10; return kLocalInteropServerOverhead; // bytes } -+ (GRPCTransportId)transport { ++ (GRPCTransportID)transport { return GRPCDefaultTransportImplList.core_secure; }