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

Unified Diff: components/memory_coordinator/browser/memory_coordinator.cc

Issue 2261073002: Make HistoryBackend a client of memory coordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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: components/memory_coordinator/browser/memory_coordinator.cc
diff --git a/components/memory_coordinator/browser/memory_coordinator.cc b/components/memory_coordinator/browser/memory_coordinator.cc
index 9291fd00f9a042270315839ea7146d3ae899a6fa..c1119c98e4bdc57e27ecc5e14778cfab9f405619 100644
--- a/components/memory_coordinator/browser/memory_coordinator.cc
+++ b/components/memory_coordinator/browser/memory_coordinator.cc
@@ -4,6 +4,8 @@
#include "components/memory_coordinator/browser/memory_coordinator.h"
+#include "components/memory_coordinator/common/memory_coordinator_features.h"
+
namespace memory_coordinator {
// The implementation of MemoryCoordinatorHandle. See memory_coordinator.mojom
@@ -31,6 +33,14 @@ class MemoryCoordinatorHandleImpl : public mojom::MemoryCoordinatorHandle {
DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorHandleImpl);
};
+// static
+MemoryCoordinator* MemoryCoordinator::GetInstance() {
+ if (!IsEnabled())
+ return nullptr;
+ return base::Singleton<MemoryCoordinator,
+ base::LeakySingletonTraits<MemoryCoordinator>>::get();
+}
+
MemoryCoordinator::MemoryCoordinator()
: pressure_listener_(
base::Bind(&MemoryCoordinator::OnMemoryPressure,

Powered by Google App Engine
This is Rietveld 408576698