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

Unified Diff: third_party/WebKit/Source/core/mojo/Mojo.cpp

Issue 2400563002: Adds Mojo IDL. (Closed)
Patch Set: uses WebTaskRunner Created 3 years, 10 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 | « third_party/WebKit/Source/core/mojo/Mojo.h ('k') | third_party/WebKit/Source/core/mojo/Mojo.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/mojo/Mojo.cpp
diff --git a/third_party/WebKit/Source/core/mojo/Mojo.cpp b/third_party/WebKit/Source/core/mojo/Mojo.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8cddb115bec3e534445f178ef9bafefa5c1b989b
--- /dev/null
+++ b/third_party/WebKit/Source/core/mojo/Mojo.cpp
@@ -0,0 +1,30 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/mojo/Mojo.h"
+
+#include "core/mojo/MojoCreateMessagePipeResult.h"
+#include "core/mojo/MojoHandle.h"
+
+namespace blink {
+
+// static
+void Mojo::createMessagePipe(MojoCreateMessagePipeResult& resultDict) {
+ MojoCreateMessagePipeOptions options = {0};
+ options.struct_size = sizeof(::MojoCreateMessagePipeOptions);
+ options.flags = MOJO_CREATE_MESSAGE_PIPE_OPTIONS_FLAG_NONE;
+
+ mojo::ScopedMessagePipeHandle handle0, handle1;
+ MojoResult result = mojo::CreateMessagePipe(&options, &handle0, &handle1);
+
+ resultDict.setResult(result);
+ if (result == MOJO_RESULT_OK) {
+ resultDict.setHandle0(
+ MojoHandle::create(mojo::ScopedHandle::From(std::move(handle0))));
+ resultDict.setHandle1(
+ MojoHandle::create(mojo::ScopedHandle::From(std::move(handle1))));
+ }
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/mojo/Mojo.h ('k') | third_party/WebKit/Source/core/mojo/Mojo.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698