diff options
author | Jorge Canizales <jcanizales@google.com> | 2015-09-03 05:24:19 -0700 |
---|---|---|
committer | Jorge Canizales <jcanizales@google.com> | 2015-09-03 15:21:57 -0700 |
commit | 78a4c7490e9d991f48c0c0cb95446ee0acf241ce (patch) | |
tree | bcc7b606690f4097051750a6872fd8a530c7d6ae /src | |
parent | 34a742b0e152d272b180c26194a3c2ee0d4ce8e3 (diff) |
Make request headers a @property property.
Diffstat (limited to 'src')
-rw-r--r-- | src/objective-c/GRPCClient/GRPCCall.h | 6 | ||||
-rw-r--r-- | src/objective-c/GRPCClient/GRPCCall.m | 14 |
2 files changed, 2 insertions, 18 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h index 210ea709a3..35f7e16af7 100644 --- a/src/objective-c/GRPCClient/GRPCCall.h +++ b/src/objective-c/GRPCClient/GRPCCall.h @@ -169,10 +169,8 @@ extern id const kGRPCTrailersKey; // // After the call is started, trying to modify this property is an error. // -// For convenience, the property is initialized to an empty NSMutableDictionary, and the setter -// accepts (and copies) both mutable and immutable dictionaries. -- (id<GRPCRequestHeaders>)requestHeaders; // nonatomic -- (void)setRequestHeaders:(NSDictionary *)requestHeaders; // nonatomic, copy +// The property is initialized to an empty NSMutableDictionary. +@property(atomic, readonly) id<GRPCRequestHeaders> requestHeaders; // This dictionary is populated with the HTTP headers received from the server. This happens before // any response message is received from the server. It has the same structure as the request diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 1be753e688..b6986bf59c 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -130,20 +130,6 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; return self; } -#pragma mark Metadata - -- (id<GRPCRequestHeaders>)requestHeaders { - return _requestHeaders; -} - -- (void)setRequestHeaders:(NSDictionary *)requestHeaders { - GRPCRequestHeaders *newHeaders = [[GRPCRequestHeaders alloc] initWithCall:self]; - for (id key in requestHeaders) { - newHeaders[key] = requestHeaders[key]; - } - _requestHeaders = newHeaders; -} - #pragma mark Finish - (void)finishWithError:(NSError *)errorOrNil { |