Skip to content

Commit 41db80f

Browse files
authored
Merge pull request #327 from dropbox/thread-safety-rebase
Point to latest stone main
2 parents f03fe37 + 6d0a29d commit 41db80f

File tree

16 files changed

+7857
-7251
lines changed

16 files changed

+7857
-7251
lines changed

.jazzy.json

Lines changed: 3882 additions & 3882 deletions
Large diffs are not rendered by default.

Source/ObjectiveDropboxOfficial/Platform/ObjectiveDropboxOfficial_iOS/DBClientsManager+MobileAuth-iOS.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
2828
/// This starts a "token" flow.
2929
///
3030
/// This method should no longer be used.
31-
/// Long-lived access tokens are deprecated. See https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens.
31+
/// Long-lived access tokens are deprecated. See
32+
/// https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens.
3233
/// Please use `authorizeFromControllerV2` instead.
3334
///
3435
/// @param sharedApplication The `UIApplication` with which to render the OAuth flow.
@@ -39,7 +40,9 @@ NS_ASSUME_NONNULL_BEGIN
3940
///
4041
+ (void)authorizeFromController:(UIApplication *)sharedApplication
4142
controller:(nullable UIViewController *)controller
42-
openURL:(void (^_Nonnull)(NSURL *))openURL __deprecated_msg("This method was used for long-lived access tokens, which are now deprecated. Please use `authorizeFromControllerV2` instead.");
43+
openURL:(void (^_Nonnull)(NSURL *))openURL
44+
__deprecated_msg("This method was used for long-lived access tokens, which are now deprecated. Please use "
45+
"`authorizeFromControllerV2` instead.");
4346

4447
///
4548
/// Commences OAuth mobile flow from supplied view controller.

Source/ObjectiveDropboxOfficial/Platform/ObjectiveDropboxOfficial_macOS/DBClientsManager+DesktopAuth-macOS.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
2828
/// Commences OAuth desktop flow from supplied view controller.
2929
///
3030
/// This method should no longer be used.
31-
/// Long-lived access tokens are deprecated. See https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens.
31+
/// Long-lived access tokens are deprecated. See
32+
/// https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens.
3233
/// Please use `authorizeFromControllerDesktopV2` instead.
3334
///
3435
/// @param sharedApplication The `NSWorkspace` with which to render the OAuth flow.
@@ -38,7 +39,9 @@ NS_ASSUME_NONNULL_BEGIN
3839
///
3940
+ (void)authorizeFromControllerDesktop:(NSWorkspace *)sharedApplication
4041
controller:(nullable NSViewController *)controller
41-
openURL:(void (^_Nonnull)(NSURL *))openURL __deprecated_msg("This method was used for long-lived access tokens, which are now deprecated. Please use `authorizeFromControllerDesktopV2` instead.");
42+
openURL:(void (^_Nonnull)(NSURL *))openURL
43+
__deprecated_msg("This method was used for long-lived access tokens, which are now deprecated. Please use "
44+
"`authorizeFromControllerDesktopV2` instead.");
4245

4346
///
4447
/// Commences OAuth mobile flow from supplied view controller.

Source/ObjectiveDropboxOfficial/Shared/Generated/Routes/RouteObjects/DBACCOUNTRouteObjects.m

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,32 @@ @implementation DBACCOUNTRouteObjects
1515

1616
static DBRoute *DBACCOUNTSetProfilePhoto;
1717

18+
static NSObject *lockObj = nil;
19+
+ (void)initialize {
20+
static dispatch_once_t onceToken;
21+
dispatch_once(&onceToken, ^{
22+
lockObj = [[NSObject alloc] init];
23+
});
24+
}
25+
1826
+ (DBRoute *)DBACCOUNTSetProfilePhoto {
19-
if (!DBACCOUNTSetProfilePhoto) {
20-
DBACCOUNTSetProfilePhoto = [[DBRoute alloc] init:@"set_profile_photo"
21-
namespace_:@"account"
22-
deprecated:@NO
23-
resultType:[DBACCOUNTSetProfilePhotoResult class]
24-
errorType:[DBACCOUNTSetProfilePhotoError class]
25-
attrs:@{
26-
@"auth" : @"user",
27-
@"host" : @"api",
28-
@"style" : @"rpc"
29-
}
30-
dataStructSerialBlock:nil
31-
dataStructDeserialBlock:nil];
27+
@synchronized(lockObj) {
28+
if (!DBACCOUNTSetProfilePhoto) {
29+
DBACCOUNTSetProfilePhoto = [[DBRoute alloc] init:@"set_profile_photo"
30+
namespace_:@"account"
31+
deprecated:@NO
32+
resultType:[DBACCOUNTSetProfilePhotoResult class]
33+
errorType:[DBACCOUNTSetProfilePhotoError class]
34+
attrs:@{
35+
@"auth" : @"user",
36+
@"host" : @"api",
37+
@"style" : @"rpc"
38+
}
39+
dataStructSerialBlock:nil
40+
dataStructDeserialBlock:nil];
41+
}
42+
return DBACCOUNTSetProfilePhoto;
3243
}
33-
return DBACCOUNTSetProfilePhoto;
3444
}
3545

3646
@end

Source/ObjectiveDropboxOfficial/Shared/Generated/Routes/RouteObjects/DBAUTHRouteObjects.m

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,52 @@ @implementation DBAUTHRouteObjects
1717
static DBRoute *DBAUTHTokenFromOauth1;
1818
static DBRoute *DBAUTHTokenRevoke;
1919

20+
static NSObject *lockObj = nil;
21+
+ (void)initialize {
22+
static dispatch_once_t onceToken;
23+
dispatch_once(&onceToken, ^{
24+
lockObj = [[NSObject alloc] init];
25+
});
26+
}
27+
2028
+ (DBRoute *)DBAUTHTokenFromOauth1 {
21-
if (!DBAUTHTokenFromOauth1) {
22-
DBAUTHTokenFromOauth1 = [[DBRoute alloc] init:@"token/from_oauth1"
23-
namespace_:@"auth"
24-
deprecated:@NO
25-
resultType:[DBAUTHTokenFromOAuth1Result class]
26-
errorType:[DBAUTHTokenFromOAuth1Error class]
27-
attrs:@{
28-
@"auth" : @"app",
29-
@"host" : @"api",
30-
@"style" : @"rpc"
31-
}
32-
dataStructSerialBlock:nil
33-
dataStructDeserialBlock:nil];
29+
@synchronized(lockObj) {
30+
if (!DBAUTHTokenFromOauth1) {
31+
DBAUTHTokenFromOauth1 = [[DBRoute alloc] init:@"token/from_oauth1"
32+
namespace_:@"auth"
33+
deprecated:@NO
34+
resultType:[DBAUTHTokenFromOAuth1Result class]
35+
errorType:[DBAUTHTokenFromOAuth1Error class]
36+
attrs:@{
37+
@"auth" : @"app",
38+
@"host" : @"api",
39+
@"style" : @"rpc"
40+
}
41+
dataStructSerialBlock:nil
42+
dataStructDeserialBlock:nil];
43+
}
44+
return DBAUTHTokenFromOauth1;
3445
}
35-
return DBAUTHTokenFromOauth1;
3646
}
3747

3848
+ (DBRoute *)DBAUTHTokenRevoke {
39-
if (!DBAUTHTokenRevoke) {
40-
DBAUTHTokenRevoke = [[DBRoute alloc] init:@"token/revoke"
41-
namespace_:@"auth"
42-
deprecated:@NO
43-
resultType:nil
44-
errorType:nil
45-
attrs:@{
46-
@"auth" : @"user",
47-
@"host" : @"api",
48-
@"style" : @"rpc"
49-
}
50-
dataStructSerialBlock:nil
51-
dataStructDeserialBlock:nil];
49+
@synchronized(lockObj) {
50+
if (!DBAUTHTokenRevoke) {
51+
DBAUTHTokenRevoke = [[DBRoute alloc] init:@"token/revoke"
52+
namespace_:@"auth"
53+
deprecated:@NO
54+
resultType:nil
55+
errorType:nil
56+
attrs:@{
57+
@"auth" : @"user",
58+
@"host" : @"api",
59+
@"style" : @"rpc"
60+
}
61+
dataStructSerialBlock:nil
62+
dataStructDeserialBlock:nil];
63+
}
64+
return DBAUTHTokenRevoke;
5265
}
53-
return DBAUTHTokenRevoke;
5466
}
5567

5668
@end

Source/ObjectiveDropboxOfficial/Shared/Generated/Routes/RouteObjects/DBCHECKRouteObjects.m

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,52 @@ @implementation DBCHECKRouteObjects
1616
static DBRoute *DBCHECKApp;
1717
static DBRoute *DBCHECKUser;
1818

19+
static NSObject *lockObj = nil;
20+
+ (void)initialize {
21+
static dispatch_once_t onceToken;
22+
dispatch_once(&onceToken, ^{
23+
lockObj = [[NSObject alloc] init];
24+
});
25+
}
26+
1927
+ (DBRoute *)DBCHECKApp {
20-
if (!DBCHECKApp) {
21-
DBCHECKApp = [[DBRoute alloc] init:@"app"
22-
namespace_:@"check"
23-
deprecated:@NO
24-
resultType:[DBCHECKEchoResult class]
25-
errorType:nil
26-
attrs:@{
27-
@"auth" : @"app",
28-
@"host" : @"api",
29-
@"style" : @"rpc"
30-
}
31-
dataStructSerialBlock:nil
32-
dataStructDeserialBlock:nil];
28+
@synchronized(lockObj) {
29+
if (!DBCHECKApp) {
30+
DBCHECKApp = [[DBRoute alloc] init:@"app"
31+
namespace_:@"check"
32+
deprecated:@NO
33+
resultType:[DBCHECKEchoResult class]
34+
errorType:nil
35+
attrs:@{
36+
@"auth" : @"app",
37+
@"host" : @"api",
38+
@"style" : @"rpc"
39+
}
40+
dataStructSerialBlock:nil
41+
dataStructDeserialBlock:nil];
42+
}
43+
return DBCHECKApp;
3344
}
34-
return DBCHECKApp;
3545
}
3646

3747
+ (DBRoute *)DBCHECKUser {
38-
if (!DBCHECKUser) {
39-
DBCHECKUser = [[DBRoute alloc] init:@"user"
40-
namespace_:@"check"
41-
deprecated:@NO
42-
resultType:[DBCHECKEchoResult class]
43-
errorType:nil
44-
attrs:@{
45-
@"auth" : @"user",
46-
@"host" : @"api",
47-
@"style" : @"rpc"
48-
}
49-
dataStructSerialBlock:nil
50-
dataStructDeserialBlock:nil];
48+
@synchronized(lockObj) {
49+
if (!DBCHECKUser) {
50+
DBCHECKUser = [[DBRoute alloc] init:@"user"
51+
namespace_:@"check"
52+
deprecated:@NO
53+
resultType:[DBCHECKEchoResult class]
54+
errorType:nil
55+
attrs:@{
56+
@"auth" : @"user",
57+
@"host" : @"api",
58+
@"style" : @"rpc"
59+
}
60+
dataStructSerialBlock:nil
61+
dataStructDeserialBlock:nil];
62+
}
63+
return DBCHECKUser;
5164
}
52-
return DBCHECKUser;
5365
}
5466

5567
@end

Source/ObjectiveDropboxOfficial/Shared/Generated/Routes/RouteObjects/DBCONTACTSRouteObjects.m

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,52 @@ @implementation DBCONTACTSRouteObjects
1515
static DBRoute *DBCONTACTSDeleteManualContacts;
1616
static DBRoute *DBCONTACTSDeleteManualContactsBatch;
1717

18+
static NSObject *lockObj = nil;
19+
+ (void)initialize {
20+
static dispatch_once_t onceToken;
21+
dispatch_once(&onceToken, ^{
22+
lockObj = [[NSObject alloc] init];
23+
});
24+
}
25+
1826
+ (DBRoute *)DBCONTACTSDeleteManualContacts {
19-
if (!DBCONTACTSDeleteManualContacts) {
20-
DBCONTACTSDeleteManualContacts = [[DBRoute alloc] init:@"delete_manual_contacts"
21-
namespace_:@"contacts"
22-
deprecated:@NO
23-
resultType:nil
24-
errorType:nil
25-
attrs:@{
26-
@"auth" : @"user",
27-
@"host" : @"api",
28-
@"style" : @"rpc"
29-
}
30-
dataStructSerialBlock:nil
31-
dataStructDeserialBlock:nil];
27+
@synchronized(lockObj) {
28+
if (!DBCONTACTSDeleteManualContacts) {
29+
DBCONTACTSDeleteManualContacts = [[DBRoute alloc] init:@"delete_manual_contacts"
30+
namespace_:@"contacts"
31+
deprecated:@NO
32+
resultType:nil
33+
errorType:nil
34+
attrs:@{
35+
@"auth" : @"user",
36+
@"host" : @"api",
37+
@"style" : @"rpc"
38+
}
39+
dataStructSerialBlock:nil
40+
dataStructDeserialBlock:nil];
41+
}
42+
return DBCONTACTSDeleteManualContacts;
3243
}
33-
return DBCONTACTSDeleteManualContacts;
3444
}
3545

3646
+ (DBRoute *)DBCONTACTSDeleteManualContactsBatch {
37-
if (!DBCONTACTSDeleteManualContactsBatch) {
38-
DBCONTACTSDeleteManualContactsBatch = [[DBRoute alloc] init:@"delete_manual_contacts_batch"
39-
namespace_:@"contacts"
40-
deprecated:@NO
41-
resultType:nil
42-
errorType:[DBCONTACTSDeleteManualContactsError class]
43-
attrs:@{
44-
@"auth" : @"user",
45-
@"host" : @"api",
46-
@"style" : @"rpc"
47-
}
48-
dataStructSerialBlock:nil
49-
dataStructDeserialBlock:nil];
47+
@synchronized(lockObj) {
48+
if (!DBCONTACTSDeleteManualContactsBatch) {
49+
DBCONTACTSDeleteManualContactsBatch = [[DBRoute alloc] init:@"delete_manual_contacts_batch"
50+
namespace_:@"contacts"
51+
deprecated:@NO
52+
resultType:nil
53+
errorType:[DBCONTACTSDeleteManualContactsError class]
54+
attrs:@{
55+
@"auth" : @"user",
56+
@"host" : @"api",
57+
@"style" : @"rpc"
58+
}
59+
dataStructSerialBlock:nil
60+
dataStructDeserialBlock:nil];
61+
}
62+
return DBCONTACTSDeleteManualContactsBatch;
5063
}
51-
return DBCONTACTSDeleteManualContactsBatch;
5264
}
5365

5466
@end

0 commit comments

Comments
 (0)