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

Unified Diff: mojo/edk/system/channel.cc

Issue 741983003: Make ChannelEndpoint::OnReadMessage() take a MessageInTransit instead of a MessageInTransit::View. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | mojo/edk/system/channel_endpoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/channel.cc
diff --git a/mojo/edk/system/channel.cc b/mojo/edk/system/channel.cc
index 50d4b65b9b8131e4774971f14ec6b2769789686b..d678d0e83cdb7bdbf0787129e35dafcdc3890a03 100644
--- a/mojo/edk/system/channel.cc
+++ b/mojo/edk/system/channel.cc
@@ -7,7 +7,6 @@
#include <algorithm>
#include "base/bind.h"
-#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/strings/stringprintf.h"
@@ -331,7 +330,16 @@ void Channel::OnReadMessageForDownstream(
return;
}
- if (!endpoint->OnReadMessage(message_view, platform_handles.Pass())) {
+ scoped_ptr<MessageInTransit> message(new MessageInTransit(message_view));
+ if (message_view.transport_data_buffer_size() > 0) {
+ DCHECK(message_view.transport_data_buffer());
+ message->SetDispatchers(TransportData::DeserializeDispatchers(
+ message_view.transport_data_buffer(),
+ message_view.transport_data_buffer_size(), platform_handles.Pass(),
+ this));
+ }
+
+ if (!endpoint->OnReadMessage(message.Pass())) {
HandleLocalError(
base::StringPrintf("Failed to enqueue message to local ID %u",
static_cast<unsigned>(local_id.value())));
« no previous file with comments | « no previous file | mojo/edk/system/channel_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698