Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: extensions/browser/api/serial/serial_connection.cc

Issue 646053002: Implement permission_broker for serial devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix device_unittests. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/serial/test_serial_io_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « device/serial/test_serial_io_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698