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 #include "services/resource_coordinator/coordination_unit/coordination_unit_impl
.h" |
| 7 #include "services/resource_coordinator/coordination_unit/process_coordination_u
nit_impl.h" |
| 8 #include "services/resource_coordinator/public/cpp/coordination_unit_id.h" |
| 9 #include "services/resource_coordinator/public/cpp/coordination_unit_types.h" |
| 10 #include "services/service_manager/public/cpp/service_context_ref.h" |
| 11 |
| 12 namespace resource_coordinator { |
| 13 |
| 14 // static |
| 15 std::unique_ptr<CoordinationUnitImpl> |
| 16 CoordinationUnitFactory::CreateCoordinationUnit( |
| 17 const CoordinationUnitID& id, |
| 18 service_manager::ServiceContextRefFactory* service_ref_factory) { |
| 19 switch (id.type) { |
| 20 case CoordinationUnitType::kProcess: |
| 21 return base::MakeUnique<ProcessCoordinationUnitImpl>( |
| 22 id, service_ref_factory->CreateRef()); |
| 23 default: |
| 24 return base::MakeUnique<CoordinationUnitImpl>( |
| 25 id, service_ref_factory->CreateRef()); |
| 26 } |
| 27 } |
| 28 |
| 29 } // namespace resource_coordinator |
OLD | NEW |