OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "device/hid/hid_service_win.h" | 5 #include "device/hid/hid_service_win.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #define INITGUID | 9 #define INITGUID |
10 | 10 |
11 #include <dbt.h> | 11 #include <dbt.h> |
12 #include <setupapi.h> | 12 #include <setupapi.h> |
13 #include <stddef.h> | 13 #include <stddef.h> |
14 #include <winioctl.h> | 14 #include <winioctl.h> |
15 | 15 |
16 #include <utility> | 16 #include <utility> |
17 | 17 |
18 #include "base/bind.h" | 18 #include "base/bind.h" |
19 #include "base/files/file.h" | 19 #include "base/files/file.h" |
20 #include "base/location.h" | 20 #include "base/location.h" |
21 #include "base/memory/free_deleter.h" | 21 #include "base/memory/free_deleter.h" |
22 #include "base/single_thread_task_runner.h" | 22 #include "base/single_thread_task_runner.h" |
23 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
24 #include "base/strings/sys_string_conversions.h" | 24 #include "base/strings/sys_string_conversions.h" |
25 #include "base/thread_task_runner_handle.h" | |
26 #include "base/threading/thread_restrictions.h" | 25 #include "base/threading/thread_restrictions.h" |
| 26 #include "base/threading/thread_task_runner_handle.h" |
27 #include "components/device_event_log/device_event_log.h" | 27 #include "components/device_event_log/device_event_log.h" |
28 #include "device/hid/hid_connection_win.h" | 28 #include "device/hid/hid_connection_win.h" |
29 #include "device/hid/hid_device_info.h" | 29 #include "device/hid/hid_device_info.h" |
30 #include "net/base/io_buffer.h" | 30 #include "net/base/io_buffer.h" |
31 | 31 |
32 namespace device { | 32 namespace device { |
33 | 33 |
34 HidServiceWin::HidServiceWin( | 34 HidServiceWin::HidServiceWin( |
35 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) | 35 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) |
36 : file_task_runner_(file_task_runner), | 36 : file_task_runner_(file_task_runner), |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, | 294 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, |
295 FILE_FLAG_OVERLAPPED, NULL)); | 295 FILE_FLAG_OVERLAPPED, NULL)); |
296 if (!file.IsValid() && GetLastError() == ERROR_ACCESS_DENIED) { | 296 if (!file.IsValid() && GetLastError() == ERROR_ACCESS_DENIED) { |
297 file.Set(CreateFileA(device_path.c_str(), GENERIC_READ, FILE_SHARE_READ, | 297 file.Set(CreateFileA(device_path.c_str(), GENERIC_READ, FILE_SHARE_READ, |
298 NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL)); | 298 NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL)); |
299 } | 299 } |
300 return file; | 300 return file; |
301 } | 301 } |
302 | 302 |
303 } // namespace device | 303 } // namespace device |
OLD | NEW |