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

Unified Diff: ui/views/view.h

Issue 2591323002: [views] Changes iteration over |children_| to use range-based for loops (reland) (Closed)
Patch Set: [views] Changes iteration over |children_| to use range-based for loops (DCHECKs) Created 4 years 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
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index a6811afca8a5c084b0d81d5ab375e483cc46c006..8a296a99b813c315b1c960d07b97d0da636b6d1b 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -1466,6 +1466,12 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// This view's children.
Views children_;
+#if DCHECK_IS_ON()
+ // True while iterating over |children_|. Used to detect and DCHECK when
+ // |children_| is mutated during iteration.
+ mutable bool iterating_;
+#endif
+
// Size and disposition ------------------------------------------------------
// This View's bounds in the parent coordinate system.
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698