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

Unified Diff: components/memory_coordinator/common/client_registry.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/memory_coordinator/common/client_registry.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/memory_coordinator/common/client_registry.cc
diff --git a/components/memory_coordinator/common/client_registry.cc b/components/memory_coordinator/common/client_registry.cc
new file mode 100644
index 0000000000000000000000000000000000000000..57866c880d774fbfccf2638c484d3d64e3209989
--- /dev/null
+++ b/components/memory_coordinator/common/client_registry.cc
@@ -0,0 +1,21 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/memory_coordinator/common/client_registry.h"
+
+namespace memory_coordinator {
+
+ClientRegistry::ClientRegistry() : clients_(new ClientList) {}
+
+ClientRegistry::~ClientRegistry() {}
+
+void ClientRegistry::RegisterClient(MemoryCoordinatorClient* client) {
+ clients_->AddObserver(client);
+}
+
+void ClientRegistry::UnregisterClient(MemoryCoordinatorClient* client) {
+ clients_->RemoveObserver(client);
+}
+
+} // namespace memory_coordinator
« no previous file with comments | « components/memory_coordinator/common/client_registry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698