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