Index: ui/views/view.h |
diff --git a/ui/views/view.h b/ui/views/view.h |
index a6811afca8a5c084b0d81d5ab375e483cc46c006..5c88e2c98852c1d693499e330ba4a4f9243fc89c 100644 |
--- a/ui/views/view.h |
+++ b/ui/views/view.h |
@@ -84,6 +84,10 @@ class PostEventDispatchHandler; |
class RootView; |
} |
+namespace { |
+class ScopedChildrenLock; |
+} |
sadrul
2016/12/24 00:13:11
Oh, missed this, sorry. This should not be in anon
|
+ |
///////////////////////////////////////////////////////////////////////////// |
// |
// View class |
@@ -1230,6 +1234,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
friend class internal::PostEventDispatchHandler; |
friend class internal::RootView; |
friend class FocusManager; |
+ friend class ScopedChildrenLock; |
friend class ViewLayerTest; |
friend class Widget; |
@@ -1466,6 +1471,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. |