| 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);
|
| });
|
|
|