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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp

Issue 2066603005: Check DisplayItemCient aliveness in cached subsequences (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check DisplayItemCient aliveness in cached subsequences Created 4 years, 6 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: 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
}

Powered by Google App Engine
This is Rietveld 408576698