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

Unified Diff: components/autofill/ios/browser/credit_card_util.mm

Issue 2849533003: [ObjC ARC] Converts components/autofill/ios/browser:browser to ARC. (Closed)
Patch Set: Address comments Created 3 years, 8 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/autofill/ios/browser/credit_card_util.mm
diff --git a/components/autofill/ios/browser/credit_card_util.mm b/components/autofill/ios/browser/credit_card_util.mm
index e62b9e82cd8b82acc3615b658fceacd975165fc9..3eaaf6da2aed6c78bc1884610454b9d70a009e0e 100644
--- a/components/autofill/ios/browser/credit_card_util.mm
+++ b/components/autofill/ios/browser/credit_card_util.mm
@@ -8,6 +8,10 @@
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/credit_card.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace autofill {
NSString* GetCreditCardName(const CreditCard& credit_card,
@@ -21,8 +25,7 @@ NSString* GetCreditCardObfuscatedNumber(const CreditCard& credit_card) {
}
NSDateComponents* GetCreditCardExpirationDate(const CreditCard& credit_card) {
- NSDateComponents* expiration_date =
- [[[NSDateComponents alloc] init] autorelease];
+ NSDateComponents* expiration_date = [[NSDateComponents alloc] init];
expiration_date.year = credit_card.expiration_year();
expiration_date.month = credit_card.expiration_month();
return expiration_date;

Powered by Google App Engine
This is Rietveld 408576698