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

Unified Diff: components/memory_coordinator/child/child_memory_coordinator_impl.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
Index: components/memory_coordinator/child/child_memory_coordinator_impl.cc
diff --git a/components/memory_coordinator/child/child_memory_coordinator_impl.cc b/components/memory_coordinator/child/child_memory_coordinator_impl.cc
index 3598945c1af47104bf9c59d58d2ad618ee2abd89..8251827635868ca99a4b64fda8da72ec1ec3fecf 100644
--- a/components/memory_coordinator/child/child_memory_coordinator_impl.cc
+++ b/components/memory_coordinator/child/child_memory_coordinator_impl.cc
@@ -8,26 +8,16 @@ namespace memory_coordinator {
ChildMemoryCoordinatorImpl::ChildMemoryCoordinatorImpl(
mojom::MemoryCoordinatorHandlePtr parent)
- : binding_(this), clients_(new ClientList), parent_(std::move(parent)) {
+ : binding_(this), parent_(std::move(parent)) {
parent_->AddChild(binding_.CreateInterfacePtrAndBind());
}
ChildMemoryCoordinatorImpl::~ChildMemoryCoordinatorImpl() {
}
-void ChildMemoryCoordinatorImpl::RegisterClient(
- MemoryCoordinatorClient* client) {
- clients_->AddObserver(client);
-}
-
-void ChildMemoryCoordinatorImpl::UnregisterClient(
- MemoryCoordinatorClient* client) {
- clients_->RemoveObserver(client);
-}
-
void ChildMemoryCoordinatorImpl::OnStateChange(mojom::MemoryState state) {
- clients_->Notify(FROM_HERE, &MemoryCoordinatorClient::OnMemoryStateChange,
- state);
+ clients()->Notify(FROM_HERE, &MemoryCoordinatorClient::OnMemoryStateChange,
+ state);
}
} // namespace memory_coordinator
« no previous file with comments | « components/memory_coordinator/child/child_memory_coordinator_impl.h ('k') | components/memory_coordinator/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698