Alex Deymo | 3053450 | 2015-07-20 15:06:33 -0700 | [diff] [blame] | 1 | // Copyright 2015 The Chromium OS 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 "update_engine/libcros_proxy.h" |
| 6 | |
| 7 | #include "update_engine/dbus_proxies.h" |
| 8 | |
| 9 | using org::chromium::LibCrosServiceInterfaceProxy; |
| 10 | using org::chromium::LibCrosServiceInterfaceProxyInterface; |
| 11 | using org::chromium::UpdateEngineLibcrosProxyResolvedInterfaceProxy; |
| 12 | using org::chromium::UpdateEngineLibcrosProxyResolvedInterfaceProxyInterface; |
| 13 | |
| 14 | namespace { |
| 15 | const char kLibCrosServiceName[] = "org.chromium.LibCrosService"; |
| 16 | } // namespace |
| 17 | |
| 18 | namespace chromeos_update_engine { |
| 19 | |
| 20 | LibCrosProxy::LibCrosProxy( |
| 21 | std::unique_ptr<LibCrosServiceInterfaceProxyInterface> |
| 22 | service_interface_proxy, |
| 23 | std::unique_ptr<UpdateEngineLibcrosProxyResolvedInterfaceProxyInterface> |
| 24 | ue_proxy_resolved_interface) |
| 25 | : service_interface_proxy_(std::move(service_interface_proxy)), |
| 26 | ue_proxy_resolved_interface_(std::move(ue_proxy_resolved_interface)) { |
| 27 | } |
| 28 | |
| 29 | LibCrosProxy::LibCrosProxy(const scoped_refptr<dbus::Bus>& bus) |
| 30 | : service_interface_proxy_( |
| 31 | new LibCrosServiceInterfaceProxy(bus, kLibCrosServiceName)), |
| 32 | ue_proxy_resolved_interface_( |
| 33 | new UpdateEngineLibcrosProxyResolvedInterfaceProxy( |
| 34 | bus, |
| 35 | kLibCrosServiceName)) { |
| 36 | } |
| 37 | |
| 38 | LibCrosServiceInterfaceProxyInterface* LibCrosProxy::service_interface_proxy() { |
| 39 | return service_interface_proxy_.get(); |
| 40 | } |
| 41 | |
| 42 | UpdateEngineLibcrosProxyResolvedInterfaceProxyInterface* |
| 43 | LibCrosProxy::ue_proxy_resolved_interface() { |
| 44 | return ue_proxy_resolved_interface_.get(); |
| 45 | } |
| 46 | |
| 47 | } // namespace chromeos_update_engine |