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

Side by Side Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2453473002: Zero-out crw_web_controller's container view delegate in dealloc. (Closed)
Patch Set: Comments 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 unified diff | Download patch
« no previous file with comments | « no previous file | ios/web/web_state/ui/crw_web_controller_container_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_web_controller.h" 5 #import "ios/web/web_state/ui/crw_web_controller.h"
6 6
7 #import <WebKit/WebKit.h> 7 #import <WebKit/WebKit.h>
8 8
9 #import <objc/runtime.h> 9 #import <objc/runtime.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 } 1128 }
1129 1129
1130 - (void)setUIDelegate:(id<CRWWebUserInterfaceDelegate>)UIDelegate { 1130 - (void)setUIDelegate:(id<CRWWebUserInterfaceDelegate>)UIDelegate {
1131 _UIDelegate.reset(UIDelegate); 1131 _UIDelegate.reset(UIDelegate);
1132 } 1132 }
1133 1133
1134 - (void)dealloc { 1134 - (void)dealloc {
1135 DCHECK([NSThread isMainThread]); 1135 DCHECK([NSThread isMainThread]);
1136 DCHECK(_isBeingDestroyed); // 'close' must have been called already. 1136 DCHECK(_isBeingDestroyed); // 'close' must have been called already.
1137 DCHECK(!_webView); 1137 DCHECK(!_webView);
1138 // TODO(crbug.com/662860): Don't set the delegate to nil.
1139 [_containerView setDelegate:nil];
1138 _touchTrackingRecognizer.get().touchTrackingDelegate = nil; 1140 _touchTrackingRecognizer.get().touchTrackingDelegate = nil;
1139 [[_webViewProxy scrollViewProxy] removeObserver:self]; 1141 [[_webViewProxy scrollViewProxy] removeObserver:self];
1140 [[NSNotificationCenter defaultCenter] removeObserver:self]; 1142 [[NSNotificationCenter defaultCenter] removeObserver:self];
1141 [super dealloc]; 1143 [super dealloc];
1142 } 1144 }
1143 1145
1144 - (void)dismissKeyboard { 1146 - (void)dismissKeyboard {
1145 [_webView endEditing:YES]; 1147 [_webView endEditing:YES];
1146 if ([self.nativeController respondsToSelector:@selector(dismissKeyboard)]) 1148 if ([self.nativeController respondsToSelector:@selector(dismissKeyboard)])
1147 [self.nativeController dismissKeyboard]; 1149 [self.nativeController dismissKeyboard];
(...skipping 4589 matching lines...) Expand 10 before | Expand all | Expand 10 after
5737 } 5739 }
5738 5740
5739 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; 5741 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
5740 } 5742 }
5741 5743
5742 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { 5744 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action {
5743 return [action.request valueForHTTPHeaderField:@"Referer"]; 5745 return [action.request valueForHTTPHeaderField:@"Referer"];
5744 } 5746 }
5745 5747
5746 @end 5748 @end
OLDNEW
« no previous file with comments | « no previous file | ios/web/web_state/ui/crw_web_controller_container_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698