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

Side by Side Diff: device/hid/hid_connection_linux.h

Issue 825523003: Convert HidDeviceInfo from a struct to a refcounted class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef DEVICE_HID_HID_CONNECTION_LINUX_H_ 5 #ifndef DEVICE_HID_HID_CONNECTION_LINUX_H_
6 #define DEVICE_HID_HID_CONNECTION_LINUX_H_ 6 #define DEVICE_HID_HID_CONNECTION_LINUX_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/files/file.h" 10 #include "base/files/file.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "device/hid/hid_connection.h" 12 #include "device/hid/hid_connection.h"
13 13
14 namespace base { 14 namespace base {
15 class SingleThreadTaskRunner; 15 class SingleThreadTaskRunner;
16 } 16 }
17 17
18 namespace device { 18 namespace device {
19 19
20 class HidConnectionLinux : public HidConnection { 20 class HidConnectionLinux : public HidConnection {
21 public: 21 public:
22 HidConnectionLinux( 22 HidConnectionLinux(
23 const HidDeviceInfo& device_info, 23 scoped_refptr<HidDeviceInfo> device_info,
24 base::File device_file, 24 base::File device_file,
25 scoped_refptr<base::SingleThreadTaskRunner> file_thread_runner); 25 scoped_refptr<base::SingleThreadTaskRunner> file_thread_runner);
26 26
27 private: 27 private:
28 class Helper; 28 class Helper;
29 friend class Helper; 29 friend class Helper;
30 friend class base::RefCountedThreadSafe<HidConnectionLinux>; 30 friend class base::RefCountedThreadSafe<HidConnectionLinux>;
31 31
32 typedef base::Callback<void(ssize_t)> InternalWriteCallback; 32 typedef base::Callback<void(ssize_t)> InternalWriteCallback;
33 typedef base::Callback<void(int)> IoctlCallback; 33 typedef base::Callback<void(int)> IoctlCallback;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 std::queue<PendingHidRead> pending_reads_; 87 std::queue<PendingHidRead> pending_reads_;
88 88
89 base::WeakPtrFactory<HidConnectionLinux> weak_factory_; 89 base::WeakPtrFactory<HidConnectionLinux> weak_factory_;
90 90
91 DISALLOW_COPY_AND_ASSIGN(HidConnectionLinux); 91 DISALLOW_COPY_AND_ASSIGN(HidConnectionLinux);
92 }; 92 };
93 93
94 } // namespace device 94 } // namespace device
95 95
96 #endif // DEVICE_HID_HID_CONNECTION_LINUX_H_ 96 #endif // DEVICE_HID_HID_CONNECTION_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698