Chromium Code Reviews| 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..4f55191cd0f3f767ea20ed3b71b6afb4e12451f4 100644 |
| --- a/components/memory_coordinator/child/child_memory_coordinator_impl.cc |
| +++ b/components/memory_coordinator/child/child_memory_coordinator_impl.cc |
| @@ -6,17 +6,31 @@ |
| namespace memory_coordinator { |
| +// static |
| +void ChildMemoryCoordinatorImpl::Create( |
| + mojo::InterfaceRequest<mojom::ChildMemoryCoordinator> request) { |
| + new ChildMemoryCoordinatorImpl(std::move(request), new ClientList); |
| +} |
| + |
| ChildMemoryCoordinatorImpl::ChildMemoryCoordinatorImpl( |
| mojo::InterfaceRequest<mojom::ChildMemoryCoordinator> request, |
| scoped_refptr<ClientList> clients) |
| : binding_(this, std::move(request)), |
| - clients_(clients) {} |
| + clients_(clients) { |
| + // TODO(bashi): Add clients (e.g. skia). |
|
chrisha
2016/06/27 20:35:30
Wouldn't it make more sense for clients to add the
bashi
2016/06/27 22:40:23
It was my first attempt. MemoryPressureListener us
|
| +} |
| ChildMemoryCoordinatorImpl::~ChildMemoryCoordinatorImpl() {} |
| void ChildMemoryCoordinatorImpl::OnStateChange(mojom::MemoryState state) { |
| + state_ = state; |
| clients_->Notify(FROM_HERE, &MemoryCoordinatorClient::OnMemoryStateChange, |
| state); |
| } |
| +void ChildMemoryCoordinatorImpl::GetCurrentState( |
|
chrisha
2016/06/27 20:35:30
Do we need this call? The state is centrally impos
bashi
2016/06/27 22:40:23
This is for testing. Without it it's hard to make
|
| + const GetCurrentStateCallback& callback) { |
| + callback.Run(state_); |
| +} |
| + |
| } // namespace memory_coordinator |