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

Unified Diff: mojo/public/cpp/system/core.h

Issue 328753003: Mojo: Plumb MojoCreateMessagePipeOptions through to the C++ wrappers. (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/public/cpp/bindings/tests/router_unittest.cc ('k') | mojo/public/cpp/system/tests/core_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/system/core.h
diff --git a/mojo/public/cpp/system/core.h b/mojo/public/cpp/system/core.h
index 8d97bf4aec08f4bf853fb3432580900dddf9ee49..2b1caa914a4b69770a9e632dbad6e01564bb5229 100644
--- a/mojo/public/cpp/system/core.h
+++ b/mojo/public/cpp/system/core.h
@@ -264,14 +264,14 @@ MOJO_COMPILE_ASSERT(sizeof(ScopedMessagePipeHandle) ==
sizeof(MessagePipeHandle),
bad_size_for_cpp_ScopedMessagePipeHandle);
-inline MojoResult CreateMessagePipe(ScopedMessagePipeHandle* message_pipe0,
+inline MojoResult CreateMessagePipe(const MojoCreateMessagePipeOptions* options,
+ ScopedMessagePipeHandle* message_pipe0,
ScopedMessagePipeHandle* message_pipe1) {
assert(message_pipe0);
assert(message_pipe1);
MessagePipeHandle handle0;
MessagePipeHandle handle1;
- // TODO(vtl): Add support for the options struct.
- MojoResult rv = MojoCreateMessagePipe(NULL,
+ MojoResult rv = MojoCreateMessagePipe(options,
handle0.mutable_value(),
handle1.mutable_value());
// Reset even on failure (reduces the chances that a "stale"/incorrect handle
@@ -309,6 +309,7 @@ inline MojoResult ReadMessageRaw(MessagePipeHandle message_pipe,
class MessagePipe {
public:
MessagePipe();
+ explicit MessagePipe(const MojoCreateMessagePipeOptions& options);
~MessagePipe();
ScopedMessagePipeHandle handle0;
@@ -316,7 +317,14 @@ class MessagePipe {
};
inline MessagePipe::MessagePipe() {
- MojoResult result MOJO_ALLOW_UNUSED = CreateMessagePipe(&handle0, &handle1);
+ MojoResult result MOJO_ALLOW_UNUSED =
+ CreateMessagePipe(NULL, &handle0, &handle1);
+ assert(result == MOJO_RESULT_OK);
+}
+
+inline MessagePipe::MessagePipe(const MojoCreateMessagePipeOptions& options) {
+ MojoResult result MOJO_ALLOW_UNUSED =
+ CreateMessagePipe(&options, &handle0, &handle1);
assert(result == MOJO_RESULT_OK);
}
« no previous file with comments | « mojo/public/cpp/bindings/tests/router_unittest.cc ('k') | mojo/public/cpp/system/tests/core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698