From 4e72e787a8120681c4c7c96071ff5f2c0fa9f7fd Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Fri, 11 Jul 2014 20:25:20 +0000 Subject: Attempt at cleaning up a bunch of shutdown issues. 1. Defers command buffer destruction until after the native viewport client has had a chance to cleanup. 2. Destroy the compositor before quitting the view manager message loop. 3. Make various NodeObservers properly unhook themselves as node/view observers during destruction and view swapping. 4. Adds a "ViewManagerDisconnected" method to ViewManagerDelegate to allow the application to exit when the connection to the view manager is closed. This is necessary in addition to root monitoring because for some connections (e.g. the root node->window manager) the root node is not destroyed. I'm not entirely happy with imposing this burden on application developers but I will try and tidy this up later. 5. Instantiate nested AtExitManagers only in a static build. In the component build we can use the shell's. 6. Adds a callback to notify the ViewManagerInitServiceImpl when the NativeViewport is destroyed. The VMISI uses this callback to close its connection to the view manager, which triggers the view manager to shut down. Since this still crashes, I can't test this yet. R=sky@chromium.org http://crbug.com/325901 Review URL: https://codereview.chromium.org/372273004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282683 0039d316-1c4b-4281-b951-d872f2087c98 --- mojo/examples/aura_demo/aura_demo.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mojo/examples/aura_demo') diff --git a/mojo/examples/aura_demo/aura_demo.cc b/mojo/examples/aura_demo/aura_demo.cc index 4f88dfb..263493f 100644 --- a/mojo/examples/aura_demo/aura_demo.cc +++ b/mojo/examples/aura_demo/aura_demo.cc @@ -152,6 +152,10 @@ class AuraDemo : public ApplicationDelegate, window_tree_host_->Show(); } + virtual void OnViewManagerDisconnected( + view_manager::ViewManager* view_manager) OVERRIDE { + base::MessageLoop::current()->Quit(); + } // WindowTreeHostMojoDelegate: virtual void CompositorContentsChanged(const SkBitmap& bitmap) OVERRIDE { -- cgit v1.1