summaryrefslogtreecommitdiffstats
path: root/mojo/system/channel.cc
diff options
context:
space:
mode:
Diffstat (limited to 'mojo/system/channel.cc')
-rw-r--r--mojo/system/channel.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/mojo/system/channel.cc b/mojo/system/channel.cc
index 1c5d336..804e4d7 100644
--- a/mojo/system/channel.cc
+++ b/mojo/system/channel.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/stringprintf.h"
+#include "mojo/system/message_pipe_endpoint.h"
namespace mojo {
namespace system {
@@ -70,6 +71,10 @@ void Channel::Shutdown() {
MessageInTransit::EndpointId Channel::AttachMessagePipeEndpoint(
scoped_refptr<MessagePipe> message_pipe, unsigned port) {
+ DCHECK(port == 0 || port == 1);
+ // Note: This assertion must *not* be done under |lock_|.
+ DCHECK_EQ(message_pipe->GetType(port), MessagePipeEndpoint::kTypeProxy);
+
MessageInTransit::EndpointId local_id;
{
base::AutoLock locker(lock_);