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

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

Issue 1946763002: EDK: Add MojoHandleRights to DispatcherTransport. (Closed) Base URL: https://github.com/domokit/mojo.git@work788_edk_handle_10
Patch Set: 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/dispatcher.h ('k') | mojo/edk/system/handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/dispatcher.cc
diff --git a/mojo/edk/system/dispatcher.cc b/mojo/edk/system/dispatcher.cc
index f143d5706cf734a8b414804ae6c0f8e059b0b0cf..8f6580102f9c507aae7f2eb6a7ebc89d0bdd7e39 100644
--- a/mojo/edk/system/dispatcher.cc
+++ b/mojo/edk/system/dispatcher.cc
@@ -8,6 +8,7 @@
#include "mojo/edk/system/configuration.h"
#include "mojo/edk/system/data_pipe_consumer_dispatcher.h"
#include "mojo/edk/system/data_pipe_producer_dispatcher.h"
+#include "mojo/edk/system/handle.h"
#include "mojo/edk/system/handle_transport.h"
#include "mojo/edk/system/message_pipe_dispatcher.h"
#include "mojo/edk/system/platform_handle_dispatcher.h"
@@ -24,8 +25,8 @@ namespace system {
namespace test {
// TODO(vtl): Maybe this should be defined in a test-only file instead.
-DispatcherTransport DispatcherTryStartTransport(Dispatcher* dispatcher) {
- return Dispatcher::HandleTableAccess::TryStartTransport(dispatcher);
+DispatcherTransport HandleTryStartTransport(const Handle& handle) {
+ return Dispatcher::HandleTableAccess::TryStartTransport(handle);
}
} // namespace test
@@ -34,18 +35,18 @@ DispatcherTransport DispatcherTryStartTransport(Dispatcher* dispatcher) {
// fact that we give up if |TryLock()| fails.
// static
DispatcherTransport Dispatcher::HandleTableAccess::TryStartTransport(
- Dispatcher* dispatcher) MOJO_NO_THREAD_SAFETY_ANALYSIS {
- DCHECK(dispatcher);
+ const Handle& handle) MOJO_NO_THREAD_SAFETY_ANALYSIS {
+ DCHECK(handle.dispatcher);
- if (!dispatcher->mutex_.TryLock())
+ if (!handle.dispatcher->mutex_.TryLock())
return DispatcherTransport();
// We shouldn't race with things that close dispatchers, since closing can
// only take place either under |handle_table_mutex_| or when the handle is
// marked as busy.
- DCHECK(!dispatcher->is_closed_);
+ DCHECK(!handle.dispatcher->is_closed_);
- return DispatcherTransport(dispatcher);
+ return DispatcherTransport(handle);
}
// static
« no previous file with comments | « mojo/edk/system/dispatcher.h ('k') | mojo/edk/system/handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698