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

Unified Diff: mojo/system/message_pipe_dispatcher.h

Issue 324783002: Mojo: Add a MojoCreateMessagePipeOptions struct parameter to MojoCreateMessagePipe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 6 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/entrypoints.cc ('k') | mojo/system/message_pipe_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/message_pipe_dispatcher.h
diff --git a/mojo/system/message_pipe_dispatcher.h b/mojo/system/message_pipe_dispatcher.h
index 72c5e1423c3bb213a2083dfffa67cc2234aacb3d..73e28ea31bca0291a3715c3b86d460e807bade8a 100644
--- a/mojo/system/message_pipe_dispatcher.h
+++ b/mojo/system/message_pipe_dispatcher.h
@@ -23,7 +23,22 @@ class MessagePipeDispatcherTransport;
// Mojo primitive |MojoCreateMessagePipe()|). This class is thread-safe.
class MOJO_SYSTEM_IMPL_EXPORT MessagePipeDispatcher : public Dispatcher {
public:
- MessagePipeDispatcher();
+ // The default options to use for |MojoCreateMessagePipe()|. (Real uses
+ // should obtain this via |ValidateCreateOptions()| with a null |in_options|;
+ // this is exposed directly for testing convenience.)
+ static const MojoCreateMessagePipeOptions kDefaultCreateOptions;
+
+ MessagePipeDispatcher(
+ const MojoCreateMessagePipeOptions& /*validated_options*/);
+
+ // Validates and/or sets default options for |MojoCreateMessagePipeOptions|.
+ // If non-null, |in_options| must point to a struct of at least
+ // |in_options->struct_size| bytes. |out_options| must point to a (current)
+ // |MojoCreateMessagePipeOptions| and will be entirely overwritten on success
+ // (it may be partly overwritten on failure).
+ static MojoResult ValidateCreateOptions(
+ const MojoCreateMessagePipeOptions* in_options,
+ MojoCreateMessagePipeOptions* out_options);
// Must be called before any other methods. (This method is not thread-safe.)
void Init(scoped_refptr<MessagePipe> message_pipe, unsigned port);
@@ -34,6 +49,8 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipeDispatcher : public Dispatcher {
// Creates a |MessagePipe| with a local endpoint (at port 0) and a proxy
// endpoint, and creates/initializes a |MessagePipeDispatcher| (attached to
// the message pipe, port 0).
+ // TODO(vtl): This currently uses |kDefaultCreateOptions|, which is okay since
+ // there aren't any options, but eventually options should be plumbed through.
static std::pair<scoped_refptr<MessagePipeDispatcher>,
scoped_refptr<MessagePipe> > CreateRemoteMessagePipe();
« no previous file with comments | « mojo/system/entrypoints.cc ('k') | mojo/system/message_pipe_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698