| 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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 const std::string& owner_extension_id) | 161 const std::string& owner_extension_id) |
| 162 : ApiResource(owner_extension_id), | 162 : ApiResource(owner_extension_id), |
| 163 port_(port), | 163 port_(port), |
| 164 persistent_(false), | 164 persistent_(false), |
| 165 buffer_size_(kDefaultBufferSize), | 165 buffer_size_(kDefaultBufferSize), |
| 166 receive_timeout_(0), | 166 receive_timeout_(0), |
| 167 send_timeout_(0), | 167 send_timeout_(0), |
| 168 paused_(false), | 168 paused_(false), |
| 169 io_handler_(device::SerialIoHandler::Create( | 169 io_handler_(device::SerialIoHandler::Create( |
| 170 content::BrowserThread::GetTaskRunnerForThread( | 170 content::BrowserThread::GetTaskRunnerForThread( |
| 171 content::BrowserThread::FILE), | |
| 172 content::BrowserThread::GetTaskRunnerForThread( | |
| 173 content::BrowserThread::UI))) { | 171 content::BrowserThread::UI))) { |
| 174 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 172 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 175 } | 173 } |
| 176 | 174 |
| 177 SerialConnection::~SerialConnection() { | 175 SerialConnection::~SerialConnection() { |
| 178 io_handler_->CancelRead(device::serial::ReceiveError::DISCONNECTED); | 176 io_handler_->CancelRead(device::serial::ReceiveError::DISCONNECTED); |
| 179 io_handler_->CancelWrite(device::serial::SendError::DISCONNECTED); | 177 io_handler_->CancelWrite(device::serial::SendError::DISCONNECTED); |
| 180 } | 178 } |
| 181 | 179 |
| 182 bool SerialConnection::IsPersistent() const { | 180 bool SerialConnection::IsPersistent() const { |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit); | 411 output->parity_bit = extensions::ConvertParityBitToMojo(input.parity_bit); |
| 414 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits); | 412 output->stop_bits = extensions::ConvertStopBitsToMojo(input.stop_bits); |
| 415 if (input.cts_flow_control.get()) { | 413 if (input.cts_flow_control.get()) { |
| 416 output->has_cts_flow_control = true; | 414 output->has_cts_flow_control = true; |
| 417 output->cts_flow_control = *input.cts_flow_control; | 415 output->cts_flow_control = *input.cts_flow_control; |
| 418 } | 416 } |
| 419 return output; | 417 return output; |
| 420 } | 418 } |
| 421 | 419 |
| 422 } // namespace mojo | 420 } // namespace mojo |
| OLD | NEW |