| 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
|
|
|