Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Unified Diff: ios/chrome/browser/ui/settings/reauthentication_module.mm

Issue 2813223002: [ObjC ARC] Converts ios/chrome/browser/ui/settings:settings to ARC. (Closed)
Patch Set: reabse Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/settings/reauthentication_module.mm
diff --git a/ios/chrome/browser/ui/settings/reauthentication_module.mm b/ios/chrome/browser/ui/settings/reauthentication_module.mm
index 1c7e35505b7c7dbb5fed818cde2fceb49cdfb7a9..dbffe5ded4ad3122bc41b77426dd3ebaf42914c9 100644
--- a/ios/chrome/browser/ui/settings/reauthentication_module.mm
+++ b/ios/chrome/browser/ui/settings/reauthentication_module.mm
@@ -5,18 +5,20 @@
#import <LocalAuthentication/LocalAuthentication.h>
-#import "base/ios/weak_nsobject.h"
-#import "base/mac/scoped_nsobject.h"
+#import "base/logging.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
@implementation ReauthenticationModule {
// Authentication context on which the authentication policy is evaluated.
- base::scoped_nsobject<LAContext> _context;
+ LAContext* _context;
// Accessor allowing the module to request the update of the time when the
// successful re-authentication was performed and to get the time of the last
// successful re-authentication.
- base::WeakNSProtocol<id<SuccessfulReauthTimeAccessor>>
- _successfulReauthTimeAccessor;
+ __weak id<SuccessfulReauthTimeAccessor> _successfulReauthTimeAccessor;
}
- (instancetype)initWithSuccessfulReauthTimeAccessor:
@@ -24,8 +26,8 @@
DCHECK(successfulReauthTimeAccessor);
self = [super init];
if (self) {
- _context.reset([[LAContext alloc] init]);
- _successfulReauthTimeAccessor.reset(successfulReauthTimeAccessor);
+ _context = [[LAContext alloc] init];
+ _successfulReauthTimeAccessor = successfulReauthTimeAccessor;
}
return self;
}
@@ -43,21 +45,19 @@
return;
}
- _context.reset([[LAContext alloc] init]);
+ _context = [[LAContext alloc] init];
// No fallback option is provided.
- _context.get().localizedFallbackTitle = @"";
+ _context.localizedFallbackTitle = @"";
- base::WeakNSObject<ReauthenticationModule> weakSelf(self);
+ __weak ReauthenticationModule* weakSelf = self;
void (^replyBlock)(BOOL, NSError*) = ^(BOOL success, NSError* error) {
dispatch_async(dispatch_get_main_queue(), ^{
- base::scoped_nsobject<ReauthenticationModule> strongSelf(
- [weakSelf retain]);
+ ReauthenticationModule* strongSelf = weakSelf;
if (!strongSelf)
return;
if (success) {
- [strongSelf.get()
- ->_successfulReauthTimeAccessor updateSuccessfulReauthTime];
+ [strongSelf->_successfulReauthTimeAccessor updateSuccessfulReauthTime];
}
handler(success);
});

Powered by Google App Engine
This is Rietveld 408576698