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

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

Issue 1964953002: Add rights for mapping buffer. Update (shared) buffer APIs. (Closed) Base URL: https://github.com/domokit/mojo.git@work787_edk_handle_14.4
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
« no previous file with comments | « no previous file | mojo/edk/system/core_test_base.cc » ('j') | mojo/public/c/system/handle.h » ('J')
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 a8c2007dba6610e83724ac33d49b944c38bcc29e..65eb0733836af90e4935dcda1261fbfd74421d1e 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -638,7 +638,7 @@ MojoResult Core::GetBufferInformation(MojoHandle buffer_handle,
uint32_t info_num_bytes) {
RefPtr<Dispatcher> dispatcher;
MojoResult result =
- GetDispatcherAndCheckRights(buffer_handle, MOJO_HANDLE_RIGHT_READ,
+ GetDispatcherAndCheckRights(buffer_handle, MOJO_HANDLE_RIGHT_GET_OPTIONS,
EntrypointClass::BUFFER, &dispatcher);
if (result != MOJO_RESULT_OK)
return result;
@@ -652,11 +652,13 @@ MojoResult Core::MapBuffer(MojoHandle buffer_handle,
UserPointer<void*> buffer,
MojoMapBufferFlags flags) {
RefPtr<Dispatcher> dispatcher;
- // TODO(vtl): Is this right? Or should there be a "map" right? Probably I need
- // to rethink rights for buffers.
- MojoResult result =
- GetDispatcherAndCheckRights(buffer_handle, MOJO_HANDLE_RIGHT_WRITE,
- EntrypointClass::BUFFER, &dispatcher);
+ // TODO(vtl): Currently we can only map read/write. So both
+ // |MOJO_HANDLE_RIGHT_MAP_READABLE| and |MOJO_HANDLE_RIGHT_MAP_WRITABLE| are
+ // required.
+ MojoResult result = GetDispatcherAndCheckRights(
+ buffer_handle,
+ MOJO_HANDLE_RIGHT_MAP_READABLE | MOJO_HANDLE_RIGHT_MAP_WRITABLE,
+ EntrypointClass::BUFFER, &dispatcher);
if (result != MOJO_RESULT_OK)
return result;
« no previous file with comments | « no previous file | mojo/edk/system/core_test_base.cc » ('j') | mojo/public/c/system/handle.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698