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

Side by Side Diff: components/memory_coordinator/common/client_registry.h

Issue 2144163002: Extract client handing from ChildMemoryCoordinatorImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mc-2-notify
Patch Set: rebase Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_MEMORY_COORDINATOR_COMMON_CLIENT_REGISTRY_H_
6 #define COMPONENTS_MEMORY_COORDINATOR_COMMON_CLIENT_REGISTRY_H_
7
8 #include "base/observer_list_threadsafe.h"
9 #include "components/memory_coordinator/common/memory_coordinator_client.h"
10
11 namespace memory_coordinator {
12
13 // ClientRegistry is a base class of process-specific memory coordinator
14 // and provides ways to register/unregister MemoryCoordinatorClients.
15 class ClientRegistry {
16 public:
17 ClientRegistry();
18 virtual ~ClientRegistry();
19
20 // Registers/unregisters a client. Does not take ownership of client.
21 void RegisterClient(MemoryCoordinatorClient* client);
22 void UnregisterClient(MemoryCoordinatorClient* client);
23
24 protected:
25 using ClientList = base::ObserverListThreadSafe<MemoryCoordinatorClient>;
26 ClientList* clients() { return clients_.get(); }
27
28 private:
29 scoped_refptr<ClientList> clients_;
30 };
31
32 } // namespace memory_coordinator
33
34 #endif // COMPONENTS_MEMORY_COORDINATOR_COMMON_CLIENT_REGISTRY_H_
OLDNEW
« no previous file with comments | « components/memory_coordinator/common/BUILD.gn ('k') | components/memory_coordinator/common/client_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698