Chromium Code Reviews| Index: services/resource_coordinator/public/cpp/resource_coordinator_interface.cc |
| diff --git a/services/resource_coordinator/public/cpp/resource_coordinator_interface.cc b/services/resource_coordinator/public/cpp/resource_coordinator_interface.cc |
| index 0ba8e0be9413e1b872a7f7967405d367e86ce0c0..59f831207a10fe235add5a3f5367471e917d4c62 100644 |
| --- a/services/resource_coordinator/public/cpp/resource_coordinator_interface.cc |
| +++ b/services/resource_coordinator/public/cpp/resource_coordinator_interface.cc |
| @@ -4,6 +4,9 @@ |
| #include "services/resource_coordinator/public/cpp/resource_coordinator_interface.h" |
| +#include <string> |
| +#include <utility> |
|
nasko
2017/06/09 22:19:13
Are these includes really needed?
matthalp
2017/06/09 22:31:58
git cl lint says that "#include <utility>" is need
|
| + |
| #include "mojo/public/cpp/bindings/binding.h" |
| #include "services/resource_coordinator/public/interfaces/coordination_unit_provider.mojom.h" |
| #include "services/resource_coordinator/public/interfaces/service_constants.mojom.h" |
| @@ -82,4 +85,21 @@ void ResourceCoordinatorInterface::AddChildByID( |
| service_->AddChild(child_id); |
| } |
| +void ResourceCoordinatorInterface::RemoveChild( |
| + const ResourceCoordinatorInterface& child) { |
| + DCHECK(thread_checker_.CalledOnValidThread()); |
| + DCHECK(service_); |
| + // We could keep the ID around ourselves, but this hop ensures that the child |
| + // has been created on the service-side. |
| + child.service()->GetID( |
| + base::Bind(&ResourceCoordinatorInterface::RemoveChildByID, |
| + weak_ptr_factory_.GetWeakPtr())); |
| +} |
| + |
| +void ResourceCoordinatorInterface::RemoveChildByID( |
| + const CoordinationUnitID& child_id) { |
| + DCHECK(thread_checker_.CalledOnValidThread()); |
| + service_->RemoveChild(child_id); |
| +} |
| + |
| } // namespace resource_coordinator |