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

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

Issue 2230433002: Add MemoryCoordinatorClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 4 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
deleted file mode 100644
index 745d979f619014d132f3afd30088efb834717643..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "core/dom/MemoryCoordinator.h"
-
-#include "core/fetch/MemoryCache.h"
-#include "platform/TraceEvent.h"
-#include "platform/fonts/FontCache.h"
-#include "platform/graphics/ImageDecodingStore.h"
-#include "platform/heap/Heap.h"
-#include "wtf/allocator/Partitions.h"
-
-namespace blink {
-
-MemoryCoordinator& MemoryCoordinator::instance()
-{
- DEFINE_STATIC_LOCAL(MemoryCoordinator, instance, ());
- return instance;
-}
-
-MemoryCoordinator::MemoryCoordinator()
-{
-}
-
-MemoryCoordinator::~MemoryCoordinator()
-{
-}
-
-void MemoryCoordinator::onMemoryPressure(WebMemoryPressureLevel level)
-{
- TRACE_EVENT0("blink", "MemoryCoordinator::onMemoryPressure");
- if (level == WebMemoryPressureLevelCritical) {
- // Clear the image cache.
- ImageDecodingStore::instance().clear();
- FontCache::fontCache()->invalidate();
- }
- if (ProcessHeap::isLowEndDevice())
- memoryCache()->pruneAll();
- WTF::Partitions::decommitFreeableMemory();
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698