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 #ifndef DEVICE_SERIAL_SERIAL_IO_HANDLER_WIN_H_ | 5 #ifndef DEVICE_SERIAL_SERIAL_IO_HANDLER_WIN_H_ |
6 #define DEVICE_SERIAL_SERIAL_IO_HANDLER_WIN_H_ | 6 #define DEVICE_SERIAL_SERIAL_IO_HANDLER_WIN_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
11 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
12 #include "device/serial/serial_io_handler.h" | 12 #include "device/serial/serial_io_handler.h" |
13 | 13 |
14 namespace device { | 14 namespace device { |
15 | 15 |
16 class SerialIoHandlerWin : public SerialIoHandler, | 16 class SerialIoHandlerWin : public SerialIoHandler, |
17 public base::MessageLoopForIO::IOHandler { | 17 public base::MessageLoopForIO::IOHandler { |
18 protected: | 18 protected: |
19 // SerialIoHandler implementation. | 19 // SerialIoHandler implementation. |
20 void ReadImpl() override; | 20 void ReadImpl() override; |
21 void WriteImpl() override; | 21 void WriteImpl() override; |
22 void CancelReadImpl() override; | 22 void CancelReadImpl() override; |
23 void CancelWriteImpl() override; | 23 void CancelWriteImpl() override; |
24 bool ConfigurePortImpl() override; | 24 bool ConfigurePortImpl() override; |
25 bool Flush() const override; | 25 bool Flush() const override; |
26 serial::DeviceControlSignalsPtr GetControlSignals() const override; | 26 serial::DeviceControlSignalsPtr GetControlSignals() const override; |
27 bool SetControlSignals( | 27 bool SetControlSignals( |
28 const serial::HostControlSignals& control_signals) override; | 28 const serial::HostControlSignals& control_signals) override; |
29 serial::ConnectionInfoPtr GetPortInfo() const override; | 29 serial::ConnectionInfoPtr GetPortInfo() const override; |
| 30 bool SetBreak() override; |
| 31 bool ClearBreak() override; |
30 bool PostOpen() override; | 32 bool PostOpen() override; |
31 | 33 |
32 private: | 34 private: |
33 friend class SerialIoHandler; | 35 friend class SerialIoHandler; |
34 | 36 |
35 explicit SerialIoHandlerWin( | 37 explicit SerialIoHandlerWin( |
36 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, | 38 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, |
37 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner); | 39 scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner); |
38 ~SerialIoHandlerWin() override; | 40 ~SerialIoHandlerWin() override; |
39 | 41 |
(...skipping 18 matching lines...) Expand all Loading... |
58 // WaitCommEvent, as opposed to waiting on actual ReadFile completion | 60 // WaitCommEvent, as opposed to waiting on actual ReadFile completion |
59 // after a corresponding WaitCommEvent has completed. | 61 // after a corresponding WaitCommEvent has completed. |
60 bool is_comm_pending_; | 62 bool is_comm_pending_; |
61 | 63 |
62 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerWin); | 64 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerWin); |
63 }; | 65 }; |
64 | 66 |
65 } // namespace device | 67 } // namespace device |
66 | 68 |
67 #endif // DEVICE_SERIAL_SERIAL_IO_HANDLER_WIN_H_ | 69 #endif // DEVICE_SERIAL_SERIAL_IO_HANDLER_WIN_H_ |
OLD | NEW |