| 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..ba707606e9fb665390f4b19970ad656f5850590f
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/mojo/Mojo.cpp
|
| @@ -0,0 +1,33 @@
|
| +// Copyright 2016 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 {
|
| +
|
| +Mojo* Mojo::create() {
|
| + return new Mojo();
|
| +}
|
| +
|
| +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
|
|
|