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

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

Issue 2720873002: Implements JS bindings for mojo shared buffer. (Closed)
Patch Set: rebaseline2 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
index 8cddb115bec3e534445f178ef9bafefa5c1b989b..f06dc11939b90f6c1bec17ae4f74b19623573478 100644
--- a/third_party/WebKit/Source/core/mojo/Mojo.cpp
+++ b/third_party/WebKit/Source/core/mojo/Mojo.cpp
@@ -5,6 +5,7 @@
#include "core/mojo/Mojo.h"
#include "core/mojo/MojoCreateMessagePipeResult.h"
+#include "core/mojo/MojoCreateSharedBufferResult.h"
#include "core/mojo/MojoHandle.h"
namespace blink {
@@ -27,4 +28,18 @@ void Mojo::createMessagePipe(MojoCreateMessagePipeResult& resultDict) {
}
}
+// static
+void Mojo::createSharedBuffer(unsigned numBytes,
+ MojoCreateSharedBufferResult& resultDict) {
+ MojoCreateSharedBufferOptions* options = nullptr;
+ mojo::Handle handle;
+ MojoResult result =
+ MojoCreateSharedBuffer(options, numBytes, handle.mutable_value());
+
+ resultDict.setResult(result);
+ if (result == MOJO_RESULT_OK) {
+ resultDict.setHandle(MojoHandle::create(mojo::MakeScopedHandle(handle)));
+ }
+}
+
} // 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