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

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

Issue 423373002: Convert SerialIoHandler to use buffer interfaces for I/O API methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@js-serial
Patch Set: rebase 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
Index: extensions/browser/api/serial/serial_connection.h
diff --git a/extensions/browser/api/serial/serial_connection.h b/extensions/browser/api/serial/serial_connection.h
index 0a00012666442816e5c0e2a41cb6b56d58bd7c93..638b89859cd5814155ba4f11201de6d85048b9c1 100644
--- a/extensions/browser/api/serial/serial_connection.h
+++ b/extensions/browser/api/serial/serial_connection.h
@@ -15,6 +15,7 @@
#include "extensions/browser/api/api_resource.h"
#include "extensions/browser/api/api_resource_manager.h"
#include "extensions/common/api/serial.h"
+#include "net/base/io_buffer.h"
using content::BrowserThread;
@@ -140,8 +141,7 @@ class SerialConnection : public ApiResource,
void OnSendTimeout();
// Receives read completion notification from the |io_handler_|.
- void OnAsyncReadComplete(const std::string& data,
- device::serial::ReceiveError error);
+ void OnAsyncReadComplete(int bytes_read, device::serial::ReceiveError error);
// Receives write completion notification from the |io_handler_|.
void OnAsyncWriteComplete(int bytes_sent, device::serial::SendError error);
@@ -185,6 +185,8 @@ class SerialConnection : public ApiResource,
// Send().
scoped_ptr<TimeoutTask> send_timeout_task_;
+ scoped_refptr<net::IOBuffer> receive_buffer_;
+
// Asynchronous I/O handler.
scoped_refptr<device::SerialIoHandler> io_handler_;
};

Powered by Google App Engine
This is Rietveld 408576698