blob: 76efb1ff3d52082b43a806b2aaecdf14664aa756 [file] [log] [blame]
Andreea Costinas942284d2020-01-28 16:28:40 +01001// Copyright 2020 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#ifndef SYSTEM_PROXY_SYSTEM_PROXY_ADAPTOR_H_
5#define SYSTEM_PROXY_SYSTEM_PROXY_ADAPTOR_H_
6
7#include <memory>
8#include <vector>
9
10#include <brillo/dbus/async_event_sequencer.h>
11
12#include "system_proxy/org.chromium.SystemProxy.h"
13
14namespace brillo {
15namespace dbus_utils {
16class DBusObject;
17}
18
19} // namespace brillo
20
21namespace system_proxy {
22// Implementation of the SystemProxy D-Bus interface.
23class SystemProxyAdaptor : public org::chromium::SystemProxyAdaptor,
24 public org::chromium::SystemProxyInterface {
25 public:
26 explicit SystemProxyAdaptor(
27 std::unique_ptr<brillo::dbus_utils::DBusObject> dbus_object);
28 SystemProxyAdaptor(const SystemProxyAdaptor&) = delete;
29 SystemProxyAdaptor& operator=(const SystemProxyAdaptor&) = delete;
30 ~SystemProxyAdaptor();
31
32 // Registers the D-Bus object and interfaces.
33 void RegisterAsync(
34 const brillo::dbus_utils::AsyncEventSequencer::CompletionAction&
35 completion_callback);
36
37 // org::chromium::SystemProxyInterface: (see org.chromium.SystemProxy.xml).
38 std::vector<uint8_t> SetSystemTrafficCredentials(
39 const std::vector<uint8_t>& request_blob) override;
40 std::vector<uint8_t> ShutDown() override;
41
42 private:
43 std::unique_ptr<brillo::dbus_utils::DBusObject> dbus_object_;
44};
45
46} // namespace system_proxy
47#endif // SYSTEM_PROXY_SYSTEM_PROXY_ADAPTOR_H_