| 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];
|
|
|