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

Unified Diff: components/signin/ios/browser/account_consistency_service.mm

Issue 2928383002: [ObjC ARC] Converts components/signin/ios/browser:browser to ARC. (Closed)
Patch Set: Made other delegate explicitly weak. Created 3 years, 6 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: components/signin/ios/browser/account_consistency_service.mm
diff --git a/components/signin/ios/browser/account_consistency_service.mm b/components/signin/ios/browser/account_consistency_service.mm
index 5f15df39e15e2604550f824dfd693f65c3ab9d2e..f1ec5c76734a05c86275387a658888fd284ed277 100644
--- a/components/signin/ios/browser/account_consistency_service.mm
+++ b/components/signin/ios/browser/account_consistency_service.mm
@@ -6,7 +6,6 @@
#import <WebKit/WebKit.h>
-#import "base/ios/weak_nsobject.h"
#include "base/logging.h"
#import "base/mac/foundation_util.h"
#include "base/macros.h"
@@ -24,6 +23,10 @@
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "url/gurl.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// Threshold (in hours) used to control whether the CHROME_CONNECTED cookie
@@ -58,7 +61,7 @@ class AccountConsistencyHandler : public web::WebStatePolicyDecider {
AccountConsistencyService* account_consistency_service_; // Weak.
AccountReconcilor* account_reconcilor_; // Weak.
- base::WeakNSProtocol<id<ManageAccountsDelegate>> delegate_;
+ __weak id<ManageAccountsDelegate> delegate_;
};
}
@@ -390,11 +393,11 @@ WKWebView* AccountConsistencyService::GetWKWebView() {
return nil;
}
if (!web_view_) {
- web_view_.reset([BuildWKWebView() retain]);
- navigation_delegate_.reset([[AccountConsistencyNavigationDelegate alloc]
+ web_view_.reset(BuildWKWebView());
msarda 2017/06/13 13:15:30 I think this will assign an object that is autorel
marq (ping after 24h) 2017/06/15 09:27:33 It should have (had I kept it a scoped object), un
+ navigation_delegate_ = [[AccountConsistencyNavigationDelegate alloc]
initWithCallback:base::Bind(&AccountConsistencyService::
FinishedApplyingCookieRequest,
- base::Unretained(this), true)]);
+ base::Unretained(this), true)];
[web_view_ setNavigationDelegate:navigation_delegate_];
}
return web_view_.get();
@@ -408,7 +411,7 @@ void AccountConsistencyService::ResetWKWebView() {
[web_view_ setNavigationDelegate:nil];
[web_view_ stopLoading];
web_view_.reset();
- navigation_delegate_.reset();
+ navigation_delegate_ = nil;
applying_cookie_requests_ = false;
}

Powered by Google App Engine
This is Rietveld 408576698