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

Issue 2854943003: [ios] Unregister CRWWebController delegates in -close. (Closed)

Created:
3 years, 7 months ago by sdefresne
Modified:
3 years, 7 months ago
Reviewers:
stkhapugin, michaeldo
CC:
chromium-reviews, Eugene But (OOO till 7-30), ios-reviews+web_chromium.org, ios-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -8 lines) Patch
M ios/web/web_state/ui/crw_web_controller.mm View 2 chunks +10 lines, -8 lines 0 comments Download

Messages

Total messages: 12 (8 generated)
sdefresne
michaeldo: please take a look. stkhapugin: FYI
3 years, 7 months ago (2017-05-03 12:25:38 UTC) #4
michaeldo
Thank you for the explanation in the CL. lgtm.
3 years, 7 months ago (2017-05-03 16:13:01 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2854943003/1
3 years, 7 months ago (2017-05-04 12:01:54 UTC) #9
commit-bot: I haz the power
3 years, 7 months ago (2017-05-04 12:05:57 UTC) #12
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/0197d1982c7b408050b03cd37882...

Powered by Google App Engine
This is Rietveld 408576698