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_provider.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 9 #include "services/resource_coordinator/coordination_unit.h" |
| 10 #include "services/service_manager/public/cpp/connection.h" |
| 11 |
| 12 namespace resource_coordinator { |
| 13 |
| 14 CoordinationUnitProvider::CoordinationUnitProvider() = default; |
| 15 |
| 16 CoordinationUnitProvider::~CoordinationUnitProvider() = default; |
| 17 |
| 18 void CoordinationUnitProvider::CreateCoordinationUnit( |
| 19 mojom::CoordinationUnitRequest request, |
| 20 mojom::CoordinationUnitIDPtr options) { |
| 21 // TODO(oysteine): A strong binding here means the first binding set up |
| 22 // to a CoordinationUnit via CoordinationUnitProvider, i.e. the authoritative |
| 23 // one in terms of setting the context, has to outlive all of the other |
| 24 // connections (as the rest are just duplicated and held within |
| 25 // CoordinationUnit). Make sure this assumption is correct, or refactor into |
| 26 // some kind of refcounted thing. |
| 27 mojo::MakeStrongBinding( |
| 28 base::MakeUnique<CoordinationUnit>(std::move(options)), |
| 29 std::move(request)); |
| 30 }; |
| 31 |
| 32 } // namespace resource_coordinator |
OLD | NEW |