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

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

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.h
diff --git a/components/memory_coordinator/browser/memory_coordinator.h b/components/memory_coordinator/browser/memory_coordinator.h
index e3857196ce214d6a7b330a1ee9a5d50a00dbb0ae..09fae82f2f4eba6f5e8bb8323b79b3e55edc458e 100644
--- a/components/memory_coordinator/browser/memory_coordinator.h
+++ b/components/memory_coordinator/browser/memory_coordinator.h
@@ -6,6 +6,7 @@
#define COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_COORDINATOR_H_
#include "base/memory/memory_pressure_listener.h"
+#include "base/memory/singleton.h"
#include "components/memory_coordinator/common/client_registry.h"
#include "components/memory_coordinator/common/memory_coordinator_export.h"
#include "components/memory_coordinator/public/interfaces/memory_coordinator.mojom.h"
@@ -20,9 +21,10 @@ class MemoryCoordinatorHandleImpl;
// and child processes based on its best knowledge of the memory usage.
class MEMORY_COORDINATOR_EXPORT MemoryCoordinator : public ClientRegistry {
public:
- MemoryCoordinator();
~MemoryCoordinator() override;
+ static MemoryCoordinator* GetInstance();
+
void CreateHandle(int render_process_id,
mojom::MemoryCoordinatorHandleRequest request);
@@ -30,6 +32,10 @@ class MEMORY_COORDINATOR_EXPORT MemoryCoordinator : public ClientRegistry {
size_t NumChildrenForTesting();
private:
+ friend struct base::DefaultSingletonTraits<MemoryCoordinator>;
+
+ MemoryCoordinator();
+
void OnConnectionError(int render_process_id);
// Called when MemoryPressureListener detects memory pressure.
« no previous file with comments | « components/history/core/browser/history_backend.cc ('k') | components/memory_coordinator/browser/memory_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698