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

Unified Diff: mojo/edk/system/handle_transport.h

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/handle_table.cc ('k') | mojo/edk/system/ipc_support_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/handle_transport.h
diff --git a/mojo/edk/system/handle_transport.h b/mojo/edk/system/handle_transport.h
index eb60001a455ae6ceaf01036d6583c1918fc14383..9c8fc7b0d2235d0bea58c6495370f4d9353ad437 100644
--- a/mojo/edk/system/handle_transport.h
+++ b/mojo/edk/system/handle_transport.h
@@ -6,25 +6,30 @@
#define MOJO_EDK_SYSTEM_HANDLE_TRANSPORT_H_
#include "mojo/edk/system/dispatcher.h"
+#include "mojo/edk/system/handle.h"
#include "mojo/edk/util/ref_ptr.h"
#include "mojo/edk/util/thread_annotations.h"
+#include "mojo/public/c/system/handle.h"
namespace mojo {
namespace system {
class MessagePipe;
-// Wrapper around a |Dispatcher| pointer, while it's being processed to be
-// passed in a message pipe. See the comment about
-// |Dispatcher::HandleTableAccess| for more details.
+// Like |Handle|, but non-owning, for use while a handle is being processed to
+// be passed in a message pipe (note this is only *during* the "write message"
+// call). (I.e., this is a wrapper around a |Dispatcher*| and a
+// |MojoHandleRights|.) See the comment about |Dispatcher::HandleTableAccess|
+// for more details.
//
-// Note: This class is deliberately "thin" -- no more expensive than a
-// |Dispatcher*|.
+// Note: This class is deliberately "thin" -- no more expensive than a struct
+// containing a |Dispatcher*| and a |MojoHandleRights|.
//
-// TODO(vtl): Add handle rights to this, and rename it to HandleTransport.
+// TODO(vtl): Rename this class to HandleTransport.
class DispatcherTransport final {
public:
- DispatcherTransport() : dispatcher_(nullptr) {}
+ DispatcherTransport()
+ : dispatcher_(nullptr), rights_(MOJO_HANDLE_RIGHT_NONE) {}
void End() MOJO_NOT_THREAD_SAFE;
@@ -45,10 +50,11 @@ class DispatcherTransport final {
private:
friend class Dispatcher::HandleTableAccess;
- explicit DispatcherTransport(Dispatcher* dispatcher)
- : dispatcher_(dispatcher) {}
+ explicit DispatcherTransport(const Handle& handle)
+ : dispatcher_(handle.dispatcher.get()), rights_(handle.rights) {}
Dispatcher* dispatcher_;
+ MojoHandleRights rights_;
// Copy and assign allowed.
};
« no previous file with comments | « mojo/edk/system/handle_table.cc ('k') | mojo/edk/system/ipc_support_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698