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

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

Issue 143883005: HID backend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hid-impl-base
Patch Set: Really fix tests for lack of testing hardware; adapt to ancient libudev in the cros distro Created 6 years, 10 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_HID_HID_CONNECTION_H_
6 #define DEVICE_HID_HID_CONNECTION_H_
7
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/threading/thread_checker.h"
11 #include "device/hid/hid_device_info.h"
12
13 namespace net {
14 class IOBuffer;
15 }
16
17 namespace device {
18
19 class HidConnection : public base::RefCountedThreadSafe<HidConnection> {
20 public:
21 typedef base::Callback<void(bool success, size_t size)> IOCallback;
22
23 virtual void Read(scoped_refptr<net::IOBuffer> buffer,
24 size_t size,
25 const IOCallback& callback) = 0;
26 virtual void Write(scoped_refptr<net::IOBuffer> buffer,
27 size_t size,
28 const IOCallback& callback) = 0;
29 virtual void GetFeatureReport(scoped_refptr<net::IOBuffer> buffer,
30 size_t size,
31 const IOCallback& callback) = 0;
32 virtual void SendFeatureReport(scoped_refptr<net::IOBuffer> buffer,
33 size_t size,
34 const IOCallback& callback) = 0;
35
36 const HidDeviceInfo& device_info() const;
37
38 protected:
39 friend class base::RefCountedThreadSafe<HidConnection>;
40 friend struct HidDeviceInfo;
41
42 HidConnection(HidDeviceInfo device_info);
43 virtual ~HidConnection();
44
45 const HidDeviceInfo device_info_;
46
47 base::ThreadChecker thread_checker_;
48
49 DISALLOW_COPY_AND_ASSIGN(HidConnection);
50 };
51
52 } // namespace device
53
54 #endif // DEVICE_HID_HID_CONNECTION_H_
OLDNEW
« no previous file with comments | « device/hid/hid.gyp ('k') | device/hid/hid_connection.cc » ('j') | device/hid/hid_service_mac.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698