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

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

Issue 2432363003: [ObjC ARC] Converts parts of ios/web/webstate to ARC. (Closed)
Patch Set: rebase Created 4 years, 1 month 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/ui/crw_wk_script_message_router.h ('k') | ios/web/web_state/ui/web_view_js_utils.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_wk_script_message_router.mm
diff --git a/ios/web/web_state/ui/crw_wk_script_message_router.mm b/ios/web/web_state/ui/crw_wk_script_message_router.mm
index 0e1dfbb33e0dd333119542563b4cbd246663c9b7..0c041ac21c10eeb9d454f8c2b8a4c2d9cbf99252 100644
--- a/ios/web/web_state/ui/crw_wk_script_message_router.mm
+++ b/ios/web/web_state/ui/crw_wk_script_message_router.mm
@@ -7,6 +7,10 @@
#import "base/logging.h"
#import "base/mac/scoped_nsobject.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
@interface CRWWKScriptMessageRouter ()<WKScriptMessageHandler>
// Removes a specific message handler. Does nothing if handler does not exist.
@@ -40,7 +44,7 @@
DCHECK(userContentController);
if ((self = [super init])) {
_handlers.reset([[NSMutableDictionary alloc] init]);
- _userContentController.reset([userContentController retain]);
+ _userContentController.reset(userContentController);
}
return self;
}
@@ -103,9 +107,6 @@
id handler = [webViewToHandlerMap objectForKey:webView];
if (!handler)
return;
- // Extend the lifetime of |handler| so removeScriptMessageHandlerForName: can
- // be called from inside of |handler|.
- [[handler retain] autorelease];
if (webViewToHandlerMap.count == 1) {
[_handlers removeObjectForKey:messageName];
[_userContentController removeScriptMessageHandlerForName:messageName];
« no previous file with comments | « ios/web/web_state/ui/crw_wk_script_message_router.h ('k') | ios/web/web_state/ui/web_view_js_utils.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698