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

Unified Diff: ios/chrome/browser/ui/history/history_entry_item.mm

Issue 2610923005: Replace ObjCPropertyReleaser with ReleaseProperties() project-wide. (Closed)
Patch Set: weak -> assign Created 3 years, 11 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/history/history_entry_item.mm
diff --git a/ios/chrome/browser/ui/history/history_entry_item.mm b/ios/chrome/browser/ui/history/history_entry_item.mm
index 92a69519df1b727303a9fe8e23f19fc3a9a5e822..18f710345394b3d809e7dd6eadfb1b974a4a21a7 100644
--- a/ios/chrome/browser/ui/history/history_entry_item.mm
+++ b/ios/chrome/browser/ui/history/history_entry_item.mm
@@ -7,7 +7,7 @@
#include "base/i18n/time_formatting.h"
#include "base/ios/weak_nsobject.h"
#import "base/mac/foundation_util.h"
-#import "base/mac/objc_property_releaser.h"
+#include "base/mac/objc_release_properties.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "components/history/core/browser/url_row.h"
@@ -59,8 +59,6 @@ NSString* FormattedTitle(const base::string16& title, const GURL& url) {
#pragma mark - HistoryEntryItem
@interface HistoryEntryItem ()<FaviconViewProviderDelegate> {
- // Property releaser for HistoryEntryItem.
- base::mac::ObjCPropertyReleaser _propertyReleaser_HistoryEntryItem;
// Delegate for HistoryEntryItem.
base::WeakNSProtocol<id<HistoryEntryItemDelegate>> _delegate;
}
@@ -96,7 +94,6 @@ NSString* FormattedTitle(const base::string16& title, const GURL& url) {
delegate:(id<HistoryEntryItemDelegate>)delegate {
self = [super initWithType:type];
if (self) {
- _propertyReleaser_HistoryEntryItem.Init(self, [HistoryEntryItem class]);
self.cellClass = [HistoryEntryCell class];
favicon::LargeIconService* largeIconService =
IOSChromeLargeIconServiceFactory::GetForBrowserState(browserState);
@@ -117,6 +114,11 @@ NSString* FormattedTitle(const base::string16& title, const GURL& url) {
return self;
}
+- (void)dealloc {
+ base::mac::ReleaseProperties(self);
+ [super dealloc];
+}
+
- (instancetype)initWithType:(NSInteger)type {
NOTREACHED();
return nil;
@@ -220,17 +222,6 @@ NSString* FormattedTitle(const base::string16& title, const GURL& url) {
#pragma mark - HistoryEntryCell
-@interface HistoryEntryCell () {
- // Property releaser for HistoryEntryCell.
- base::mac::ObjCPropertyReleaser _propertyReleaser_HistoryEntryCell;
-}
-
-// Redeclare as readwrite to allow property releaser to handle these properties.
-@property(nonatomic, readwrite, retain) UILabel* textLabel;
-@property(nonatomic, readwrite, retain) UILabel* detailTextLabel;
-@property(nonatomic, readwrite, retain) UILabel* timeLabel;
Sidney San Martín 2017/01/05 03:24:05 This pattern of redeclaring properties as readwrit
noyau (Ping after 24h) 2017/01/05 10:02:52 At some point the property releaser had a bug (inh
-@end
-
@implementation HistoryEntryCell
@synthesize faviconViewContainer = _faviconViewContainer;
@@ -241,8 +232,6 @@ NSString* FormattedTitle(const base::string16& title, const GURL& url) {
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
- _propertyReleaser_HistoryEntryCell.Init(self, [HistoryEntryCell class]);
-
_faviconViewContainer = [[UIView alloc] initWithFrame:CGRectZero];
_textLabel = [[UILabel alloc] initWithFrame:CGRectZero];
@@ -302,6 +291,11 @@ NSString* FormattedTitle(const base::string16& title, const GURL& url) {
return self;
}
+- (void)dealloc {
+ base::mac::ReleaseProperties(self);
+ [super dealloc];
+}
+
- (void)prepareForReuse {
[super prepareForReuse];
_textLabel.text = nil;

Powered by Google App Engine
This is Rietveld 408576698