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

Side by Side Diff: device/core/scoped_device_info_list.h

Issue 1439443002: Reland: Add code to deal with serial device disconnection detection on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved scoped device files to device core directory Created 5 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium 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
5 #ifndef DEVICE_CORE_SCOPED_DEVICE_INFO_LIST_H_
6 #define DEVICE_CORE_SCOPED_DEVICE_INFO_LIST_H_
7
8 #include <windows.h>
9 #include <setupapi.h>
10
11 #include "base/win/scoped_handle.h"
12
13 namespace base {
grt (UTC plus 2) 2015/11/13 19:40:04 this shouldn't be in base::win any longer.
juncai 2015/11/14 01:51:24 Done.
14 namespace win {
15
16 // Traits for HDEVINFO that properly destroys it.
17 struct DeviceInfoListTraits {
18 typedef HDEVINFO Handle;
19
20 static void CloseHandle(HDEVINFO handle) {
21 SetupDiDestroyDeviceInfoList(handle);
22 }
23
24 static bool IsHandleValid(HDEVINFO handle) {
25 return handle != INVALID_HANDLE_VALUE;
26 }
27
28 static HDEVINFO NullHandle() { return INVALID_HANDLE_VALUE; }
29 };
30
31 typedef base::win::GenericScopedHandle<DeviceInfoListTraits,
grt (UTC plus 2) 2015/11/13 19:40:04 i think base::ScopedGeneric is more appropriate th
juncai 2015/11/14 01:51:24 Done.
32 base::win::DummyVerifierTraits>
33 ScopedDeviceInfoList;
34
35 } // namespace win
36 } // namespace base
37
38 #endif // DEVICE_CORE_SCOPED_DEVICE_INFO_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698