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 #include "extensions/browser/api/serial/serial_connection.h" | 5 #include "extensions/browser/api/serial/serial_connection.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 const std::string& owner_extension_id) | 197 const std::string& owner_extension_id) |
198 : ApiResource(owner_extension_id), | 198 : ApiResource(owner_extension_id), |
199 port_(port), | 199 port_(port), |
200 persistent_(false), | 200 persistent_(false), |
201 buffer_size_(kDefaultBufferSize), | 201 buffer_size_(kDefaultBufferSize), |
202 receive_timeout_(0), | 202 receive_timeout_(0), |
203 send_timeout_(0), | 203 send_timeout_(0), |
204 paused_(false), | 204 paused_(false), |
205 io_handler_(device::SerialIoHandler::Create( | 205 io_handler_(device::SerialIoHandler::Create( |
206 content::BrowserThread::GetMessageLoopProxyForThread( | 206 content::BrowserThread::GetMessageLoopProxyForThread( |
207 content::BrowserThread::FILE))) { | 207 content::BrowserThread::FILE), |
| 208 content::BrowserThread::GetMessageLoopProxyForThread( |
| 209 content::BrowserThread::UI))) { |
208 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 210 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
209 } | 211 } |
210 | 212 |
211 SerialConnection::~SerialConnection() { | 213 SerialConnection::~SerialConnection() { |
212 io_handler_->CancelRead(device::serial::RECEIVE_ERROR_DISCONNECTED); | 214 io_handler_->CancelRead(device::serial::RECEIVE_ERROR_DISCONNECTED); |
213 io_handler_->CancelWrite(device::serial::SEND_ERROR_DISCONNECTED); | 215 io_handler_->CancelWrite(device::serial::SEND_ERROR_DISCONNECTED); |
214 } | 216 } |
215 | 217 |
216 bool SerialConnection::IsPersistent() const { | 218 bool SerialConnection::IsPersistent() const { |
217 return persistent(); | 219 return persistent(); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit); | 430 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit); |
429 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits); | 431 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits); |
430 if (input.cts_flow_control.get()) { | 432 if (input.cts_flow_control.get()) { |
431 output->has_cts_flow_control = true; | 433 output->has_cts_flow_control = true; |
432 output->cts_flow_control = *input.cts_flow_control; | 434 output->cts_flow_control = *input.cts_flow_control; |
433 } | 435 } |
434 return output.Pass(); | 436 return output.Pass(); |
435 } | 437 } |
436 | 438 |
437 } // namespace mojo | 439 } // namespace mojo |
OLD | NEW |