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

Unified Diff: mojo/services/public/cpp/view_manager/lib/view_tree_node.cc

Issue 311423003: Provide an API to the example window manager app that supports closing a window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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/public/cpp/view_manager/lib/view_tree_node.cc
diff --git a/mojo/services/public/cpp/view_manager/lib/view_tree_node.cc b/mojo/services/public/cpp/view_manager/lib/view_tree_node.cc
index 03628acb7fc47c065c4626a291ab8e5ed5653003..7da69209528f0524a451893848b2714140092489 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_tree_node.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view_tree_node.cc
@@ -286,11 +286,15 @@ ViewTreeNode::ViewTreeNode()
active_view_(NULL) {}
ViewTreeNode::~ViewTreeNode() {
- ScopedDestructionNotifier notifier(this);
- if (parent_)
- parent_->LocalRemoveChild(this);
- if (manager_)
- ViewManagerPrivate(manager_).RemoveNode(id_);
+ {
+ // TODO(beng): I'm not sure I like these scoped destruction notifiers.
+ // When they fall out of scope |this| is toast.
+ ScopedDestructionNotifier notifier(this);
+ if (parent_)
+ parent_->LocalRemoveChild(this);
+ if (manager_)
+ ViewManagerPrivate(manager_).RemoveNode(id_);
+ }
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698