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

Unified Diff: mojo/edk/embedder/platform_shared_buffer.h

Issue 1995753002: [mojo-edk] Expose portable API for platform handle wrapping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: mojo/edk/embedder/platform_shared_buffer.h
diff --git a/mojo/edk/embedder/platform_shared_buffer.h b/mojo/edk/embedder/platform_shared_buffer.h
index 45be7233c4f74c5d7e261ad4e058ef5b80b473da..8f0c420430b5b7531ed16fd17eff96708857142a 100644
--- a/mojo/edk/embedder/platform_shared_buffer.h
+++ b/mojo/edk/embedder/platform_shared_buffer.h
@@ -16,6 +16,7 @@
#include "base/synchronization/lock.h"
#include "mojo/edk/embedder/scoped_platform_handle.h"
#include "mojo/edk/system/system_impl_export.h"
+#include "mojo/public/c/system/types.h"
namespace mojo {
namespace edk {
@@ -61,6 +62,17 @@ class MOJO_SYSTEM_IMPL_EXPORT PlatformSharedBuffer
bool read_only,
base::SharedMemoryHandle handle);
+ // Returns a base::SharedMemoryHandle given a PlatformHandle and some
+ // associated settings.
+ static base::SharedMemoryHandle GetSharedMemoryHandleFromPlatformHandle(
+ MojoPlatformHandle platform_handle,
+ size_t size,
+ bool read_only);
+
+ // Returns a PlatformHandle from a given base::SharedMemoryHandle.
+ static PlatformHandle GetPlatformHandleFromSharedMemoryHandle(
+ base::SharedMemoryHandle memory_handle);
+
// Gets the size of shared buffer (in number of bytes).
size_t GetNumBytes() const;

Powered by Google App Engine
This is Rietveld 408576698