Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: mojo/services/view_manager/window_tree_host_impl.cc

Issue 372273004: Shutdown cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/services/view_manager/window_tree_host_impl.cc
diff --git a/mojo/services/view_manager/window_tree_host_impl.cc b/mojo/services/view_manager/window_tree_host_impl.cc
index 5ef5da4af19576bdc6fdf8a7b56e7576f3141de8..f7c15535e0dce4777db2e3f16146e46097a2965a 100644
--- a/mojo/services/view_manager/window_tree_host_impl.cc
+++ b/mojo/services/view_manager/window_tree_host_impl.cc
@@ -68,9 +68,11 @@ void RootLayoutManager::SetChildBounds(aura::Window* child,
WindowTreeHostImpl::WindowTreeHostImpl(
NativeViewportPtr viewport,
const gfx::Rect& bounds,
- const base::Callback<void()>& compositor_created_callback)
+ const Callback<void()>& compositor_created_callback,
+ const Callback<void()>& native_viewport_closed_callback)
: native_viewport_(viewport.Pass()),
compositor_created_callback_(compositor_created_callback),
+ native_viewport_closed_callback_(native_viewport_closed_callback),
bounds_(bounds) {
native_viewport_.set_client(this);
native_viewport_->Create(Rect::From(bounds));
@@ -178,8 +180,11 @@ void WindowTreeHostImpl::OnBoundsChanged(RectPtr bounds) {
OnHostResized(bounds_.size());
}
-void WindowTreeHostImpl::OnDestroyed() {
- base::MessageLoop::current()->Quit();
+void WindowTreeHostImpl::OnDestroyed(const mojo::Callback<void()>& callback) {
+ DestroyCompositor();
+ native_viewport_closed_callback_.Run();
+ //base::MessageLoop::current()->Quit();
sky 2014/07/10 22:54:29 remove commented out code.
+ callback.Run();
}
void WindowTreeHostImpl::OnEvent(EventPtr event,

Powered by Google App Engine
This is Rietveld 408576698