diff options
author | reillyg <reillyg@chromium.org> | 2015-07-10 14:36:10 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-10 21:37:06 +0000 |
commit | e6aead1fa5623666c4e5cd78ce17e1935ee769b1 (patch) | |
tree | 3f5963630f62ab1136fb4a5dfb55e5a8fd695a40 /device/hid/hid_service_linux.h | |
parent | 047ad603c025597829bb6e0482752ad95b2e431c (diff) | |
download | chromium_src-e6aead1fa5623666c4e5cd78ce17e1935ee769b1.zip chromium_src-e6aead1fa5623666c4e5cd78ce17e1935ee769b1.tar.gz chromium_src-e6aead1fa5623666c4e5cd78ce17e1935ee769b1.tar.bz2 |
Use permission_broker's OpenPath method to open HID devices.
This new method allows Chrome to open device nodes without having to
chmod them to a group of which Chrome is a member and allows the
permission broker to set opens on the file descriptor before passing it
to Chrome. This is a win for security and future extensibility.
BUG=None
Review URL: https://codereview.chromium.org/1233753002
Cr-Commit-Position: refs/heads/master@{#338367}
Diffstat (limited to 'device/hid/hid_service_linux.h')
-rw-r--r-- | device/hid/hid_service_linux.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/device/hid/hid_service_linux.h b/device/hid/hid_service_linux.h index 3cb75c5..66cfbd3 100644 --- a/device/hid/hid_service_linux.h +++ b/device/hid/hid_service_linux.h @@ -11,6 +11,10 @@ #include "device/hid/hid_device_info.h" #include "device/hid/hid_service.h" +namespace dbus { +class FileDescriptor; +} + namespace device { class HidConnection; @@ -38,11 +42,15 @@ class HidServiceLinux : public HidService { // functions are static and the necessary parameters are passed as a single // struct. #if defined(OS_CHROMEOS) - static void OnRequestPathAccessComplete(scoped_ptr<ConnectParams> params, - bool success); -#endif // defined(OS_CHROMEOS) - static void OpenDevice(scoped_ptr<ConnectParams> params); - static void ConnectImpl(scoped_ptr<ConnectParams> params); + static void OnPathOpened(scoped_ptr<ConnectParams> params, + dbus::FileDescriptor fd); + static void ValidateFdOnBlockingThread(scoped_ptr<ConnectParams> params, + dbus::FileDescriptor fd); +#else + static void OpenOnBlockingThread(scoped_ptr<ConnectParams> params); +#endif + static void FinishOpen(scoped_ptr<ConnectParams> params); + static void CreateConnection(scoped_ptr<ConnectParams> params); scoped_refptr<base::SingleThreadTaskRunner> task_runner_; scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; |