OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_DBUS_PERMISSION_BROKER_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_PERMISSION_BROKER_CLIENT_H_ |
6 #define CHROMEOS_DBUS_PERMISSION_BROKER_CLIENT_H_ | 6 #define CHROMEOS_DBUS_PERMISSION_BROKER_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 static PermissionBrokerClient* Create(); | 39 static PermissionBrokerClient* Create(); |
40 | 40 |
41 // CheckPathAccess requests a hint from the permission broker about whether | 41 // CheckPathAccess requests a hint from the permission broker about whether |
42 // a later call to RequestPathAccess will be successful. It presumes that | 42 // a later call to RequestPathAccess will be successful. It presumes that |
43 // the |interface_id| value passed to RequestPathAccess will be | 43 // the |interface_id| value passed to RequestPathAccess will be |
44 // UsbDevicePermissionsData::ANY_INTERFACE). | 44 // UsbDevicePermissionsData::ANY_INTERFACE). |
45 virtual void CheckPathAccess(const std::string& path, | 45 virtual void CheckPathAccess(const std::string& path, |
46 const ResultCallback& callback) = 0; | 46 const ResultCallback& callback) = 0; |
47 | 47 |
48 // RequestPathAccess requests access to a single device node identified by | |
49 // |path|. If |interface_id| value is passed (different than | |
50 // UsbDevicePermissionData::ANY_INTERFACE), the request will check if a | |
51 // specific interface is claimed while requesting access. | |
52 // This allows devices with multiple interfaces to be accessed even if | |
53 // some of them are already claimed by kernel. | |
54 virtual void RequestPathAccess(const std::string& path, | |
55 int interface_id, | |
56 const ResultCallback& callback) = 0; | |
57 | |
58 // OpenPath requests that the permission broker open the device node | 48 // OpenPath requests that the permission broker open the device node |
59 // identified by |path| and return the resulting file descriptor. | 49 // identified by |path| and return the resulting file descriptor. |
60 virtual void OpenPath(const std::string& path, | 50 virtual void OpenPath(const std::string& path, |
61 const OpenPathCallback& callback) = 0; | 51 const OpenPathCallback& callback) = 0; |
62 | 52 |
63 // Requests the |port| be opened on the firewall for incoming TCP/IP | 53 // Requests the |port| be opened on the firewall for incoming TCP/IP |
64 // connections received on |interface| (an empty string indicates all | 54 // connections received on |interface| (an empty string indicates all |
65 // interfaces). An open pipe must be passed as |lifeline_fd| so that the | 55 // interfaces). An open pipe must be passed as |lifeline_fd| so that the |
66 // permission broker can monitor the lifetime of the calling process. | 56 // permission broker can monitor the lifetime of the calling process. |
67 virtual void RequestTcpPortAccess(uint16_t port, | 57 virtual void RequestTcpPortAccess(uint16_t port, |
(...skipping 27 matching lines...) Expand all Loading... |
95 protected: | 85 protected: |
96 PermissionBrokerClient(); | 86 PermissionBrokerClient(); |
97 | 87 |
98 private: | 88 private: |
99 DISALLOW_COPY_AND_ASSIGN(PermissionBrokerClient); | 89 DISALLOW_COPY_AND_ASSIGN(PermissionBrokerClient); |
100 }; | 90 }; |
101 | 91 |
102 } // namespace chromeos | 92 } // namespace chromeos |
103 | 93 |
104 #endif // CHROMEOS_DBUS_PERMISSION_BROKER_CLIENT_H_ | 94 #endif // CHROMEOS_DBUS_PERMISSION_BROKER_CLIENT_H_ |
OLD | NEW |