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

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

Issue 2001673003: EDK: Add Core::DuplicateHandleWithReducedRights(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
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 | « mojo/edk/system/core_unittest.cc ('k') | mojo/edk/system/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/dispatcher.h
diff --git a/mojo/edk/system/dispatcher.h b/mojo/edk/system/dispatcher.h
index 24a59203e6a5dd7336824e7945632d107e0ea913..db27ec879b5a7933ec8c92f3affc2f69636e59bd 100644
--- a/mojo/edk/system/dispatcher.h
+++ b/mojo/edk/system/dispatcher.h
@@ -98,7 +98,13 @@ class Dispatcher : public util::RefCountedThreadSafe<Dispatcher> {
// NOTE(vtl): This puts a big lock around each dispatcher (i.e., handle), and
// prevents the various |...ImplNoLock()|s from releasing the lock as soon as
// possible. If this becomes an issue, we can rethink this.
+
+ // No |EntrypointClass|:
+ // All dispatchers must support this.
MojoResult Close();
+ // This actually supports |MojoDuplicateHandle[WithReducedRights]()|; rights
+ // are handled by |Core|.
+ MojoResult DuplicateDispatcher(util::RefPtr<Dispatcher>* new_dispatcher);
// |EntrypointClass::MESSAGE_PIPE|:
// |transports| may be non-null if and only if there are handles to be
@@ -262,6 +268,12 @@ class Dispatcher : public util::RefCountedThreadSafe<Dispatcher> {
virtual void CancelAllAwakablesNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
virtual void CloseImplNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
+ // All dispatcher types whose handles may ever have the
+ // |MOJO_HANDLE_RIGHT_DUPLICATE| right must override this.
+ virtual MojoResult DuplicateDispatcherImplNoLock(
+ util::RefPtr<Dispatcher>* new_dispatcher)
+ MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
+
// This is called by |CreateEquivalentDispatcherAndCloseNoLock()|. It should
// "close" this dispatcher and return a new one equivalent to it. Note:
// Probably the first thing an implementation should do is call
« no previous file with comments | « mojo/edk/system/core_unittest.cc ('k') | mojo/edk/system/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698