[iOS] Consolidate SceneController observation ownership.
This is a speculative bug fix; I wasn't able to repro the issue on trunk. It's a shutdown crash where the SceneController web state list observer method is triggered by TabModel closing all open tabs, while the interface provider isn't in a consistent state. In general, having BrowserViewWrangler be responsible for setting an observer on the web state lists in the browsers it creates seems problematic, since it doesn't know the purpose of the observation being set. Since SceneController is the one who cares about this observation, it (with this CL) becomes responsible for adding/removing itself as an observer. The specific fix for this bug is for SceneController (which observes the web state list so it can handle the last tab closing) to stop observing before shutting down BrowserViewWrangler. I wasn't able to repro the crash, so I couldn't verify the fix, but I could verify that with this fix in place, a force-quit in the simulator didn't cause any crashes. I also updated the comments for BrowserInterfaceProvider to not say some things that aren't true anymore. Bug: 1062241 Change-Id: I0d4b69f5889e141a243754c61450f77ea39ac523 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128068Reviewed-by:Stepan Khapugin <stkhapugin@chromium.org> Commit-Queue: Mark Cogan <marq@chromium.org> Cr-Commit-Position: refs/heads/master@{#754899}
Showing
Please register or sign in to comment