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

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: 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
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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 } 1107 }
1108 1108
1109 - (void)setUIDelegate:(id<CRWWebUserInterfaceDelegate>)UIDelegate { 1109 - (void)setUIDelegate:(id<CRWWebUserInterfaceDelegate>)UIDelegate {
1110 _UIDelegate.reset(UIDelegate); 1110 _UIDelegate.reset(UIDelegate);
1111 } 1111 }
1112 1112
1113 - (void)dealloc { 1113 - (void)dealloc {
1114 DCHECK([NSThread isMainThread]); 1114 DCHECK([NSThread isMainThread]);
1115 DCHECK(_isBeingDestroyed); // 'close' must have been called already. 1115 DCHECK(_isBeingDestroyed); // 'close' must have been called already.
1116 DCHECK(!_webView); 1116 DCHECK(!_webView);
1117 [_containerView setDelegate:nil];
Eugene But (OOO till 7-30) 2016/10/25 18:24:34 Is this change temporary? If so, could you please
1117 _touchTrackingRecognizer.get().touchTrackingDelegate = nil; 1118 _touchTrackingRecognizer.get().touchTrackingDelegate = nil;
1118 [[_webViewProxy scrollViewProxy] removeObserver:self]; 1119 [[_webViewProxy scrollViewProxy] removeObserver:self];
1119 [[NSNotificationCenter defaultCenter] removeObserver:self]; 1120 [[NSNotificationCenter defaultCenter] removeObserver:self];
1120 [super dealloc]; 1121 [super dealloc];
1121 } 1122 }
1122 1123
1123 - (void)dismissKeyboard { 1124 - (void)dismissKeyboard {
1124 [_webView endEditing:YES]; 1125 [_webView endEditing:YES];
1125 if ([self.nativeController respondsToSelector:@selector(dismissKeyboard)]) 1126 if ([self.nativeController respondsToSelector:@selector(dismissKeyboard)])
1126 [self.nativeController dismissKeyboard]; 1127 [self.nativeController dismissKeyboard];
(...skipping 4521 matching lines...) Expand 10 before | Expand all | Expand 10 after
5648 } 5649 }
5649 5650
5650 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; 5651 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
5651 } 5652 }
5652 5653
5653 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { 5654 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action {
5654 return [action.request valueForHTTPHeaderField:@"Referer"]; 5655 return [action.request valueForHTTPHeaderField:@"Referer"];
5655 } 5656 }
5656 5657
5657 @end 5658 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698