Index: mojo/system/proxy_message_pipe_endpoint.h |
diff --git a/mojo/system/proxy_message_pipe_endpoint.h b/mojo/system/proxy_message_pipe_endpoint.h |
index 1956b077d0e7639cffa078786feb38e104f828f8..0036bc1f66863b665a73b423a95d245cbfa4819b 100644 |
--- a/mojo/system/proxy_message_pipe_endpoint.h |
+++ b/mojo/system/proxy_message_pipe_endpoint.h |
@@ -21,6 +21,7 @@ namespace mojo { |
namespace system { |
class Channel; |
+class MessagePipe; |
// A |ProxyMessagePipeEndpoint| connects an end of a |MessagePipe| to a |
// |Channel|, over which it transmits and receives data (to/from another |
@@ -54,6 +55,14 @@ class MOJO_SYSTEM_IMPL_EXPORT ProxyMessagePipeEndpoint |
virtual void Run(MessageInTransit::EndpointId remote_id) OVERRIDE; |
private: |
+ struct PreflightDispatcherInfo { |
+ PreflightDispatcherInfo() : message_pipe(), port() {} |
+ |
+ // For now, we only support sending message pipes, so this is simple. |
+ MessagePipe* message_pipe; |
+ unsigned port; |
+ }; |
+ |
bool is_attached() const { |
return !!channel_.get(); |
} |
@@ -62,9 +71,15 @@ class MOJO_SYSTEM_IMPL_EXPORT ProxyMessagePipeEndpoint |
return remote_id_ != MessageInTransit::kInvalidEndpointId; |
} |
- MojoResult CanEnqueueDispatchers(const std::vector<Dispatcher*>* dispatchers); |
+ // Checks that |dispatchers| will be able to be enqueued by |
+ // |EnqueueMessageInternal()| (which then MUST be called if this succeeds). |
+ // |dispatchers| must be non-null and nonempty; |preflight_dispatcher_infos| |
+ // must be non-null and empty. |
+ MojoResult PreflightDispatchers( |
+ const std::vector<Dispatcher*>* dispatchers, |
+ std::vector<PreflightDispatcherInfo>* preflight_dispatcher_infos); |
// |dispatchers| should be non-null only if it's nonempty, in which case the |
- // dispatchers should have been preflighted by |CanEnqueueDispatchers()|. |
+ // dispatchers should have been preflighted by |PreflightDispatchers()|. |
void EnqueueMessageInternal(MessageInTransit* message, |
const std::vector<Dispatcher*>* dispatchers); |