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

Unified Diff: mojo/system/message_pipe.cc

Issue 265753006: Mojo: Factor MessageInTransit secondary buffer stuff out into a separate class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 6 years, 8 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 | « mojo/system/message_in_transit.cc ('k') | mojo/system/raw_channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/message_pipe.cc
diff --git a/mojo/system/message_pipe.cc b/mojo/system/message_pipe.cc
index e154064d7c257a7b411e9bf786b5d270deff4a81..e25ac1c3b3c50448752d0c0e4dfa38e822a0269b 100644
--- a/mojo/system/message_pipe.cc
+++ b/mojo/system/message_pipe.cc
@@ -72,14 +72,13 @@ MojoResult MessagePipe::WriteMessage(
std::vector<DispatcherTransport>* transports,
MojoWriteMessageFlags flags) {
DCHECK(port == 0 || port == 1);
- uint32_t num_handles =
- transports ? static_cast<uint32_t>(transports->size()) : 0;
return EnqueueMessageInternal(
GetPeerPort(port),
make_scoped_ptr(new MessageInTransit(
MessageInTransit::kTypeMessagePipeEndpoint,
MessageInTransit::kSubtypeMessagePipeEndpointData,
- num_bytes, num_handles, bytes)),
+ num_bytes,
+ bytes)),
transports);
}
@@ -226,9 +225,6 @@ MojoResult MessagePipe::EnqueueMessageInternal(
return result;
}
- if (message->has_dispatchers())
- DCHECK_EQ(message->dispatchers()->size(), message->num_handles());
-
// The endpoint's |EnqueueMessage()| may not report failure.
endpoints_[port]->EnqueueMessage(message.Pass());
return MOJO_RESULT_OK;
@@ -239,7 +235,6 @@ MojoResult MessagePipe::AttachTransportsNoLock(
MessageInTransit* message,
std::vector<DispatcherTransport>* transports) {
DCHECK(!message->has_dispatchers());
- DCHECK_EQ(transports->size(), message->num_handles());
// You're not allowed to send either handle to a message pipe over the message
// pipe, so check for this. (The case of trying to write a handle to itself is
« no previous file with comments | « mojo/system/message_in_transit.cc ('k') | mojo/system/raw_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698