OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 }; | 136 }; |
137 | 137 |
138 // Handles a receive timeout. | 138 // Handles a receive timeout. |
139 void OnReceiveTimeout(); | 139 void OnReceiveTimeout(); |
140 | 140 |
141 // Handles a send timeout. | 141 // Handles a send timeout. |
142 void OnSendTimeout(); | 142 void OnSendTimeout(); |
143 | 143 |
144 // Receives read completion notification from the |io_handler_|. | 144 // Receives read completion notification from the |io_handler_|. |
145 void OnAsyncReadComplete(const std::string& data, | 145 void OnAsyncReadComplete(const std::string& data, |
146 api::serial::ReceiveError error); | 146 device::serial::ReceiveError error); |
147 | 147 |
148 // Receives write completion notification from the |io_handler_|. | 148 // Receives write completion notification from the |io_handler_|. |
149 void OnAsyncWriteComplete(int bytes_sent, api::serial::SendError error); | 149 void OnAsyncWriteComplete(int bytes_sent, device::serial::SendError error); |
150 | 150 |
151 // The pathname of the serial device. | 151 // The pathname of the serial device. |
152 std::string port_; | 152 std::string port_; |
153 | 153 |
154 // Flag indicating whether or not the connection should persist when | 154 // Flag indicating whether or not the connection should persist when |
155 // its host app is suspended. | 155 // its host app is suspended. |
156 bool persistent_; | 156 bool persistent_; |
157 | 157 |
158 // User-specified connection name. | 158 // User-specified connection name. |
159 std::string name_; | 159 std::string name_; |
(...skipping 26 matching lines...) Expand all Loading... |
186 // Write timeout closure. Reset on initialization and after every successful | 186 // Write timeout closure. Reset on initialization and after every successful |
187 // Send(). | 187 // Send(). |
188 scoped_ptr<TimeoutTask> send_timeout_task_; | 188 scoped_ptr<TimeoutTask> send_timeout_task_; |
189 | 189 |
190 // Asynchronous I/O handler. | 190 // Asynchronous I/O handler. |
191 scoped_refptr<SerialIoHandler> io_handler_; | 191 scoped_refptr<SerialIoHandler> io_handler_; |
192 }; | 192 }; |
193 | 193 |
194 } // namespace extensions | 194 } // namespace extensions |
195 | 195 |
| 196 namespace mojo { |
| 197 |
| 198 template <> |
| 199 class TypeConverter<device::serial::HostControlSignalsPtr, |
| 200 extensions::api::serial::HostControlSignals> { |
| 201 public: |
| 202 static device::serial::HostControlSignalsPtr ConvertFrom( |
| 203 const extensions::api::serial::HostControlSignals& input); |
| 204 }; |
| 205 |
| 206 template <> |
| 207 class TypeConverter<device::serial::ConnectionOptionsPtr, |
| 208 extensions::api::serial::ConnectionOptions> { |
| 209 public: |
| 210 static device::serial::ConnectionOptionsPtr ConvertFrom( |
| 211 const extensions::api::serial::ConnectionOptions& input); |
| 212 }; |
| 213 |
| 214 } // namespace mojo |
| 215 |
196 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ | 216 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_CONNECTION_H_ |
OLD | NEW |