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_POSIX_H_ | 5 #ifndef DEVICE_SERIAL_SERIAL_IO_HANDLER_POSIX_H_ |
6 #define DEVICE_SERIAL_SERIAL_IO_HANDLER_POSIX_H_ | 6 #define DEVICE_SERIAL_SERIAL_IO_HANDLER_POSIX_H_ |
7 | 7 |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "device/serial/serial_io_handler.h" | 9 #include "device/serial/serial_io_handler.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 virtual serial::DeviceControlSignalsPtr GetControlSignals() const OVERRIDE; | 22 virtual serial::DeviceControlSignalsPtr GetControlSignals() const OVERRIDE; |
23 virtual bool SetControlSignals( | 23 virtual bool SetControlSignals( |
24 const serial::HostControlSignals& control_signals) OVERRIDE; | 24 const serial::HostControlSignals& control_signals) OVERRIDE; |
25 virtual bool ConfigurePort(const serial::ConnectionOptions& options) OVERRIDE; | 25 virtual bool ConfigurePort(const serial::ConnectionOptions& options) OVERRIDE; |
26 virtual serial::ConnectionInfoPtr GetPortInfo() const OVERRIDE; | 26 virtual serial::ConnectionInfoPtr GetPortInfo() const OVERRIDE; |
27 virtual bool PostOpen() OVERRIDE; | 27 virtual bool PostOpen() OVERRIDE; |
28 | 28 |
29 private: | 29 private: |
30 friend class SerialIoHandler; | 30 friend class SerialIoHandler; |
31 | 31 |
32 SerialIoHandlerPosix(); | 32 SerialIoHandlerPosix( |
| 33 scoped_refptr<base::MessageLoopProxy> file_thread_message_loop); |
33 virtual ~SerialIoHandlerPosix(); | 34 virtual ~SerialIoHandlerPosix(); |
34 | 35 |
35 // base::MessageLoopForIO::Watcher implementation. | 36 // base::MessageLoopForIO::Watcher implementation. |
36 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; | 37 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; |
37 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; | 38 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; |
38 | 39 |
39 void EnsureWatchingReads(); | 40 void EnsureWatchingReads(); |
40 void EnsureWatchingWrites(); | 41 void EnsureWatchingWrites(); |
41 | 42 |
42 base::MessageLoopForIO::FileDescriptorWatcher file_read_watcher_; | 43 base::MessageLoopForIO::FileDescriptorWatcher file_read_watcher_; |
43 base::MessageLoopForIO::FileDescriptorWatcher file_write_watcher_; | 44 base::MessageLoopForIO::FileDescriptorWatcher file_write_watcher_; |
44 | 45 |
45 // Flags indicating if the message loop is watching the device for IO events. | 46 // Flags indicating if the message loop is watching the device for IO events. |
46 bool is_watching_reads_; | 47 bool is_watching_reads_; |
47 bool is_watching_writes_; | 48 bool is_watching_writes_; |
48 | 49 |
49 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerPosix); | 50 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerPosix); |
50 }; | 51 }; |
51 | 52 |
52 } // namespace device | 53 } // namespace device |
53 | 54 |
54 #endif // DEVICE_SERIAL_SERIAL_IO_HANDLER_POSIX_H_ | 55 #endif // DEVICE_SERIAL_SERIAL_IO_HANDLER_POSIX_H_ |
OLD | NEW |