Hi
I've been
cleaning up lifecycle observers and fixing lifetime issues around Frame/Window/Document etc. Now I'm going to make the following change to LifecycleObserver:
(before) LifecycleObserver::m_context keeps returning an associated context even after LifecycleObserver::contextDestroyed gets called
(after) LifecycleObserver::m_context returns nullptr after LifecycleObserver::contextDestroyed gets called
For example, this means that ContextLifecycleObserver::getExecutionContext() starts returning nullptr after Document::detach() gets called.
The new behavior is much more correct but has a risk of causing nullptr-deref crashes if your code is assuming that ContextLifecycleObserver::getExecutionContext() never returns nullptr. I've fixed all problematic places detected in layout tests (
CL), but it might not be sufficient. My plan is to fix all remaining places once I receive crash reports.
If you have any concern/questions, let me know. Thanks!
P.S. The ultimate goal of this refactoring is to unify all lifecycle observers about Frame/Document/Window into ContextLifecycleObserver. A tracking bug is
here.
--
Kentaro Hara, Tokyo, Japan