| Index: mojo/edk/system/message_pipe.h
|
| diff --git a/mojo/edk/system/message_pipe.h b/mojo/edk/system/message_pipe.h
|
| index a52743de1523b731f952777a31d9f30bf8575800..b39e5170e7b1473444d0cc7199b27dc0e399a301 100644
|
| --- a/mojo/edk/system/message_pipe.h
|
| +++ b/mojo/edk/system/message_pipe.h
|
| @@ -5,6 +5,7 @@
|
| #ifndef MOJO_EDK_SYSTEM_MESSAGE_PIPE_H_
|
| #define MOJO_EDK_SYSTEM_MESSAGE_PIPE_H_
|
|
|
| +#include <stddef.h>
|
| #include <stdint.h>
|
|
|
| #include <vector>
|
| @@ -13,6 +14,7 @@
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/synchronization/lock.h"
|
| +#include "mojo/edk/embedder/platform_handle_vector.h"
|
| #include "mojo/edk/system/dispatcher.h"
|
| #include "mojo/edk/system/handle_signals_state.h"
|
| #include "mojo/edk/system/memory.h"
|
| @@ -25,6 +27,7 @@
|
| namespace mojo {
|
| namespace system {
|
|
|
| +class Channel;
|
| class ChannelEndpoint;
|
| class Waiter;
|
|
|
| @@ -55,6 +58,15 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipe
|
| // Gets the other port number (i.e., 0 -> 1, 1 -> 0).
|
| static unsigned GetPeerPort(unsigned port);
|
|
|
| + // Used by |MessagePipeDispatcher::Deserialize()|. Returns true on success (in
|
| + // which case, |*message_pipe|/|*port| are set appropriately) and false on
|
| + // failure (in which case |*message_pipe| may or may not be set to null).
|
| + static bool Deserialize(Channel* channel,
|
| + const void* source,
|
| + size_t size,
|
| + scoped_refptr<MessagePipe>* message_pipe,
|
| + unsigned* port);
|
| +
|
| // Gets the type of the endpoint (used for assertions, etc.).
|
| MessagePipeEndpoint::Type GetType(unsigned port);
|
|
|
| @@ -84,9 +96,18 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipe
|
| void RemoveWaiter(unsigned port,
|
| Waiter* waiter,
|
| HandleSignalsState* signals_state);
|
| -
|
| - // This is called by the dispatcher to convert a local endpoint to a proxy
|
| - // endpoint.
|
| + void StartSerialize(unsigned port,
|
| + Channel* channel,
|
| + size_t* max_size,
|
| + size_t* max_platform_handles);
|
| + bool EndSerialize(unsigned port,
|
| + Channel* channel,
|
| + void* destination,
|
| + size_t* actual_size,
|
| + embedder::PlatformHandleVector* platform_handles);
|
| +
|
| + // Used by |EndSerialize()|. TODO(vtl): Remove this (merge it into
|
| + // |EndSerialize()|).
|
| scoped_refptr<ChannelEndpoint> ConvertLocalToProxy(unsigned port);
|
|
|
| // This is used by |Channel| to enqueue messages (typically to a
|
|
|