shill_proxy_interface.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // Copyright (C) 2015 The Android Open Source Project
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. #ifndef UPDATE_ENGINE_SHILL_PROXY_INTERFACE_H_
  17. #define UPDATE_ENGINE_SHILL_PROXY_INTERFACE_H_
  18. #include <memory>
  19. #include <string>
  20. #include <base/macros.h>
  21. #include <dbus/object_path.h>
  22. #include <shill/dbus-proxies.h>
  23. namespace chromeos_update_engine {
  24. // This class handles the DBus connection with shill daemon. The DBus interface
  25. // with shill requires to monitor or request the current service by interacting
  26. // with the org::chromium::flimflam::ManagerProxy and then request or monitor
  27. // properties on the selected org::chromium::flimflam::ServiceProxy. This class
  28. // provides a mockable way to access that.
  29. class ShillProxyInterface {
  30. public:
  31. virtual ~ShillProxyInterface() = default;
  32. // Return the ManagerProxy instance of the shill daemon. The instance is owned
  33. // by this ShillProxyInterface instance.
  34. virtual org::chromium::flimflam::ManagerProxyInterface* GetManagerProxy() = 0;
  35. // Return a ServiceProxy for the given path. The ownership of the returned
  36. // instance is transferred to the caller.
  37. virtual std::unique_ptr<org::chromium::flimflam::ServiceProxyInterface>
  38. GetServiceForPath(const dbus::ObjectPath& path) = 0;
  39. protected:
  40. ShillProxyInterface() = default;
  41. private:
  42. DISALLOW_COPY_AND_ASSIGN(ShillProxyInterface);
  43. };
  44. } // namespace chromeos_update_engine
  45. #endif // UPDATE_ENGINE_SHILL_PROXY_INTERFACE_H_