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

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

Issue 2402643002: Make RenderThreadImpl a client of memory coordinator (Closed)
Patch Set: Created 4 years, 2 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/MemoryCoordinator.h
diff --git a/third_party/WebKit/Source/platform/MemoryCoordinator.h b/third_party/WebKit/Source/platform/MemoryCoordinator.h
index d1805cb3c2cb1b78e5f6ff9e144194bb3f8ee144..2ea0af200c518a07ebcf38f149f4011d7f6acd1c 100644
--- a/third_party/WebKit/Source/platform/MemoryCoordinator.h
+++ b/third_party/WebKit/Source/platform/MemoryCoordinator.h
@@ -8,6 +8,7 @@
#include "platform/PlatformExport.h"
#include "platform/heap/Handle.h"
#include "public/platform/WebMemoryPressureLevel.h"
+#include "public/platform/WebMemoryState.h"
#include "wtf/Noncopyable.h"
namespace blink {
@@ -24,6 +25,8 @@ class PLATFORM_EXPORT MemoryCoordinatorClient : public GarbageCollectedMixin {
// TODO(bashi): Deprecating. Remove this when MemoryPressureListener is
// gone.
virtual void onMemoryPressure(WebMemoryPressureLevel) {}
+
+ virtual void onMemoryStateChange(MemoryState) {}
};
// MemoryCoordinator listens to some events which could be opportunities
@@ -44,11 +47,15 @@ class PLATFORM_EXPORT MemoryCoordinator final
// gone.
void onMemoryPressure(WebMemoryPressureLevel);
+ void onMemoryStateChange(MemoryState);
+
DECLARE_TRACE();
private:
MemoryCoordinator();
+ void clearMemory(bool critical);
+
HeapHashSet<WeakMember<MemoryCoordinatorClient>> m_clients;
};

Powered by Google App Engine
This is Rietveld 408576698