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

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

Issue 2008953003: [mojo-edk] Explicitly serialise HANDLEs into messages instead of PlatformHandles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cast2 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/node_channel.cc ('k') | mojo/edk/system/ports_message.h » ('j') | 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 822165a99756a4d26253d2bdd589a4b33a3fc1a0..44bcfc3d8318b3c6eecea1a3c33a556eb5baa36b 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -943,14 +943,15 @@ void NodeController::OnRelayPortsMessage(const ports::NodeName& from_node,
// 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;
+ ScopedPlatformHandleVectorPtr handles = message->TakeHandles();
+ for (size_t i = 0; i < handles->size(); ++i)
+ (*handles)[i].owning_process = from_process;
if (!Channel::Message::RewriteHandles(from_process,
base::GetCurrentProcessHandle(),
- message->handles(),
- message->num_handles())) {
+ handles.get())) {
DLOG(ERROR) << "Failed to relay one or more handles.";
}
+ message->SetHandles(std::move(handles));
#else
MachPortRelay* relay = GetMachPortRelay();
if (!relay) {
« no previous file with comments | « mojo/edk/system/node_channel.cc ('k') | mojo/edk/system/ports_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698