| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/dbus/services/cros_dbus_service.h" | 5 #include "chromeos/dbus/services/cros_dbus_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 const dbus::ObjectPath& object_path, | 106 const dbus::ObjectPath& object_path, |
| 107 ServiceProviderList service_providers) { | 107 ServiceProviderList service_providers) { |
| 108 if (DBusThreadManager::Get()->IsUsingFakes()) | 108 if (DBusThreadManager::Get()->IsUsingFakes()) |
| 109 return base::MakeUnique<CrosDBusServiceStubImpl>(); | 109 return base::MakeUnique<CrosDBusServiceStubImpl>(); |
| 110 | 110 |
| 111 return CreateRealImpl(DBusThreadManager::Get()->GetSystemBus(), service_name, | 111 return CreateRealImpl(DBusThreadManager::Get()->GetSystemBus(), service_name, |
| 112 object_path, std::move(service_providers)); | 112 object_path, std::move(service_providers)); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // static | 115 // static |
| 116 CrosDBusService::ServiceProviderList CrosDBusService::CreateServiceProviderList( | |
| 117 std::unique_ptr<ServiceProviderInterface> provider) { | |
| 118 ServiceProviderList list; | |
| 119 list.push_back(std::move(provider)); | |
| 120 return list; | |
| 121 } | |
| 122 | |
| 123 // static | |
| 124 std::unique_ptr<CrosDBusService> CrosDBusService::CreateRealImpl( | 116 std::unique_ptr<CrosDBusService> CrosDBusService::CreateRealImpl( |
| 125 dbus::Bus* bus, | 117 dbus::Bus* bus, |
| 126 const std::string& service_name, | 118 const std::string& service_name, |
| 127 const dbus::ObjectPath& object_path, | 119 const dbus::ObjectPath& object_path, |
| 128 ServiceProviderList service_providers) { | 120 ServiceProviderList service_providers) { |
| 129 auto service = base::MakeUnique<CrosDBusServiceImpl>( | 121 auto service = base::MakeUnique<CrosDBusServiceImpl>( |
| 130 bus, service_name, object_path, std::move(service_providers)); | 122 bus, service_name, object_path, std::move(service_providers)); |
| 131 service->Start(); | 123 service->Start(); |
| 132 return std::move(service); | 124 return std::move(service); |
| 133 } | 125 } |
| 134 | 126 |
| 135 CrosDBusService::~CrosDBusService() = default; | 127 CrosDBusService::~CrosDBusService() = default; |
| 136 | 128 |
| 137 CrosDBusService::CrosDBusService() = default; | 129 CrosDBusService::CrosDBusService() = default; |
| 138 | 130 |
| 139 CrosDBusService::ServiceProviderInterface::~ServiceProviderInterface() = | 131 CrosDBusService::ServiceProviderInterface::~ServiceProviderInterface() = |
| 140 default; | 132 default; |
| 141 | 133 |
| 142 } // namespace chromeos | 134 } // namespace chromeos |
| OLD | NEW |