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

Unified Diff: ios/chrome/browser/ui/collection_view/collection_view_model.mm

Issue 2743643002: [ObjC ARC] Converts ios/chrome/browser/ui/collection_view:collection_view to ARC. (Closed)
Patch Set: cleanup Created 3 years, 9 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/collection_view/collection_view_model.mm
diff --git a/ios/chrome/browser/ui/collection_view/collection_view_model.mm b/ios/chrome/browser/ui/collection_view/collection_view_model.mm
index d57b258c08056e8e94c711869eb37b3b9b3e8834..0866b37bdafde7636ef71ab9c88f608417224f14 100644
--- a/ios/chrome/browser/ui/collection_view/collection_view_model.mm
+++ b/ios/chrome/browser/ui/collection_view/collection_view_model.mm
@@ -5,33 +5,34 @@
#import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
#include "base/logging.h"
-#include "base/mac/scoped_nsobject.h"
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
typedef NSMutableArray<CollectionViewItem*> SectionItems;
}
@implementation CollectionViewModel {
// Ordered list of section identifiers, one per section in the model.
- base::scoped_nsobject<NSMutableArray<NSNumber*>> _sectionIdentifiers;
+ NSMutableArray<NSNumber*>* _sectionIdentifiers;
// The lists of section items, one per section.
- base::scoped_nsobject<NSMutableArray<SectionItems*>> _sections;
+ NSMutableArray<SectionItems*>* _sections;
// Maps from section identifier to header and footer.
- base::scoped_nsobject<NSMutableDictionary<NSNumber*, CollectionViewItem*>>
- _headers;
- base::scoped_nsobject<NSMutableDictionary<NSNumber*, CollectionViewItem*>>
- _footers;
+ NSMutableDictionary<NSNumber*, CollectionViewItem*>* _headers;
+ NSMutableDictionary<NSNumber*, CollectionViewItem*>* _footers;
}
- (instancetype)init {
if ((self = [super init])) {
- _sectionIdentifiers.reset([[NSMutableArray alloc] init]);
- _sections.reset([[NSMutableArray alloc] init]);
- _headers.reset([[NSMutableDictionary alloc] init]);
- _footers.reset([[NSMutableDictionary alloc] init]);
+ _sectionIdentifiers = [[NSMutableArray alloc] init];
+ _sections = [[NSMutableArray alloc] init];
+ _headers = [[NSMutableDictionary alloc] init];
+ _footers = [[NSMutableDictionary alloc] init];
}
return self;
}
@@ -44,7 +45,7 @@ typedef NSMutableArray<CollectionViewItem*> SectionItems;
[self internalSectionForIdentifier:sectionIdentifier]);
[_sectionIdentifiers addObject:@(sectionIdentifier)];
- base::scoped_nsobject<SectionItems> section([[SectionItems alloc] init]);
+ SectionItems* section = [[SectionItems alloc] init];
[_sections addObject:section];
}
@@ -57,7 +58,7 @@ typedef NSMutableArray<CollectionViewItem*> SectionItems;
[_sectionIdentifiers insertObject:@(sectionIdentifier) atIndex:index];
- base::scoped_nsobject<SectionItems> section([[SectionItems alloc] init]);
+ SectionItems* section = [[SectionItems alloc] init];
[_sections insertObject:section atIndex:index];
}

Powered by Google App Engine
This is Rietveld 408576698