OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "services/resource_coordinator/coordination_unit/coordination_unit_fact
ory.h" |
| 6 |
| 7 #include "services/resource_coordinator/coordination_unit/coordination_unit_impl
.h" |
| 8 #include "services/resource_coordinator/coordination_unit/process_coordination_u
nit_impl.h" |
| 9 #include "services/resource_coordinator/public/cpp/coordination_unit_id.h" |
| 10 #include "services/resource_coordinator/public/cpp/coordination_unit_types.h" |
| 11 #include "services/service_manager/public/cpp/service_context_ref.h" |
| 12 |
| 13 namespace resource_coordinator { |
| 14 |
| 15 namespace CoordinationUnitFactory { |
| 16 |
| 17 std::unique_ptr<CoordinationUnitImpl> CreateCoordinationUnit( |
| 18 const CoordinationUnitID& id, |
| 19 service_manager::ServiceContextRefFactory* service_ref_factory) { |
| 20 switch (id.type) { |
| 21 case CoordinationUnitType::kProcess: |
| 22 return base::MakeUnique<ProcessCoordinationUnitImpl>( |
| 23 id, service_ref_factory->CreateRef()); |
| 24 default: |
| 25 return base::MakeUnique<CoordinationUnitImpl>( |
| 26 id, service_ref_factory->CreateRef()); |
| 27 } |
| 28 } |
| 29 |
| 30 } // namespace CoordinationUnitFactory |
| 31 |
| 32 } // namespace resource_coordinator |
OLD | NEW |