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

Unified Diff: third_party/WebKit/Source/platform/MemoryCoordinator.cpp

Issue 2680713002: Should not invalidate font cache for purge+suspend. (Closed)
Patch Set: Fixed. Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/MemoryCoordinator.cpp
diff --git a/third_party/WebKit/Source/platform/MemoryCoordinator.cpp b/third_party/WebKit/Source/platform/MemoryCoordinator.cpp
index 4882b3dd951097be28d0beb69b1f97c0d758e8ba..b414dbf4ede1cc83781c9667cf560cc335b3e18a 100644
--- a/third_party/WebKit/Source/platform/MemoryCoordinator.cpp
+++ b/third_party/WebKit/Source/platform/MemoryCoordinator.cpp
@@ -65,8 +65,12 @@ void MemoryCoordinator::onMemoryPressure(WebMemoryPressureLevel level) {
void MemoryCoordinator::onMemoryStateChange(MemoryState state) {
for (auto& client : m_clients)
client->onMemoryStateChange(state);
+ // Font cache invalidation always causes full layout. This increases
+ // tab switching cost significantly (e.g. en.wikipedia.org/wiki/Wikipedia).
+ // So we should not invalidate the font cache in purge+throttle. We should
+ // invalidate the font cache only when receiving a critical memory pressure.
if (state == MemoryState::SUSPENDED)
- clearMemory();
+ ImageDecodingStore::instance().clear();
WTF::Partitions::decommitFreeableMemory();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698