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

Unified Diff: ios/chrome/browser/ui/stack_view/stack_card.mm

Issue 2944443003: [ObjC ARC] Converts ios/chrome/browser/ui/stack_view:stack_view to ARC. (Closed)
Patch Set: 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: ios/chrome/browser/ui/stack_view/stack_card.mm
diff --git a/ios/chrome/browser/ui/stack_view/stack_card.mm b/ios/chrome/browser/ui/stack_view/stack_card.mm
index e809fbbb1693db67a211de703fb4751451867242..a53073660b1e009d18cd3dbdd6eb803a83217ca3 100644
--- a/ios/chrome/browser/ui/stack_view/stack_card.mm
+++ b/ios/chrome/browser/ui/stack_view/stack_card.mm
@@ -5,14 +5,17 @@
#import "ios/chrome/browser/ui/stack_view/stack_card.h"
#include "base/logging.h"
-#import "base/mac/scoped_nsobject.h"
#import "ios/chrome/browser/ui/rtl_geometry.h"
#import "ios/chrome/browser/ui/stack_view/card_view.h"
#import "ios/chrome/browser/ui/ui_util.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
@interface StackCard () {
- id<StackCardViewProvider> _viewProvider;
- base::scoped_nsobject<CardView> _view;
+ __weak id<StackCardViewProvider> _viewProvider;
+ CardView* _view;
}
// The pixel-aligned frame generated by applying |self.layout| under the current
@@ -47,18 +50,17 @@
- (void)releaseView {
if (self.viewIsLive)
- _view.reset();
+ _view = nil;
}
#pragma mark - Properties
- (CardView*)view {
if (!_view) {
- _view.reset([[_viewProvider cardViewWithFrame:self.frame forStackCard:self]
- retain]);
- _view.get().isActiveTab = _isActiveTab;
+ _view = [_viewProvider cardViewWithFrame:self.frame forStackCard:self];
+ _view.isActiveTab = _isActiveTab;
}
- return _view.get();
+ return _view;
}
- (void)setLayout:(LayoutRect)layout {
@@ -91,7 +93,7 @@
- (void)setIsActiveTab:(BOOL)isActiveTab {
_isActiveTab = isActiveTab;
- _view.get().isActiveTab = _isActiveTab;
+ _view.isActiveTab = _isActiveTab;
}
- (BOOL)viewIsLive {

Powered by Google App Engine
This is Rietveld 408576698