Index: services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.cc |
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.cc b/services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.cc |
index e3d970963f48e161703ab6fe9fa65a2f0e416c20..cfd4491beb86692bc618fba755dca3753cdd0f05 100644 |
--- a/services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.cc |
+++ b/services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.cc |
@@ -9,7 +9,6 @@ |
#include "base/logging.h" |
#include "mojo/public/cpp/bindings/strong_binding.h" |
-#include "services/resource_coordinator/coordination_unit/coordination_unit_factory.h" |
#include "services/resource_coordinator/coordination_unit/coordination_unit_impl.h" |
#include "services/service_manager/public/cpp/service_context_ref.h" |
@@ -27,11 +26,19 @@ |
void CoordinationUnitProviderImpl::CreateCoordinationUnit( |
mojom::CoordinationUnitRequest request, |
const CoordinationUnitID& id) { |
- std::unique_ptr<CoordinationUnitImpl> coordination_unit = |
- coordination_unit_factory::CreateCoordinationUnit( |
- id, service_ref_factory_->CreateRef()); |
+ // TODO(oysteine): A strong binding here means the first binding set up |
+ // to a CoordinationUnit via CoordinationUnitProvider, i.e. the authoritative |
+ // one in terms of setting the context, has to outlive all of the other |
+ // connections (as the rest are just duplicated and held within |
+ // CoordinationUnit). Make sure this assumption is correct, or refactor into |
+ // some kind of refcounted thing. |
- mojo::MakeStrongBinding(std::move(coordination_unit), std::move(request)); |
+ // Once there's a need for custom code for various types of CUs (tabs, |
+ // processes, etc) then this could become a factory function and instantiate |
+ // different subclasses of CoordinationUnitImpl based on the id.type. |
+ mojo::MakeStrongBinding(base::MakeUnique<CoordinationUnitImpl>( |
+ id, service_ref_factory_->CreateRef()), |
+ std::move(request)); |
}; |
// static |