Index: components/memory_coordinator/common/client_registry.h |
diff --git a/components/memory_coordinator/common/client_registry.h b/components/memory_coordinator/common/client_registry.h |
index ec5874f15c69f261017c7ec7b6be84da67581f99..dcc0d2377dc6905a21f954d7b45affb6c93a8c73 100644 |
--- a/components/memory_coordinator/common/client_registry.h |
+++ b/components/memory_coordinator/common/client_registry.h |
@@ -18,16 +18,21 @@ class MEMORY_COORDINATOR_EXPORT ClientRegistry { |
ClientRegistry(); |
virtual ~ClientRegistry(); |
+ static ClientRegistry* GetInstance(); |
+ |
// Registers/unregisters a client. Does not take ownership of client. |
void RegisterClient(MemoryCoordinatorClient* client); |
void UnregisterClient(MemoryCoordinatorClient* client); |
protected: |
+ static void SetInstance(ClientRegistry*); |
+ |
using ClientList = base::ObserverListThreadSafe<MemoryCoordinatorClient>; |
ClientList* clients() { return clients_.get(); } |
private: |
scoped_refptr<ClientList> clients_; |
+ static ClientRegistry* instance_; |
}; |
} // namespace memory_coordinator |