blob: a4d3aa38a5c5dba5996978eed7490400f4a6c3ad [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#ifndef UPDATE_ENGINE_SHILL_PROXY_INTERFACE_H_
6#define UPDATE_ENGINE_SHILL_PROXY_INTERFACE_H_
7
8#include <memory>
9#include <string>
10
11#include <base/macros.h>
12
13#include "update_engine/dbus_proxies.h"
14
15namespace chromeos_update_engine {
16
17// This class handles the DBus connection with shill daemon. The DBus interface
18// with shill requires to monitor or request the current service by interacting
19// with the org::chromium::flimflam::ManagerProxy and then request or monitor
20// properties on the selected org::chromium::flimflam::ServiceProxy. This class
21// provides a mockable way to access that.
22class ShillProxyInterface {
23 public:
24 virtual ~ShillProxyInterface() = default;
25
26 // Return the ManagerProxy instance of the shill daemon. The instance is owned
27 // by this ShillProxyInterface instance.
28 virtual org::chromium::flimflam::ManagerProxyInterface* GetManagerProxy() = 0;
29
30 // Return a ServiceProxy for the given path. The ownership of the returned
31 // instance is transferred to the caller.
32 virtual std::unique_ptr<org::chromium::flimflam::ServiceProxyInterface>
33 GetServiceForPath(const std::string& path) = 0;
34
35 protected:
36 ShillProxyInterface() = default;
37
38 private:
39 DISALLOW_COPY_AND_ASSIGN(ShillProxyInterface);
40};
41
42} // namespace chromeos_update_engine
43
44#endif // UPDATE_ENGINE_SHILL_PROXY_INTERFACE_H_