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

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

Issue 873903002: Set serial connection parameters immediately on connect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a comment explaing the "set" notation. Created 5 years, 11 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 | « device/serial/test_serial_io_handler.cc ('k') | extensions/browser/api/serial/serial_connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/serial/serial_api.cc
diff --git a/extensions/browser/api/serial/serial_api.cc b/extensions/browser/api/serial/serial_api.cc
index 8910cc757a658b63b16ae9aaafe890b1d24128e5..d2eead810a58b0a7c21a6925c21aeb3777cc423c 100644
--- a/extensions/browser/api/serial/serial_api.cc
+++ b/extensions/browser/api/serial/serial_api.cc
@@ -130,18 +130,14 @@ bool SerialConnectFunction::Prepare() {
void SerialConnectFunction::AsyncWorkStart() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
connection_ = CreateSerialConnection(params_->path, extension_->id());
- connection_->Open(base::Bind(&SerialConnectFunction::OnConnected, this));
+ connection_->Open(*params_->options.get(),
+ base::Bind(&SerialConnectFunction::OnConnected, this));
}
void SerialConnectFunction::OnConnected(bool success) {
DCHECK(connection_);
- if (success) {
- if (!connection_->Configure(*params_->options.get())) {
- delete connection_;
- connection_ = NULL;
- }
- } else {
+ if (!success) {
delete connection_;
connection_ = NULL;
}
« no previous file with comments | « device/serial/test_serial_io_handler.cc ('k') | extensions/browser/api/serial/serial_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698