Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: device/usb/mojo/permission_provider.h

Issue 1847183002: Use interface associations to check function permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nit and fixed Windows build. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/usb/mojo/mock_permission_provider.cc ('k') | device/usb/mojo/type_converters.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_ 5 #ifndef DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_
6 #define DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_ 6 #define DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 namespace device { 10 namespace device {
11 namespace usb { 11 namespace usb {
12 12
13 class DeviceInfo; 13 class DeviceInfo;
14 14
15 // An implementation of this interface must be provided to a DeviceManager in 15 // An implementation of this interface must be provided to a DeviceManager in
16 // order to implement device permission checks. 16 // order to implement device permission checks.
17 class PermissionProvider { 17 class PermissionProvider {
18 public: 18 public:
19 PermissionProvider(); 19 PermissionProvider();
20 virtual ~PermissionProvider(); 20 virtual ~PermissionProvider();
21 21
22 virtual bool HasDevicePermission(const DeviceInfo& device_info) const = 0; 22 virtual bool HasDevicePermission(const DeviceInfo& device_info) const = 0;
23 virtual bool HasConfigurationPermission( 23 virtual bool HasConfigurationPermission(
24 uint8_t requested_configuration, 24 uint8_t requested_configuration,
25 const DeviceInfo& device_info) const = 0; 25 const DeviceInfo& device_info) const = 0;
26 virtual bool HasInterfacePermission(uint8_t requested_interface, 26 virtual bool HasFunctionPermission(uint8_t requested_function,
27 uint8_t configuration_value, 27 uint8_t configuration_value,
28 const DeviceInfo& device_info) const = 0; 28 const DeviceInfo& device_info) const = 0;
29 }; 29 };
30 30
31 } // namespace usb 31 } // namespace usb
32 } // namespace device 32 } // namespace device
33 33
34 #endif // DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_ 34 #endif // DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_
OLDNEW
« no previous file with comments | « device/usb/mojo/mock_permission_provider.cc ('k') | device/usb/mojo/type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698