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

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

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/dispatcher.h ('k') | mojo/edk/system/dispatcher_unittest.cc » ('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 9d4d8db4fdfb0958780598ed8657816ad9334663..4900b0d6980ea6eaa8dbdd8fc6845430b782d648 100644
--- a/mojo/edk/system/dispatcher.cc
+++ b/mojo/edk/system/dispatcher.cc
@@ -108,6 +108,15 @@ MojoResult Dispatcher::Close() {
return MOJO_RESULT_OK;
}
+MojoResult Dispatcher::DuplicateDispatcher(
+ util::RefPtr<Dispatcher>* new_dispatcher) {
+ MutexLocker locker(&mutex_);
+ if (is_closed_)
+ return MOJO_RESULT_INVALID_ARGUMENT;
+
+ return DuplicateDispatcherImplNoLock(new_dispatcher);
+}
+
MojoResult Dispatcher::WriteMessage(UserPointer<const void> bytes,
uint32_t num_bytes,
std::vector<HandleTransport>* transports,
@@ -318,6 +327,17 @@ void Dispatcher::CloseImplNoLock() {
// any actual close-time cleanup necessary.
}
+MojoResult Dispatcher::DuplicateDispatcherImplNoLock(
+ util::RefPtr<Dispatcher>* new_dispatcher) {
+ mutex_.AssertHeld();
+ DCHECK(!is_closed_);
+ // By default, this is not supported. However, this should only be reachable
+ // if a handle has the |MOJO_HANDLE_RIGHT_DUPLICATE| right, which it should
+ // only have if it is supported.
+ NOTREACHED();
+ return MOJO_RESULT_INTERNAL;
+}
+
MojoResult Dispatcher::WriteMessageImplNoLock(
UserPointer<const void> /*bytes*/,
uint32_t /*num_bytes*/,
« no previous file with comments | « mojo/edk/system/dispatcher.h ('k') | mojo/edk/system/dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698