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

Unified Diff: ios/web/web_state/ui/crw_web_view_content_view.mm

Issue 2948673002: Revert of [ObjC ARC] Converts ios/web:web 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/web/web_state/ui/crw_web_view_content_view.mm
diff --git a/ios/web/web_state/ui/crw_web_view_content_view.mm b/ios/web/web_state/ui/crw_web_view_content_view.mm
index 32aac34b93d43ffdccacce03efb885486ff80b34..cda73439b3d0f42c8103772e1e7ee1dfc7b1d2df 100644
--- a/ios/web/web_state/ui/crw_web_view_content_view.mm
+++ b/ios/web/web_state/ui/crw_web_view_content_view.mm
@@ -7,10 +7,7 @@
#import <WebKit/WebKit.h>
#include "base/logging.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
+#import "base/mac/scoped_nsobject.h"
namespace {
@@ -24,6 +21,10 @@
} // namespace
@interface CRWWebViewContentView () {
+ // The web view being shown.
+ base::scoped_nsobject<UIView> _webView;
+ // The web view's scroll view.
+ base::scoped_nsobject<UIScrollView> _scrollView;
// Backs up property of the same name if |_webView| is a WKWebView.
CGFloat _topContentPadding;
}
@@ -32,17 +33,11 @@
// |_topContentPadding| (iff |_webView| is a WKWebView).
- (void)updateWebViewFrame;
-// The web view being shown.
-@property(nonatomic, strong, readwrite) UIView* webView;
-// The web view's scroll view.
-@property(nonatomic, strong, readwrite) UIScrollView* scrollView;
@end
@implementation CRWWebViewContentView
@synthesize shouldUseInsetForTopPadding = _shouldUseInsetForTopPadding;
-@synthesize webView = _webView;
-@synthesize scrollView = _scrollView;
- (instancetype)initWithWebView:(UIView*)webView
scrollView:(UIScrollView*)scrollView {
@@ -51,8 +46,8 @@
DCHECK(webView);
DCHECK(scrollView);
DCHECK([scrollView isDescendantOfView:webView]);
- _webView = webView;
- _scrollView = scrollView;
+ _webView.reset([webView retain]);
+ _scrollView.reset([scrollView retain]);
}
return self;
}
@@ -100,6 +95,16 @@
return;
[super setBounds:bounds];
[self updateWebViewFrame];
+}
+
+#pragma mark Accessors
+
+- (UIScrollView*)scrollView {
+ return _scrollView.get();
+}
+
+- (UIView*)webView {
+ return _webView.get();
}
#pragma mark Layout
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller_container_view.mm ('k') | ios/web/web_state/ui/crw_wk_script_message_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698