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

Unified Diff: third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp

Issue 2130683002: [Experiment] purge-and-suspend Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 4 years, 5 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/core/dom/MemoryCoordinator.cpp
diff --git a/third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp b/third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp
index 745d979f619014d132f3afd30088efb834717643..d951dd87e92fa0d457a31e2f228f41aaffa8b505 100644
--- a/third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp
+++ b/third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp
@@ -4,11 +4,15 @@
#include "core/dom/MemoryCoordinator.h"
+#include "bindings/core/v8/V8PerIsolateData.h"
#include "core/fetch/MemoryCache.h"
+#include "core/page/Page.h"
+#include "core/paint/InlineTextBoxPainter.h"
#include "platform/TraceEvent.h"
#include "platform/fonts/FontCache.h"
#include "platform/graphics/ImageDecodingStore.h"
#include "platform/heap/Heap.h"
+#include "platform/text/CompressibleString.h"
#include "wtf/allocator/Partitions.h"
namespace blink {
@@ -30,13 +34,21 @@ MemoryCoordinator::~MemoryCoordinator()
void MemoryCoordinator::onMemoryPressure(WebMemoryPressureLevel level)
{
TRACE_EVENT0("blink", "MemoryCoordinator::onMemoryPressure");
+
if (level == WebMemoryPressureLevelCritical) {
// Clear the image cache.
ImageDecodingStore::instance().clear();
+ memoryCache()->pruneAll();
esprehn 2016/08/05 23:00:57 Would it be possible to independently hook up thes
tasak 2016/08/08 04:47:36 Acknowledged.
+ InlineTextBoxPainter::invalidateTextBlobCache();
+ Page::onMemoryPressure();
+ FontCache::fontCache()->invalidateShapeCache();
FontCache::fontCache()->invalidate();
+ V8PerIsolateData::purgeMemory();
+ CompressibleStringImpl::compressAll();
esprehn 2016/08/05 23:00:58 hmm without suspend doing this is pretty bad, it m
tasak 2016/08/08 04:47:36 Acknowledged.
+ } else {
esprehn 2016/08/05 23:00:57 else if
tasak 2016/08/08 04:47:36 Acknowledged.
+ if (ProcessHeap::isLowEndDevice())
+ memoryCache()->pruneAll();
}
- if (ProcessHeap::isLowEndDevice())
- memoryCache()->pruneAll();
WTF::Partitions::decommitFreeableMemory();
}

Powered by Google App Engine
This is Rietveld 408576698