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

Unified Diff: extensions/browser/api/serial/serial_connection.cc

Issue 401563002: Add a partial Mojo serial connection interface and implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/api/serial/serial_apitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/serial/serial_connection.cc
diff --git a/extensions/browser/api/serial/serial_connection.cc b/extensions/browser/api/serial/serial_connection.cc
index 9b995866656ed890a10c903e2dab710a2a2c9e58..3653597affea6a179cf88cde4361e6b4fe69f965 100644
--- a/extensions/browser/api/serial/serial_connection.cc
+++ b/extensions/browser/api/serial/serial_connection.cc
@@ -155,13 +155,13 @@ SerialConnection::SerialConnection(const std::string& port,
receive_timeout_(0),
send_timeout_(0),
paused_(false),
- io_handler_(device::SerialIoHandler::Create()) {
+ io_handler_(device::SerialIoHandler::Create(
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::FILE))) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
io_handler_->Initialize(
base::Bind(&SerialConnection::OnAsyncReadComplete, AsWeakPtr()),
- base::Bind(&SerialConnection::OnAsyncWriteComplete, AsWeakPtr()),
- content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::FILE));
+ base::Bind(&SerialConnection::OnAsyncWriteComplete, AsWeakPtr()));
}
SerialConnection::~SerialConnection() {
@@ -252,9 +252,7 @@ void SerialConnection::SetIoHandlerForTest(
io_handler_ = handler;
io_handler_->Initialize(
base::Bind(&SerialConnection::OnAsyncReadComplete, AsWeakPtr()),
- base::Bind(&SerialConnection::OnAsyncWriteComplete, AsWeakPtr()),
- content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::FILE));
+ base::Bind(&SerialConnection::OnAsyncWriteComplete, AsWeakPtr()));
}
bool SerialConnection::GetInfo(core_api::serial::ConnectionInfo* info) const {
« no previous file with comments | « extensions/browser/api/serial/serial_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698