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

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

Issue 1957713003: EDK: Remove Core::GetDispatcher(). (Closed) Base URL: https://github.com/domokit/mojo.git@work789_edk_handle_table_14-x-work788_edk_handle_13.9-x-work787_edk_handle_13.8
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/system/core.cc
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc
index 59bd543bcede502c243c8f9d7f05bf366e1cb2e0..a3a2bcfa6215d4e7e4273afa5c103af6505870ff 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -105,15 +105,6 @@ MojoResult Core::GetHandle(MojoHandle handle, Handle* h) {
return handle_table_.GetHandle(handle, h);
}
-MojoResult Core::GetDispatcher(MojoHandle handle,
- RefPtr<Dispatcher>* dispatcher) {
- Handle h;
- MojoResult result = GetHandle(handle, &h);
- if (result == MOJO_RESULT_OK)
- *dispatcher = std::move(h.dispatcher);
- return result;
-}
-
MojoResult Core::GetAndRemoveDispatcher(MojoHandle handle,
RefPtr<Dispatcher>* dispatcher) {
if (handle == MOJO_HANDLE_INVALID)
@@ -140,7 +131,7 @@ MojoResult Core::GetDispatcherAndCheckRights(
if (result != MOJO_RESULT_OK)
return result;
- if ((h.rights & required_handle_rights) != required_handle_rights) {
+ if (!h.has_all_rights(required_handle_rights)) {
return h.dispatcher->SupportsEntrypointClass(entrypoint_class)
? MOJO_RESULT_PERMISSION_DENIED
: MOJO_RESULT_INVALID_ARGUMENT;
@@ -624,7 +615,7 @@ MojoResult Core::DuplicateBufferHandle(
if (result != MOJO_RESULT_OK)
return result;
- if (!(h.rights & MOJO_HANDLE_RIGHT_DUPLICATE)) {
+ if (!h.has_all_rights(MOJO_HANDLE_RIGHT_DUPLICATE)) {
return h.dispatcher->SupportsEntrypointClass(EntrypointClass::BUFFER)
? MOJO_RESULT_PERMISSION_DENIED
: MOJO_RESULT_INVALID_ARGUMENT;

Powered by Google App Engine
This is Rietveld 408576698