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

Unified Diff: ios/web_view/internal/criwv.mm

Issue 2692603002: Convert //ios/web_view/internal to ARC. (Closed)
Patch Set: Respond to comments. Created 3 years, 10 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_view/internal/criwv.mm
diff --git a/ios/web_view/internal/criwv.mm b/ios/web_view/internal/criwv.mm
index 7906852d5016a6a813b9df4c6b81b83d1718d86b..bef570e1c4248bfa3ec954adaaf28e827a2dc37d 100644
--- a/ios/web_view/internal/criwv.mm
+++ b/ios/web_view/internal/criwv.mm
@@ -17,27 +17,33 @@
#import "ios/web_view/public/criwv_web_view_configuration.h"
#import "ios/web_view/public/criwv_website_data_store.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
CRIWV* g_criwv = nil;
}
@interface CRIWV () {
- id<CRIWVDelegate> _delegate;
std::unique_ptr<ios_web_view::CRIWVWebMainDelegate> _webMainDelegate;
std::unique_ptr<web::WebMain> _webMain;
}
+@property(nonatomic, weak) id<CRIWVDelegate> delegate;
+
- (instancetype)initWithDelegate:(id<CRIWVDelegate>)delegate;
@end
@implementation CRIWV
+@synthesize delegate = _delegate;
+
+ (void)configureWithDelegate:(id<CRIWVDelegate>)delegate {
g_criwv = [[CRIWV alloc] initWithDelegate:delegate];
}
+ (void)shutDown {
- [g_criwv release];
g_criwv = nil;
}
@@ -46,8 +52,7 @@ CRIWV* g_criwv = nil;
[[CRIWVWebViewConfiguration alloc] init];
configuration.websiteDataStore = [CRIWVWebsiteDataStore defaultDataStore];
- return [[[CRIWVWebView alloc] initWithFrame:frame configuration:configuration]
- autorelease];
+ return [[CRIWVWebView alloc] initWithFrame:frame configuration:configuration];
}
- (instancetype)initWithDelegate:(id<CRIWVDelegate>)delegate {
@@ -64,7 +69,6 @@ CRIWV* g_criwv = nil;
- (void)dealloc {
_webMain.reset();
_webMainDelegate.reset();
- [super dealloc];
}
@end

Powered by Google App Engine
This is Rietveld 408576698