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

Unified Diff: device/serial/data_sink_receiver.cc

Issue 873293006: Revert of Remove Client= from device/serial/data_stream.mojom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/data_sink_receiver.h ('k') | device/serial/data_sink_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/data_sink_receiver.cc
diff --git a/device/serial/data_sink_receiver.cc b/device/serial/data_sink_receiver.cc
index 18dd5690775c2a724db19784fa8f6563d3d3b711..170f8b2c5b052e80d1c9be8a945a2d3492da3326 100644
--- a/device/serial/data_sink_receiver.cc
+++ b/device/serial/data_sink_receiver.cc
@@ -61,15 +61,10 @@
uint32_t offset_;
};
-DataSinkReceiver::DataSinkReceiver(
- mojo::InterfaceRequest<serial::DataSink> request,
- mojo::InterfacePtr<serial::DataSinkClient> client,
- const ReadyCallback& ready_callback,
- const CancelCallback& cancel_callback,
- const ErrorCallback& error_callback)
- : binding_(this, request.Pass()),
- client_(client.Pass()),
- ready_callback_(ready_callback),
+DataSinkReceiver::DataSinkReceiver(const ReadyCallback& ready_callback,
+ const CancelCallback& cancel_callback,
+ const ErrorCallback& error_callback)
+ : ready_callback_(ready_callback),
cancel_callback_(cancel_callback),
error_callback_(error_callback),
flush_pending_(false),
@@ -78,8 +73,6 @@
available_buffer_capacity_(0),
shut_down_(false),
weak_factory_(this) {
- binding_.set_error_handler(this);
- client_.set_error_handler(this);
}
void DataSinkReceiver::ShutDown() {
@@ -158,7 +151,7 @@
void DataSinkReceiver::Done(uint32_t bytes_read) {
if (!DoneInternal(bytes_read))
return;
- client_->ReportBytesSent(bytes_read);
+ client()->ReportBytesSent(bytes_read);
if (!pending_data_buffers_.empty()) {
base::MessageLoop::current()->PostTask(
FROM_HERE,
@@ -191,8 +184,9 @@
// When we encounter an error, we must discard the data from any send buffers
// transmitted by the DataSinkClient before it receives this error.
flush_pending_ = true;
- client_->ReportBytesSentAndError(
- bytes_read, error,
+ client()->ReportBytesSentAndError(
+ bytes_read,
+ error,
base::Bind(&DataSinkReceiver::DoFlush, weak_factory_.GetWeakPtr()));
}
« no previous file with comments | « device/serial/data_sink_receiver.h ('k') | device/serial/data_sink_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698