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

Unified Diff: mojo/system/proxy_message_pipe_endpoint.h

Issue 145483005: Mojo: More work towards sending message pipe handles over remote message pipes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: toned down comment Created 6 years, 11 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_pipe_dispatcher.cc ('k') | mojo/system/proxy_message_pipe_endpoint.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « mojo/system/message_pipe_dispatcher.cc ('k') | mojo/system/proxy_message_pipe_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698