Index: third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
index f474b93a45cf01ec08a84531734f1bad0981aa85..f9e29676edbb5333a4de69c14bf904def1f2a31f 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
@@ -66,8 +66,20 @@ void PaintController::processNewItem(DisplayItem& displayItem) |
DCHECK(!skippingCache() || !displayItem.isCached()); |
#if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
- if (!skippingCache() && (displayItem.isCacheable() || displayItem.isCached())) |
- displayItem.client().beginShouldKeepAlive(this); |
+ if (!skippingCache()) { |
+ if (displayItem.isCacheable() || displayItem.isCached()) { |
+ displayItem.client().beginShouldKeepAlive(this); |
+ if (!m_subsequenceClients.isEmpty()) |
+ displayItem.client().beginShouldKeepAlive(m_subsequenceClients.last()); |
chrishtr
2016/06/18 08:49:57
What does this do exactly? beginShouldKeepAlive fo
Xianzhu
2016/06/18 17:41:30
Yes, this is to mark the new display item shouldKe
|
+ } |
+ |
+ if (displayItem.getType() == DisplayItem::Subsequence) { |
+ m_subsequenceClients.append(&displayItem.client()); |
+ } else if (displayItem.getType() == DisplayItem::EndSubsequence) { |
+ CHECK(m_subsequenceClients.last() == &displayItem.client()); |
+ m_subsequenceClients.removeLast(); |
+ } |
+ } |
#endif |
if (displayItem.isCached()) |
@@ -403,6 +415,7 @@ void PaintController::updateCacheGeneration() |
displayItem.client().setDisplayItemsCached(m_currentCacheGeneration); |
} |
#if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
+ CHECK(m_subsequenceClients.isEmpty()); |
DisplayItemClient::endShouldKeepAliveAllClients(this); |
#endif |
} |