| Index: mojo/edk/system/message_pipe_dispatcher.cc
|
| diff --git a/mojo/edk/system/message_pipe_dispatcher.cc b/mojo/edk/system/message_pipe_dispatcher.cc
|
| index 826cf2695a72e6f631cb8e4fdb73e19392c1fb82..7db16e84dced5fe078fc059b6710d4f07007e0e1 100644
|
| --- a/mojo/edk/system/message_pipe_dispatcher.cc
|
| +++ b/mojo/edk/system/message_pipe_dispatcher.cc
|
| @@ -8,7 +8,7 @@
|
| #include "mojo/edk/system/channel.h"
|
| #include "mojo/edk/system/channel_endpoint.h"
|
| #include "mojo/edk/system/channel_endpoint_id.h"
|
| -#include "mojo/edk/system/configuration.h"
|
| +#include "mojo/edk/system/constants.h"
|
| #include "mojo/edk/system/local_message_pipe_endpoint.h"
|
| #include "mojo/edk/system/memory.h"
|
| #include "mojo/edk/system/message_pipe.h"
|
| @@ -173,17 +173,16 @@
|
| uint32_t num_bytes,
|
| std::vector<DispatcherTransport>* transports,
|
| MojoWriteMessageFlags flags) {
|
| - DCHECK(!transports ||
|
| - (transports->size() > 0 &&
|
| - transports->size() <= GetConfiguration().max_message_num_handles));
|
| -
|
| - lock().AssertAcquired();
|
| -
|
| - if (num_bytes > GetConfiguration().max_message_num_bytes)
|
| + DCHECK(!transports || (transports->size() > 0 &&
|
| + transports->size() <= kMaxMessageNumHandles));
|
| +
|
| + lock().AssertAcquired();
|
| +
|
| + if (num_bytes > kMaxMessageNumBytes)
|
| return MOJO_RESULT_RESOURCE_EXHAUSTED;
|
|
|
| - return message_pipe_->WriteMessage(port_, bytes, num_bytes, transports,
|
| - flags);
|
| + return message_pipe_->WriteMessage(
|
| + port_, bytes, num_bytes, transports, flags);
|
| }
|
|
|
| MojoResult MessagePipeDispatcher::ReadMessageImplNoLock(
|
| @@ -193,8 +192,8 @@
|
| uint32_t* num_dispatchers,
|
| MojoReadMessageFlags flags) {
|
| lock().AssertAcquired();
|
| - return message_pipe_->ReadMessage(port_, bytes, num_bytes, dispatchers,
|
| - num_dispatchers, flags);
|
| + return message_pipe_->ReadMessage(
|
| + port_, bytes, num_bytes, dispatchers, num_dispatchers, flags);
|
| }
|
|
|
| HandleSignalsState MessagePipeDispatcher::GetHandleSignalsStateImplNoLock()
|
| @@ -209,8 +208,8 @@
|
| uint32_t context,
|
| HandleSignalsState* signals_state) {
|
| lock().AssertAcquired();
|
| - return message_pipe_->AddWaiter(port_, waiter, signals, context,
|
| - signals_state);
|
| + return message_pipe_->AddWaiter(
|
| + port_, waiter, signals, context, signals_state);
|
| }
|
|
|
| void MessagePipeDispatcher::RemoveWaiterImplNoLock(
|
|
|