| 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 75889ed43f66e6463c0e9b3dc0ed578ca745b85b..d1f9f6c0009b4f79898e33e87711aedb5694c613 100644
|
| --- a/components/memory_coordinator/child/child_memory_coordinator_impl.cc
|
| +++ b/components/memory_coordinator/child/child_memory_coordinator_impl.cc
|
| @@ -7,12 +7,26 @@
|
| namespace memory_coordinator {
|
|
|
| ChildMemoryCoordinatorImpl::ChildMemoryCoordinatorImpl(
|
| - mojo::InterfaceRequest<mojom::ChildMemoryCoordinator> request,
|
| - scoped_refptr<ClientList> clients)
|
| - : binding_(this, std::move(request)),
|
| - clients_(clients) {}
|
| + shell::InterfaceProvider* remote_interfaces)
|
| + : binding_(this), clients_(new ClientList) {
|
| + if (remote_interfaces) {
|
| + remote_interfaces->GetInterface(mojo::GetProxy(&parent_));
|
| + parent_->AddChild(binding_.CreateInterfacePtrAndBind());
|
| + }
|
| +}
|
| +
|
| +ChildMemoryCoordinatorImpl::~ChildMemoryCoordinatorImpl() {
|
| +}
|
|
|
| -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,
|
|
|