| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/web/web_state/ui/crw_wk_script_message_router.h" | 5 #import "ios/web/web_state/ui/crw_wk_script_message_router.h" |
| 6 | 6 |
| 7 #import "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "base/mac/scoped_nsobject.h" | 8 #import "base/mac/scoped_nsobject.h" |
| 9 | 9 |
| 10 @interface CRWWKScriptMessageRouter ()<WKScriptMessageHandler> | 10 @interface CRWWKScriptMessageRouter ()<WKScriptMessageHandler> |
| 11 | 11 |
| 12 // Removes a specific message handler. Does nothing if handler does not exist. | 12 // Removes a specific message handler. Does nothing if handler does not exist. |
| 13 - (void)tryRemoveScriptMessageHandlerForName:(NSString*)messageName | 13 - (void)tryRemoveScriptMessageHandlerForName:(NSString*)messageName |
| 14 webView:(WKWebView*)webView; | 14 webView:(WKWebView*)webView; |
| 15 | 15 |
| 16 @end | 16 @end |
| 17 | 17 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 [[handler retain] autorelease]; | 108 [[handler retain] autorelease]; |
| 109 if (webViewToHandlerMap.count == 1) { | 109 if (webViewToHandlerMap.count == 1) { |
| 110 [_handlers removeObjectForKey:messageName]; | 110 [_handlers removeObjectForKey:messageName]; |
| 111 [_userContentController removeScriptMessageHandlerForName:messageName]; | 111 [_userContentController removeScriptMessageHandlerForName:messageName]; |
| 112 } else { | 112 } else { |
| 113 [webViewToHandlerMap removeObjectForKey:webView]; | 113 [webViewToHandlerMap removeObjectForKey:webView]; |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 @end | 117 @end |
| OLD | NEW |