blob: 9f76ea99c0b4056f54bb93ad2627a2333df27863 [file] [log] [blame]
Alex Deymo30534502015-07-20 15:06:33 -07001// 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
9using org::chromium::LibCrosServiceInterfaceProxy;
10using org::chromium::LibCrosServiceInterfaceProxyInterface;
11using org::chromium::UpdateEngineLibcrosProxyResolvedInterfaceProxy;
12using org::chromium::UpdateEngineLibcrosProxyResolvedInterfaceProxyInterface;
13
14namespace {
15const char kLibCrosServiceName[] = "org.chromium.LibCrosService";
16} // namespace
17
18namespace chromeos_update_engine {
19
20LibCrosProxy::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
29LibCrosProxy::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
38LibCrosServiceInterfaceProxyInterface* LibCrosProxy::service_interface_proxy() {
39 return service_interface_proxy_.get();
40}
41
42UpdateEngineLibcrosProxyResolvedInterfaceProxyInterface*
43LibCrosProxy::ue_proxy_resolved_interface() {
44 return ue_proxy_resolved_interface_.get();
45}
46
47} // namespace chromeos_update_engine