| 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
|
| index f06dc11939b90f6c1bec17ae4f74b19623573478..5e5d4f24b5f9e63e16c655ebf2882f08268f5116 100644
|
| --- a/third_party/WebKit/Source/core/mojo/Mojo.cpp
|
| +++ b/third_party/WebKit/Source/core/mojo/Mojo.cpp
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "core/mojo/Mojo.h"
|
|
|
| +#include "core/mojo/MojoCreateDataPipeOptions.h"
|
| +#include "core/mojo/MojoCreateDataPipeResult.h"
|
| #include "core/mojo/MojoCreateMessagePipeResult.h"
|
| #include "core/mojo/MojoCreateSharedBufferResult.h"
|
| #include "core/mojo/MojoHandle.h"
|
| @@ -29,6 +31,27 @@ void Mojo::createMessagePipe(MojoCreateMessagePipeResult& resultDict) {
|
| }
|
|
|
| // static
|
| +void Mojo::createDataPipe(const MojoCreateDataPipeOptions& optionsDict,
|
| + MojoCreateDataPipeResult& resultDict) {
|
| + ::MojoCreateDataPipeOptions options = {0};
|
| + options.struct_size = sizeof(options);
|
| + options.flags = MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE;
|
| + options.element_num_bytes = optionsDict.elementNumBytes();
|
| + options.capacity_num_bytes = optionsDict.capacityNumBytes();
|
| +
|
| + mojo::ScopedDataPipeProducerHandle producer;
|
| + mojo::ScopedDataPipeConsumerHandle consumer;
|
| + MojoResult result = mojo::CreateDataPipe(&options, &producer, &consumer);
|
| + resultDict.setResult(result);
|
| + if (result == MOJO_RESULT_OK) {
|
| + resultDict.setProducer(
|
| + MojoHandle::create(mojo::ScopedHandle::From(std::move(producer))));
|
| + resultDict.setConsumer(
|
| + MojoHandle::create(mojo::ScopedHandle::From(std::move(consumer))));
|
| + }
|
| +}
|
| +
|
| +// static
|
| void Mojo::createSharedBuffer(unsigned numBytes,
|
| MojoCreateSharedBufferResult& resultDict) {
|
| MojoCreateSharedBufferOptions* options = nullptr;
|
|
|