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

Unified Diff: mojo/edk/system/core.cc

Issue 1689053003: Support read-only duplicates of Mojo shared buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-shm-interop
Patch Set: Rebase and fix comment. Created 4 years, 8 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 | « mojo/edk/system/broker_posix.cc ('k') | mojo/edk/system/data_pipe_consumer_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/core.cc
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc
index ca6105de0f2494c2f650c1eaa4dae0c1b4904cc8..b3602d7c5f4a166aee775a7edf0f5daaef43187c 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -160,7 +160,6 @@ MojoResult Core::CreateSharedBufferWrapper(
bool read_only,
MojoHandle* mojo_wrapper_handle) {
DCHECK(num_bytes);
- CHECK(!read_only);
scoped_refptr<PlatformSharedBuffer> platform_buffer =
PlatformSharedBuffer::CreateFromSharedMemoryHandle(num_bytes, read_only,
shared_memory_handle);
@@ -214,7 +213,7 @@ MojoResult Core::PassSharedMemoryHandle(
if (num_bytes)
*num_bytes = platform_shared_buffer->GetNumBytes();
if (read_only)
- *read_only = false;
+ *read_only = platform_shared_buffer->IsReadOnly();
*shared_memory_handle = platform_shared_buffer->DuplicateSharedMemoryHandle();
shm_dispatcher->Close();
« no previous file with comments | « mojo/edk/system/broker_posix.cc ('k') | mojo/edk/system/data_pipe_consumer_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698