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

Unified Diff: ios/web/web_state/web_view_internal_creation_util.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
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | ios/web/web_state/wk_web_view_security_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/web_view_internal_creation_util.mm
diff --git a/ios/web/web_state/web_view_internal_creation_util.mm b/ios/web/web_state/web_view_internal_creation_util.mm
index c0f6142edf51097bf6adc2e02f443fd56c7e14b4..5095110ff5225cd65dde288949e61442d8614181 100644
--- a/ios/web/web_state/web_view_internal_creation_util.mm
+++ b/ios/web/web_state/web_view_internal_creation_util.mm
@@ -7,14 +7,11 @@
#import <objc/runtime.h>
#include "base/logging.h"
+#import "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#import "ios/web/public/web_client.h"
#import "ios/web/web_state/ui/crw_context_menu_controller.h"
#import "ios/web/web_state/ui/wk_web_view_configuration_provider.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
namespace web {
@@ -63,17 +60,17 @@
web_view.allowsLinkPreview = NO;
if (context_menu_delegate) {
- CRWContextMenuController* context_menu_controller = [
- [CRWContextMenuController alloc] initWithWebView:web_view
- injectionEvaluator:nil
- delegate:context_menu_delegate];
- void* associated_object_key = (__bridge void*)context_menu_controller;
- objc_setAssociatedObject(web_view, associated_object_key,
- context_menu_controller,
+ base::scoped_nsobject<CRWContextMenuController> context_menu_controller(
+ [[CRWContextMenuController alloc]
+ initWithWebView:web_view
+ injectionEvaluator:nil
+ delegate:context_menu_delegate]);
+ objc_setAssociatedObject(web_view, context_menu_controller.get(),
+ context_menu_controller.get(),
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- return web_view;
+ return [web_view autorelease];
}
WKWebView* BuildWKWebView(CGRect frame,
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | ios/web/web_state/wk_web_view_security_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698