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

Unified Diff: mojo/edk/embedder/embedder.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
« no previous file with comments | « no previous file | mojo/edk/system/core.h » ('j') | mojo/edk/system/handle_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/embedder.cc
diff --git a/mojo/edk/embedder/embedder.cc b/mojo/edk/embedder/embedder.cc
index ac2536209cb69dd3b020d9eb9886bc2e5e71e525..3724de1f1af7e3889bf286d81146ddeb8168b4a4 100644
--- a/mojo/edk/embedder/embedder.cc
+++ b/mojo/edk/embedder/embedder.cc
@@ -73,17 +73,20 @@ MojoResult PassWrappedPlatformHandle(MojoHandle platform_handle_wrapper_handle,
DCHECK(platform_handle);
DCHECK(internal::g_core);
- RefPtr<system::Dispatcher> dispatcher;
- MojoResult result = internal::g_core->GetDispatcher(
- platform_handle_wrapper_handle, &dispatcher);
+ system::Handle h;
+ MojoResult result =
+ internal::g_core->GetHandle(platform_handle_wrapper_handle, &h);
if (result != MOJO_RESULT_OK)
return result;
- if (dispatcher->GetType() != system::Dispatcher::Type::PLATFORM_HANDLE)
+ if (h.dispatcher->GetType() != system::Dispatcher::Type::PLATFORM_HANDLE)
return MOJO_RESULT_INVALID_ARGUMENT;
+ if (!h.has_all_rights(MOJO_HANDLE_RIGHT_READ | MOJO_HANDLE_RIGHT_WRITE))
+ return MOJO_RESULT_PERMISSION_DENIED;
+
*platform_handle =
- static_cast<system::PlatformHandleDispatcher*>(dispatcher.get())
+ static_cast<system::PlatformHandleDispatcher*>(h.dispatcher.get())
->PassPlatformHandle();
return MOJO_RESULT_OK;
}
« no previous file with comments | « no previous file | mojo/edk/system/core.h » ('j') | mojo/edk/system/handle_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698