Chromium Code Reviews
Description[ios] Unregister CRWWebController delegates in -close.
With ARC, the order in which -dealloc is invoker is sometimes changed.
This means that some of CRWWebController delegates may end up calling
methods of CRWWebController between call to -close and -dealloc (until
the autorelease pool is cleared).
Since WebStateImpl calls CRWWebController -close just before releasing
its reference, and CRWWebController becomes unusable once -close has
been called (as -navigationManagerImpl will return nullptr), this does
not introduce an API change of CRWWebController while ensuring that
the delegate registration happens as part of WebStateImpl destruction.
Fixes the crash that caused the revert of http://crrev.com/2846233002/
with the following callstack (truncated):
0 org.chromium.gtest.generic-unit-test 0x000000010169d83a -[CRWWebController setNavigationItemTitle:] + 266
1 org.chromium.gtest.generic-unit-test 0x000000010169b2df -[CRWWebController nativeContent:titleDidChange:] + 47
2 org.chromium.gtest.generic-unit-test 0x0000000101e545c3 -[StaticHtmlViewController observeValueForKeyPath:ofObject:change:context:] + 515
3 com.apple.Foundation 0x000000010e3ee70c NSKeyValueNotifyObserver + 351
4 com.apple.Foundation 0x000000010e3edfa7 NSKeyValueDidChange + 495
5 com.apple.Foundation 0x000000010e3be00e -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] + 118
6 com.apple.WebKit 0x000000010fcb356a WebKit::PageLoadState::commitChanges() + 1538
...
BUG=None
Review-Url: https://codereview.chromium.org/2854943003
Cr-Commit-Position: refs/heads/master@{#469313}
Committed: https://chromium.googlesource.com/chromium/src/+/0197d1982c7b408050b03cd37882ea2209d45986
Patch Set 1 #
Messages
Total messages: 12 (8 generated)
|
|||||||||||||||||||