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

Unified Diff: mojo/edk/test/mojo_test_base.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/test/mojo_test_base.h ('k') | mojo/public/c/system/buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/test/mojo_test_base.cc
diff --git a/mojo/edk/test/mojo_test_base.cc b/mojo/edk/test/mojo_test_base.cc
index 4b044f6334c9f0c1709738516e07c1b1c39f1e82..b9b68604ca155190771e0cb163b2c892836a82fe 100644
--- a/mojo/edk/test/mojo_test_base.cc
+++ b/mojo/edk/test/mojo_test_base.cc
@@ -224,10 +224,16 @@ MojoHandle MojoTestBase::CreateBuffer(uint64_t size) {
}
// static
-MojoHandle MojoTestBase::DuplicateBuffer(MojoHandle h) {
+MojoHandle MojoTestBase::DuplicateBuffer(MojoHandle h, bool read_only) {
MojoHandle new_handle;
+ MojoDuplicateBufferHandleOptions options = {
+ sizeof(MojoDuplicateBufferHandleOptions),
+ MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE
+ };
+ if (read_only)
+ options.flags |= MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_READ_ONLY;
EXPECT_EQ(MOJO_RESULT_OK,
- MojoDuplicateBufferHandle(h, nullptr, &new_handle));
+ MojoDuplicateBufferHandle(h, &options, &new_handle));
return new_handle;
}
« no previous file with comments | « mojo/edk/test/mojo_test_base.h ('k') | mojo/public/c/system/buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698