| 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 EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ |
| 6 #define EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ | 6 #define EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 bool paused_; | 180 bool paused_; |
| 181 | 181 |
| 182 // Callback to handle the completion of a pending Receive() request. | 182 // Callback to handle the completion of a pending Receive() request. |
| 183 ReceiveCompleteCallback receive_complete_; | 183 ReceiveCompleteCallback receive_complete_; |
| 184 | 184 |
| 185 // Callback to handle the completion of a pending Send() request. | 185 // Callback to handle the completion of a pending Send() request. |
| 186 SendCompleteCallback send_complete_; | 186 SendCompleteCallback send_complete_; |
| 187 | 187 |
| 188 // Closure which will trigger a receive timeout unless cancelled. Reset on | 188 // Closure which will trigger a receive timeout unless cancelled. Reset on |
| 189 // initialization and after every successful Receive(). | 189 // initialization and after every successful Receive(). |
| 190 scoped_ptr<TimeoutTask> receive_timeout_task_; | 190 std::unique_ptr<TimeoutTask> receive_timeout_task_; |
| 191 | 191 |
| 192 // Write timeout closure. Reset on initialization and after every successful | 192 // Write timeout closure. Reset on initialization and after every successful |
| 193 // Send(). | 193 // Send(). |
| 194 scoped_ptr<TimeoutTask> send_timeout_task_; | 194 std::unique_ptr<TimeoutTask> send_timeout_task_; |
| 195 | 195 |
| 196 scoped_refptr<net::IOBuffer> receive_buffer_; | 196 scoped_refptr<net::IOBuffer> receive_buffer_; |
| 197 | 197 |
| 198 // Asynchronous I/O handler. | 198 // Asynchronous I/O handler. |
| 199 scoped_refptr<device::SerialIoHandler> io_handler_; | 199 scoped_refptr<device::SerialIoHandler> io_handler_; |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 } // namespace extensions | 202 } // namespace extensions |
| 203 | 203 |
| 204 namespace mojo { | 204 namespace mojo { |
| 205 | 205 |
| 206 template <> | 206 template <> |
| 207 struct TypeConverter<device::serial::HostControlSignalsPtr, | 207 struct TypeConverter<device::serial::HostControlSignalsPtr, |
| 208 extensions::api::serial::HostControlSignals> { | 208 extensions::api::serial::HostControlSignals> { |
| 209 static device::serial::HostControlSignalsPtr Convert( | 209 static device::serial::HostControlSignalsPtr Convert( |
| 210 const extensions::api::serial::HostControlSignals& input); | 210 const extensions::api::serial::HostControlSignals& input); |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 template <> | 213 template <> |
| 214 struct TypeConverter<device::serial::ConnectionOptionsPtr, | 214 struct TypeConverter<device::serial::ConnectionOptionsPtr, |
| 215 extensions::api::serial::ConnectionOptions> { | 215 extensions::api::serial::ConnectionOptions> { |
| 216 static device::serial::ConnectionOptionsPtr Convert( | 216 static device::serial::ConnectionOptionsPtr Convert( |
| 217 const extensions::api::serial::ConnectionOptions& input); | 217 const extensions::api::serial::ConnectionOptions& input); |
| 218 }; | 218 }; |
| 219 | 219 |
| 220 } // namespace mojo | 220 } // namespace mojo |
| 221 | 221 |
| 222 #endif // EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ | 222 #endif // EXTENSIONS_BROWSER_API_SERIAL_SERIAL_CONNECTION_H_ |
| OLD | NEW |