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

Unified Diff: mojo/edk/system/shared_buffer_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/shared_buffer_dispatcher.h ('k') | mojo/edk/system/shared_buffer_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/shared_buffer_dispatcher.cc
diff --git a/mojo/edk/system/shared_buffer_dispatcher.cc b/mojo/edk/system/shared_buffer_dispatcher.cc
index 903d338c3fd1e92995c924aa82564e4ffb5a9fd2..af3ed3161d33acf6daa449ec86e727887a780c26 100644
--- a/mojo/edk/system/shared_buffer_dispatcher.cc
+++ b/mojo/edk/system/shared_buffer_dispatcher.cc
@@ -219,6 +219,15 @@ void SharedBufferDispatcher::CloseImplNoLock() {
shared_buffer_ = nullptr;
}
+MojoResult SharedBufferDispatcher::DuplicateDispatcherImplNoLock(
+ util::RefPtr<Dispatcher>* new_dispatcher) {
+ mutex().AssertHeld();
+
+ // Note: Since this is "duplicate", we keep our ref to |shared_buffer_|.
+ *new_dispatcher = CreateInternal(shared_buffer_.Clone());
+ return MOJO_RESULT_OK;
+}
+
RefPtr<Dispatcher>
SharedBufferDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock(
MessagePipe* /*message_pipe*/,
« no previous file with comments | « mojo/edk/system/shared_buffer_dispatcher.h ('k') | mojo/edk/system/shared_buffer_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698