Index: third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.h |
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.h b/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.h |
index e185231a90a47f3079fd85df6b625d9cad63a272..6bda9eb0cbecdac9f8c0f4aa5df64b6ae453a90c 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.h |
+++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.h |
@@ -12,6 +12,7 @@ |
#include "platform/graphics/paint/DrawingDisplayItem.h" |
#include "platform/graphics/paint/PaintController.h" |
#include "wtf/Allocator.h" |
+#include "wtf/AutoReset.h" |
#include "wtf/Noncopyable.h" |
#ifndef NDEBUG |
@@ -54,10 +55,24 @@ class PLATFORM_EXPORT DrawingRecorder final { |
bool m_knownToBeOpaque; |
#if DCHECK_IS_ON() |
- size_t m_displayItemPosition; |
+ // Ensures the list size does not change during the recorder's scope. |
+ size_t m_initialDisplayItemListSize; |
#endif |
}; |
+#if DCHECK_IS_ON() |
+class DisableListModificationCheck { |
+ STACK_ALLOCATED(); |
+ WTF_MAKE_NONCOPYABLE(DisableListModificationCheck); |
+ |
+ public: |
+ DisableListModificationCheck(); |
+ |
+ private: |
+ AutoReset<bool> m_disabler; |
+}; |
+#endif // DCHECK_IS_ON() |
+ |
} // namespace blink |
#endif // DrawingRecorder_h |