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

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

Issue 2082553002: Reland of Check DisplayItemCient aliveness in cached subsequences (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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..1d8e59430e936ac72b4c6da089f9b55227d7aa7e 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
@@ -66,8 +66,26 @@
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()) {
+ // Mark the client shouldKeepAlive under this PaintController.
+ // The status will end after the new display items are committed.
+ displayItem.client().beginShouldKeepAlive(this);
+
+ if (!m_currentSubsequenceClients.isEmpty()) {
+ // Mark the client shouldKeepAlive under the current subsequence.
+ // The status will end when the subsequence owner is invalidated or deleted.
+ displayItem.client().beginShouldKeepAlive(m_currentSubsequenceClients.last());
+ }
+ }
+
+ if (displayItem.getType() == DisplayItem::Subsequence) {
+ m_currentSubsequenceClients.append(&displayItem.client());
+ } else if (displayItem.getType() == DisplayItem::EndSubsequence) {
+ CHECK(m_currentSubsequenceClients.last() == &displayItem.client());
+ m_currentSubsequenceClients.removeLast();
+ }
+ }
#endif
if (displayItem.isCached())
@@ -403,6 +421,7 @@
displayItem.client().setDisplayItemsCached(m_currentCacheGeneration);
}
#if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
+ CHECK(m_currentSubsequenceClients.isEmpty());
DisplayItemClient::endShouldKeepAliveAllClients(this);
#endif
}

Powered by Google App Engine
This is Rietveld 408576698