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

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

Issue 424533002: Cleans up usage of ViewManagerServiceImpl::roots_ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: delete 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/public/cpp/view_manager/lib/node.cc
diff --git a/mojo/services/public/cpp/view_manager/lib/node.cc b/mojo/services/public/cpp/view_manager/lib/node.cc
index 292cf29e381ca53f29914b2495ccabbdf1598d71..84d214ec29faa4093679e28d431b8c6e88be84e3 100644
--- a/mojo/services/public/cpp/view_manager/lib/node.cc
+++ b/mojo/services/public/cpp/view_manager/lib/node.cc
@@ -216,8 +216,17 @@ void Node::Destroy() {
if (manager_)
static_cast<ViewManagerClientImpl*>(manager_)->DestroyNode(id_);
- while (!children_.empty())
- children_.front()->Destroy();
+ while (!children_.empty()) {
+ Node* child = children_.front();
+ if (!OwnsNode(manager_, child)) {
+ children_.erase(children_.begin());
+ child->LocalDestroy();
sky 2014/07/26 16:21:39 I think this is right, but now I'm worried that 21
Ben Goodger (Google) 2014/07/26 16:49:10 Yeah I would be inclined to think so too... It sh
sky 2014/07/26 20:46:23 Child nodes yes, but the root(s) of the connection
Ben Goodger (Google) 2014/07/26 22:56:15 OK
+ } else {
+ child->Destroy();
+ DCHECK(std::find(children_.begin(), children_.end(), child) ==
+ children_.end());
+ }
+ }
LocalDestroy();
}
« no previous file with comments | « no previous file | mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc » ('j') | mojo/services/view_manager/ids.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698