From 9029b53150c00d363bce085e083dc8752c67f7dc Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Tue, 14 Jun 2016 16:16:32 -0400 Subject: [PATCH] Support building with -Wimplicit-atomic-properties. --- Source/GTMOAuth2Authentication.h | 54 ++++++++++++++++---------------- Source/GTMOAuth2Authentication.m | 14 ++++----- Source/GTMOAuth2SignIn.m | 4 +-- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Source/GTMOAuth2Authentication.h b/Source/GTMOAuth2Authentication.h index d971e26..dce8989 100644 --- a/Source/GTMOAuth2Authentication.h +++ b/Source/GTMOAuth2Authentication.h @@ -194,17 +194,17 @@ extern NSString *const kGTMOAuth2NetworkFound; // the library. // Request properties -@property (copy) NSString *clientID; -@property (copy) NSString *clientSecret; -@property (copy) NSString *redirectURI; -@property (retain) NSString *scope; -@property (retain) NSString *tokenType; -@property (retain) NSString *assertion; -@property (retain) NSString *refreshScope; +@property (atomic, copy) NSString *clientID; +@property (atomic, copy) NSString *clientSecret; +@property (atomic, copy) NSString *redirectURI; +@property (atomic, retain) NSString *scope; +@property (atomic, retain) NSString *tokenType; +@property (atomic, retain) NSString *assertion; +@property (atomic, retain) NSString *refreshScope; // Apps may optionally add parameters here to be provided to the token // endpoint on token requests and refreshes. -@property (retain) NSDictionary *additionalTokenRequestParameters; +@property (atomic, retain) NSDictionary *additionalTokenRequestParameters; // Apps may optionally add parameters here to be provided to the token // endpoint on specific token requests and refreshes, keyed by the grant_type. @@ -215,31 +215,31 @@ extern NSString *const kGTMOAuth2NetworkFound; // @"authorization_code" : @{ @"type" : @"code" }, // @"refresh_token" : @{ @"type" : @"refresh" } // }; -@property (retain) NSDictionary *additionalGrantTypeRequestParameters; +@property (atomic, retain) NSDictionary *additionalGrantTypeRequestParameters; // Response properties // Dictionary of response and other properties; not KVO compliant -@property (readonly) NSDictionary *parameters; +@property (atomic, readonly) NSDictionary *parameters; -@property (retain) NSString *accessToken; -@property (retain) NSString *refreshToken; -@property (retain) NSNumber *expiresIn; -@property (retain) NSString *code; -@property (retain) NSString *errorString; +@property (atomic, retain) NSString *accessToken; +@property (atomic, retain) NSString *refreshToken; +@property (atomic, retain) NSNumber *expiresIn; +@property (atomic, retain) NSString *code; +@property (atomic, retain) NSString *errorString; // URL for obtaining access tokens -@property (copy) NSURL *tokenURL; +@property (atomic, copy) NSURL *tokenURL; // Calculated expiration date (expiresIn seconds added to the // time the access token was received.) -@property (copy) NSDate *expirationDate; +@property (atomic, copy) NSDate *expirationDate; // Service identifier, like "Google"; not used for authentication // // The provider name is just for allowing stored authorization to be associated // with the authorizing service. -@property (copy) NSString *serviceProvider; +@property (atomic, copy) NSString *serviceProvider; // User ID; not used for authentication @property (retain) NSString *userID; @@ -249,36 +249,36 @@ extern NSString *const kGTMOAuth2NetworkFound; // The verified string can be checked with -boolValue. If the result is false, // then the email address is listed with the account on the server, but the // address has not been confirmed as belonging to the owner of the account. -@property (retain) NSString *userEmail; -@property (retain) NSString *userEmailIsVerified; +@property (atomic, retain) NSString *userEmail; +@property (atomic, retain) NSString *userEmailIsVerified; // Property indicating if this auth has a refresh or access token so is suitable // for authorizing a request. This does not guarantee that the token is valid. -@property (readonly) BOOL canAuthorize; +@property (atomic, readonly) BOOL canAuthorize; // Property indicating if this object will authorize plain http request // (as well as any non-https requests.) Default is NO, only requests with the // scheme https are authorized, since security may be compromised if tokens // are sent over the wire using an unencrypted protocol like http. -@property (assign) BOOL shouldAuthorizeAllRequests; +@property (atomic, assign) BOOL shouldAuthorizeAllRequests; // userData is retained for the convenience of the caller -@property (retain) id userData; +@property (atomic, retain) id userData; // Stored property values are retained for the convenience of the caller -@property (retain) NSDictionary *properties; +@property (atomic, retain) NSDictionary *properties; // Property for the optional fetcher service instance to be used to create // fetchers // // Fetcher service objects retain authorizations, so this is weak to avoid // circular retains. -@property (assign) id fetcherService; // WEAK +@property (atomic, assign) id fetcherService; // WEAK // Key for the response parameter used for the authorization header; by default, // "access_token" is used, but some servers may expect alternatives, like // "id_token". -@property (copy) NSString *authorizationTokenKey; +@property (atomic, copy) NSString *authorizationTokenKey; // Convenience method for creating an authentication object + (id)authenticationWithServiceProvider:(NSString *)serviceProvider @@ -333,7 +333,7 @@ extern NSString *const kGTMOAuth2NetworkFound; // // Pending fetcher to get a new access token, if any -@property (retain) GTMOAuth2Fetcher *refreshFetcher; +@property (atomic, retain) GTMOAuth2Fetcher *refreshFetcher; // Check if a request is queued up to be authorized - (BOOL)isAuthorizingRequest:(NSURLRequest *)request; diff --git a/Source/GTMOAuth2Authentication.m b/Source/GTMOAuth2Authentication.m index 04ec229..e0c0a6a 100644 --- a/Source/GTMOAuth2Authentication.m +++ b/Source/GTMOAuth2Authentication.m @@ -97,12 +97,12 @@ @interface GTMOAuth2AuthorizationArgs : NSObject { NSError *error_; } -@property (retain) NSMutableURLRequest *request; -@property (retain) id delegate; -@property (assign) SEL selector; -@property (copy) id completionHandler; -@property (retain) NSThread *thread; -@property (retain) NSError *error; +@property (atomic, retain) NSMutableURLRequest *request; +@property (atomic, retain) id delegate; +@property (atomic, assign) SEL selector; +@property (atomic, copy) id completionHandler; +@property (atomic, retain) NSThread *thread; +@property (atomic, retain) NSError *error; + (GTMOAuth2AuthorizationArgs *)argsWithRequest:(NSMutableURLRequest *)req delegate:(id)delegate @@ -149,7 +149,7 @@ - (void)dealloc { @interface GTMOAuth2Authentication () -@property (retain) NSMutableArray *authorizationQueue; +@property (atomic, retain) NSMutableArray *authorizationQueue; @property (readonly) NSString *authorizationToken; - (void)setKeysForResponseJSONData:(NSData *)data; diff --git a/Source/GTMOAuth2SignIn.m b/Source/GTMOAuth2SignIn.m index d695f84..1f8452f 100644 --- a/Source/GTMOAuth2SignIn.m +++ b/Source/GTMOAuth2SignIn.m @@ -29,8 +29,8 @@ @interface GTMOAuth2SignIn () -@property (assign) BOOL hasHandledCallback; -@property (retain) GTMOAuth2Fetcher *pendingFetcher; +@property (atomic, assign) BOOL hasHandledCallback; +@property (atomic, retain) GTMOAuth2Fetcher *pendingFetcher; #if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT @property (nonatomic, retain, readwrite) NSDictionary *userProfile; #endif