Commit 8f3eb56c authored by stkhapugin's avatar stkhapugin Committed by Commit bot

Zero-out crw_web_controller's container view delegate in dealloc.

Exposes delegate setter on CRWWebControllerContainerView and sets
it to zero in CRWWebController dealloc.

BUG=None
TEST=None

Review-Url: https://codereview.chromium.org/2453473002
Cr-Commit-Position: refs/heads/master@{#430253}
parent afd7f33c
......@@ -1135,6 +1135,8 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
DCHECK([NSThread isMainThread]);
DCHECK(_isBeingDestroyed); // 'close' must have been called already.
DCHECK(!_webView);
// TODO(crbug.com/662860): Don't set the delegate to nil.
[_containerView setDelegate:nil];
_touchTrackingRecognizer.get().touchTrackingDelegate = nil;
[[_webViewProxy scrollViewProxy] removeObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self];
......
......@@ -39,6 +39,8 @@
@property(nonatomic, retain, readonly) id<CRWNativeContent> nativeController;
// The currently displayed transient content view.
@property(nonatomic, retain, readonly) CRWContentView* transientContentView;
@property(nonatomic, assign) id<CRWWebControllerContainerViewDelegate>
delegate; // weak
// Designated initializer. |proxy|'s content view will be updated as different
// content is added to the container.
......
......@@ -212,6 +212,14 @@
UIEdgeInsetsMake(headerHeight, 0, 0, 0));
}
- (id<CRWWebControllerContainerViewDelegate>)delegate {
return _delegate.get();
}
- (void)setDelegate:(id<CRWWebControllerContainerViewDelegate>)delegate {
_delegate.reset(delegate);
}
#pragma mark Layout
- (void)layoutSubviews {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment