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

Unified Diff: mojo/system/core.cc

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/core.h ('k') | mojo/system/core_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/core.cc
diff --git a/mojo/system/core.cc b/mojo/system/core.cc
index 827d96a327b157168cb7dd0cd7d7defddb435de7..47ad0a492c46d5d000084383a68413b0ebf4a22d 100644
--- a/mojo/system/core.cc
+++ b/mojo/system/core.cc
@@ -138,15 +138,24 @@ MojoResult Core::WaitMany(const MojoHandle* handles,
return WaitManyInternal(handles, flags, num_handles, deadline);
}
-MojoResult Core::CreateMessagePipe(MojoHandle* message_pipe_handle0,
+MojoResult Core::CreateMessagePipe(const MojoCreateMessagePipeOptions* options,
+ MojoHandle* message_pipe_handle0,
MojoHandle* message_pipe_handle1) {
+ MojoCreateMessagePipeOptions validated_options = {};
+ // This will verify the |options| pointer.
+ MojoResult result = MessagePipeDispatcher::ValidateCreateOptions(
+ options, &validated_options);
+ if (result != MOJO_RESULT_OK)
+ return result;
if (!VerifyUserPointer<MojoHandle>(message_pipe_handle0))
return MOJO_RESULT_INVALID_ARGUMENT;
if (!VerifyUserPointer<MojoHandle>(message_pipe_handle1))
return MOJO_RESULT_INVALID_ARGUMENT;
- scoped_refptr<MessagePipeDispatcher> dispatcher0(new MessagePipeDispatcher());
- scoped_refptr<MessagePipeDispatcher> dispatcher1(new MessagePipeDispatcher());
+ scoped_refptr<MessagePipeDispatcher> dispatcher0(
+ new MessagePipeDispatcher(validated_options));
+ scoped_refptr<MessagePipeDispatcher> dispatcher1(
+ new MessagePipeDispatcher(validated_options));
std::pair<MojoHandle, MojoHandle> handle_pair;
{
« no previous file with comments | « mojo/system/core.h ('k') | mojo/system/core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698