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

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

Issue 1914053003: [mojo-edk] Fix lifetime management of rewritten Windows HANDLEs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/node_channel.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/node_controller.cc
diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc
index 431547a49bf76014d3a20338b29fab7c32857d89..602dab4834c51266a7ae647d0cad759b18248e8a 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -911,6 +911,12 @@ void NodeController::OnRelayPortsMessage(const ports::NodeName& from_node,
// process before going out (see NodeChannel::WriteChannelMessage).
//
// TODO: We could avoid double-duplication.
+ //
+ // Note that we explicitly mark the handles as being owned by the sending
+ // process before rewriting them, in order to accommodate RewriteHandles'
+ // internal sanity checks.
+ for (size_t i = 0; i < message->num_handles(); ++i)
+ message->handles()[i].owning_process = from_process;
if (!Channel::Message::RewriteHandles(from_process,
base::GetCurrentProcessHandle(),
message->handles(),
« no previous file with comments | « mojo/edk/system/node_channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698