Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / device / hid / hid_connection_win.h
blob263897a7eef21f591081d9121115b1edb5ad6dd4
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.
5 #ifndef DEVICE_HID_HID_CONNECTION_WIN_H_
6 #define DEVICE_HID_HID_CONNECTION_WIN_H_
8 #include <windows.h>
10 #include <set>
12 #include "base/callback.h"
13 #include "base/memory/ref_counted.h"
14 #include "base/message_loop/message_loop.h"
15 #include "base/threading/thread_checker.h"
16 #include "device/hid/hid_connection.h"
17 #include "device/hid/hid_device_info.h"
19 namespace device {
21 struct PendingHidTransfer;
23 class HidConnectionWin : public HidConnection {
24 public:
25 explicit HidConnectionWin(const HidDeviceInfo& device_info);
27 bool available() const;
29 virtual void Read(scoped_refptr<net::IOBufferWithSize> buffer,
30 const IOCallback& callback) OVERRIDE;
31 virtual void Write(uint8_t report_id,
32 scoped_refptr<net::IOBufferWithSize> buffer,
33 const IOCallback& callback) OVERRIDE;
34 virtual void GetFeatureReport(uint8_t report_id,
35 scoped_refptr<net::IOBufferWithSize> buffer,
36 const IOCallback& callback) OVERRIDE;
37 virtual void SendFeatureReport(uint8_t report_id,
38 scoped_refptr<net::IOBufferWithSize> buffer,
39 const IOCallback& callback) OVERRIDE;
41 void OnTransferFinished(scoped_refptr<PendingHidTransfer> transfer);
42 void OnTransferCanceled(scoped_refptr<PendingHidTransfer> transfer);
44 private:
45 ~HidConnectionWin();
47 base::win::ScopedHandle file_;
48 std::set<scoped_refptr<PendingHidTransfer> > transfers_;
50 base::ThreadChecker thread_checker_;
52 DISALLOW_COPY_AND_ASSIGN(HidConnectionWin);
55 } // namespace device
57 #endif // DEVICE_HID_HID_CONNECTION_WIN_H_