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 "device/serial/serial_io_handler.h" | 10 #include "device/serial/serial_io_handler.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 virtual serial::DeviceControlSignalsPtr GetControlSignals() const OVERRIDE; | 23 virtual serial::DeviceControlSignalsPtr GetControlSignals() const OVERRIDE; |
24 virtual bool SetControlSignals( | 24 virtual bool SetControlSignals( |
25 const serial::HostControlSignals& control_signals) OVERRIDE; | 25 const serial::HostControlSignals& control_signals) OVERRIDE; |
26 virtual bool ConfigurePort(const serial::ConnectionOptions& options) OVERRIDE; | 26 virtual bool ConfigurePort(const serial::ConnectionOptions& options) OVERRIDE; |
27 virtual serial::ConnectionInfoPtr GetPortInfo() const OVERRIDE; | 27 virtual serial::ConnectionInfoPtr GetPortInfo() const OVERRIDE; |
28 virtual bool PostOpen() OVERRIDE; | 28 virtual bool PostOpen() OVERRIDE; |
29 | 29 |
30 private: | 30 private: |
31 friend class SerialIoHandler; | 31 friend class SerialIoHandler; |
32 | 32 |
33 SerialIoHandlerWin(); | 33 explicit SerialIoHandlerWin( |
| 34 scoped_refptr<base::MessageLoopProxy> file_thread_message_loop); |
34 virtual ~SerialIoHandlerWin(); | 35 virtual ~SerialIoHandlerWin(); |
35 | 36 |
36 // base::MessageLoopForIO::IOHandler implementation. | 37 // base::MessageLoopForIO::IOHandler implementation. |
37 virtual void OnIOCompleted(base::MessageLoopForIO::IOContext* context, | 38 virtual void OnIOCompleted(base::MessageLoopForIO::IOContext* context, |
38 DWORD bytes_transfered, | 39 DWORD bytes_transfered, |
39 DWORD error) OVERRIDE; | 40 DWORD error) OVERRIDE; |
40 | 41 |
41 // Context used for asynchronous WaitCommEvent calls. | 42 // Context used for asynchronous WaitCommEvent calls. |
42 scoped_ptr<base::MessageLoopForIO::IOContext> comm_context_; | 43 scoped_ptr<base::MessageLoopForIO::IOContext> comm_context_; |
43 | 44 |
(...skipping 10 matching lines...) Expand all Loading... |
54 // WaitCommEvent, as opposed to waiting on actual ReadFile completion | 55 // WaitCommEvent, as opposed to waiting on actual ReadFile completion |
55 // after a corresponding WaitCommEvent has completed. | 56 // after a corresponding WaitCommEvent has completed. |
56 bool is_comm_pending_; | 57 bool is_comm_pending_; |
57 | 58 |
58 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerWin); | 59 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerWin); |
59 }; | 60 }; |
60 | 61 |
61 } // namespace device | 62 } // namespace device |
62 | 63 |
63 #endif // DEVICE_SERIAL_SERIAL_IO_HANDLER_WIN_H_ | 64 #endif // DEVICE_SERIAL_SERIAL_IO_HANDLER_WIN_H_ |
OLD | NEW |