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

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

Issue 2875453002: Add a size parameter to SharedMemoryHandle. (Closed)
Patch Set: Remove extraneous period. Created 3 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
« no previous file with comments | « ipc/ipc_message_utils_unittest.cc ('k') | mojo/edk/system/platform_wrapper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/platform_shared_buffer.cc
diff --git a/mojo/edk/embedder/platform_shared_buffer.cc b/mojo/edk/embedder/platform_shared_buffer.cc
index 7548b4d9beffe26a43e905440382a908edc17a94..2087a2ca946aa216415849827a56204d2f461dab 100644
--- a/mojo/edk/embedder/platform_shared_buffer.cc
+++ b/mojo/edk/embedder/platform_shared_buffer.cc
@@ -236,13 +236,15 @@ bool PlatformSharedBuffer::InitFromPlatformHandle(
// TODO(rockot): Pass GUIDs through Mojo. https://crbug.com/713763.
base::UnguessableToken guid = base::UnguessableToken::Create();
#if defined(OS_WIN)
- base::SharedMemoryHandle handle(platform_handle.release().handle, guid);
+ base::SharedMemoryHandle handle(platform_handle.release().handle, num_bytes_,
+ guid);
#elif defined(OS_MACOSX) && !defined(OS_IOS)
base::SharedMemoryHandle handle = base::SharedMemoryHandle(
platform_handle.release().port, num_bytes_, guid);
#else
base::SharedMemoryHandle handle(
- base::FileDescriptor(platform_handle.release().handle, false), guid);
+ base::FileDescriptor(platform_handle.release().handle, false), num_bytes_,
+ guid);
#endif
shared_memory_.reset(new base::SharedMemory(handle, read_only_));
@@ -260,13 +262,17 @@ bool PlatformSharedBuffer::InitFromPlatformHandlePair(
// TODO(rockot): Pass GUIDs through Mojo. https://crbug.com/713763.
base::UnguessableToken guid = base::UnguessableToken::Create();
#if defined(OS_WIN)
- base::SharedMemoryHandle handle(rw_platform_handle.release().handle, guid);
- base::SharedMemoryHandle ro_handle(ro_platform_handle.release().handle, guid);
+ base::SharedMemoryHandle handle(rw_platform_handle.release().handle,
+ num_bytes_, guid);
+ base::SharedMemoryHandle ro_handle(ro_platform_handle.release().handle,
+ num_bytes_, guid);
#else // defined(OS_WIN)
base::SharedMemoryHandle handle(
- base::FileDescriptor(rw_platform_handle.release().handle, false), guid);
+ base::FileDescriptor(rw_platform_handle.release().handle, false),
+ num_bytes_, guid);
base::SharedMemoryHandle ro_handle(
- base::FileDescriptor(ro_platform_handle.release().handle, false), guid);
+ base::FileDescriptor(ro_platform_handle.release().handle, false),
+ num_bytes_, guid);
#endif // defined(OS_WIN)
DCHECK(!shared_memory_);
« no previous file with comments | « ipc/ipc_message_utils_unittest.cc ('k') | mojo/edk/system/platform_wrapper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698