From 647e24c190465e9547583a631ac5b33de98ae812 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 23 Oct 2018 11:31:36 -0700 Subject: Put logContext in class extension --- gRPC.podspec | 2 +- src/objective-c/GRPCClient/GRPCCallOptions.h | 10 ------ src/objective-c/GRPCClient/GRPCCallOptions.m | 1 + .../GRPCClient/internal/GRPCCallOptions+internal.h | 37 ++++++++++++++++++++++ .../GRPCClient/private/GRPCChannelPool.m | 1 + src/objective-c/GRPCClient/private/GRPCHost.m | 1 + templates/gRPC.podspec.template | 2 +- 7 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 src/objective-c/GRPCClient/internal/GRPCCallOptions+internal.h diff --git a/gRPC.podspec b/gRPC.podspec index 5e513cb127..47a130d12d 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -58,7 +58,7 @@ Pod::Spec.new do |s| ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}" ss.exclude_files = "#{src_dir}/GRPCCall+GID.{h,m}" - ss.private_header_files = "#{src_dir}/private/*.h" + ss.private_header_files = "#{src_dir}/private/*.h", "#{src_dir}/internal/GRPCCallOptions+Internal.h" ss.dependency 'gRPC-Core', version end diff --git a/src/objective-c/GRPCClient/GRPCCallOptions.h b/src/objective-c/GRPCClient/GRPCCallOptions.h index 27834b2008..4f02b344b1 100644 --- a/src/objective-c/GRPCClient/GRPCCallOptions.h +++ b/src/objective-c/GRPCClient/GRPCCallOptions.h @@ -182,11 +182,6 @@ typedef NS_ENUM(NSInteger, GRPCTransportType) { */ @property(copy, readonly) NSString *hostNameOverride; -/** - * Parameter used for internal logging. - */ -@property(readonly) id logContext; - /** * A string that specify the domain where channel is being cached. Channels with different domains * will not get cached to the same connection. @@ -331,11 +326,6 @@ typedef NS_ENUM(NSInteger, GRPCTransportType) { */ @property(copy, readwrite) NSString *hostNameOverride; -/** - * Parameter used for internal logging. - */ -@property(copy, readwrite) id logContext; - /** * A string that specify the domain where channel is being cached. Channels with different domains * will not get cached to the same channel. For example, a gRPC example app may use the channel pool diff --git a/src/objective-c/GRPCClient/GRPCCallOptions.m b/src/objective-c/GRPCClient/GRPCCallOptions.m index 85a5a9ac89..cd90bc6893 100644 --- a/src/objective-c/GRPCClient/GRPCCallOptions.m +++ b/src/objective-c/GRPCClient/GRPCCallOptions.m @@ -17,6 +17,7 @@ */ #import "GRPCCallOptions.h" +#import "internal/GRPCCallOptions+internal.h" // The default values for the call options. static NSString *const kDefaultServerAuthority = nil; diff --git a/src/objective-c/GRPCClient/internal/GRPCCallOptions+internal.h b/src/objective-c/GRPCClient/internal/GRPCCallOptions+internal.h new file mode 100644 index 0000000000..406f268ef2 --- /dev/null +++ b/src/objective-c/GRPCClient/internal/GRPCCallOptions+internal.h @@ -0,0 +1,37 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +@interface GRPCCallOptions () + +/** + * Parameter used for internal logging. + */ +@property(readonly) id logContext; + +@end + +@interface GRPCMutableCallOptions () + +/** + * Parameter used for internal logging. + */ +@property(readwrite) id logContext; + +@end diff --git a/src/objective-c/GRPCClient/private/GRPCChannelPool.m b/src/objective-c/GRPCClient/private/GRPCChannelPool.m index 1dfae32342..86f7667851 100644 --- a/src/objective-c/GRPCClient/private/GRPCChannelPool.m +++ b/src/objective-c/GRPCClient/private/GRPCChannelPool.m @@ -26,6 +26,7 @@ #import "GRPCInsecureChannelFactory.h" #import "GRPCSecureChannelFactory.h" #import "version.h" +#import "../internal/GRPCCallOptions+internal.h" #import #include diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index 38b31c2ebc..592e8fe776 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -32,6 +32,7 @@ #import "GRPCSecureChannelFactory.h" #import "NSDictionary+GRPC.h" #import "version.h" +#import "../internal/GRPCCallOptions+internal.h" NS_ASSUME_NONNULL_BEGIN diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template index a3190c2d8e..a3ed1d7858 100644 --- a/templates/gRPC.podspec.template +++ b/templates/gRPC.podspec.template @@ -60,7 +60,7 @@ ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}" ss.exclude_files = "#{src_dir}/GRPCCall+GID.{h,m}" - ss.private_header_files = "#{src_dir}/private/*.h" + ss.private_header_files = "#{src_dir}/private/*.h", "#{src_dir}/internal/GRPCCallOptions+Internal.h" ss.dependency 'gRPC-Core', version end -- cgit v1.2.3