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

Unified Diff: chromeos/binder/command_stream.cc

Issue 1575313002: Add CommandBroker::OnTransaction to handle incoming transactions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment Created 4 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 | « chromeos/binder/command_stream.h ('k') | chromeos/binder/command_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/binder/command_stream.cc
diff --git a/chromeos/binder/command_stream.cc b/chromeos/binder/command_stream.cc
index 947cf74598311b3e7c25795b52b8649a4284028d..ee55ba485965c68eb6ab3bd8319cf6221bc3af86 100644
--- a/chromeos/binder/command_stream.cc
+++ b/chromeos/binder/command_stream.cc
@@ -111,9 +111,20 @@ bool CommandStream::OnIncomingCommand(uint32_t command, BufferReader* reader) {
}
case BR_OK:
break;
- case BR_TRANSACTION:
- NOTIMPLEMENTED();
+ case BR_TRANSACTION: {
+ TransactionDataFromDriver data(
+ base::Bind(&CommandStream::FreeTransactionBuffer,
+ weak_ptr_factory_.GetWeakPtr()));
+ if (!reader->Read(data.mutable_data(), sizeof(*data.mutable_data()))) {
+ LOG(ERROR) << "Failed to read transaction data.";
+ return false;
+ }
+ if (!incoming_command_handler_->OnTransaction(data)) {
+ LOG(ERROR) << "Failed to handle transaction.";
+ return false;
+ }
break;
+ }
case BR_REPLY: {
scoped_ptr<TransactionDataFromDriver> data(new TransactionDataFromDriver(
base::Bind(&CommandStream::FreeTransactionBuffer,
« no previous file with comments | « chromeos/binder/command_stream.h ('k') | chromeos/binder/command_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698