commit | 712b2013aa586275c6c3b827979c4fee6da1adce | [log] [tgz] |
---|---|---|
author | Jinsuk Kim <jinsukkim@chromium.org> | Mon Jun 18 17:52:43 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Jun 18 17:52:43 2018 |
tree | 703054d486e1656b1ffed5fd01da563b0e386815 | |
parent | 9e073a82516fb034f311904cd8a07718dcc9cb86 [diff] |
Android: Ensure |OnDetachedFromWindow| is invoked upon destruction https://crrev.com/c/1020942 meant to make sure |DetachedFromWindow| is invoked upon ViewAndroid destruction. This had a bug when WindowAndroid is destroyed first, which can happen for Chromecast where WebContents destruction is delayed by design. WindowAndroid dtor invokes |GetWindowAndroid| indirectly via its base dtor (through RemoveAllChildren), but it didn't work as intended because |GetWindowAndroid| is a virtual function. So it ended up calling |ViewAndroid::GetWindowAndroid|, not |WindowAndroid::GetWindowAndroid|. This CL fixes it by pulling out the task of invoking |OnDetachedFromWindow| so that the destructor won't use the virtual function. WindowAndroid can call |OnDetachedFromWindow| in its dtor since it doesn't need |GetWindowAndroid| - it knows for sure WindowAndroid (itself) is present. Bug: b/78251221 Change-Id: I754e45ca3ea61ceb86101ede3b529e75e206689f Reviewed-on: https://chromium-review.googlesource.com/1102823 Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org> Reviewed-by: Bo <boliu@chromium.org> Cr-Commit-Position: refs/heads/master@{#568064}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .