chromeos: makes it possible for windows to outlive WindowTreeClient

Desktop / Chromium - sky [chromium.org] - 19 May 2017 15:26 EDT

Because of shutdown ordering we need to make it so aura::Windows can outlive WindowTreeClient. WindowTreeClient is wired in by way of every Window having a WindowPort. For mus the WindowPort is a WindowPortMus, which has a reference to the WindowTreeClient. Rather then having a slew of null checks I went with making ~WindowTreeClient reset the WindowPorts to a no-op WindowPort during shutdown.

BUG=723825 TEST=covered by tests R=erg@chromium.org

Review-Url: https://codereview.chromium.org/2897663002 Cr-Commit-Position: refs/heads/master@{#473274}

2a454eb chromeos: makes it possible for windows to outlive WindowTreeClient
ash/shell_unittest.cc | 7 --
ui/aura/BUILD.gn | 132 ++++++++++++++---------------
ui/aura/env.cc | 17 +++-
ui/aura/env.h | 10 ++-
ui/aura/mus/focus_synchronizer.cc | 2 +
ui/aura/mus/window_tree_client.cc | 21 ++++-
ui/aura/mus/window_tree_client.h | 2 +
ui/aura/mus/window_tree_client_unittest.cc | 14 +++
ui/aura/test/aura_test_base.cc | 5 ++
ui/aura/test/aura_test_base.h | 5 ++
ui/aura/test/aura_test_helper.cc | 7 +-
ui/aura/test/aura_test_helper.h | 5 ++
ui/aura/test/env_test_helper.h | 1 +
ui/aura/window.h | 7 +-
ui/aura/window_port_for_shutdown.cc | 63 ++++++++++++++
ui/aura/window_port_for_shutdown.h | 47 ++++++++++
16 files changed, 262 insertions(+), 83 deletions(-)

Upstream: git.chromium.org


  • Share