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

Unified Diff: mojo/edk/system/node_channel.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: remove handles accessor 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
Index: mojo/edk/system/node_channel.cc
diff --git a/mojo/edk/system/node_channel.cc b/mojo/edk/system/node_channel.cc
index 25488602b203db4936c466f5da73d2282f900e13..95b7ebcff598aeba04fafcb83adb02ff454fdbb2 100644
--- a/mojo/edk/system/node_channel.cc
+++ b/mojo/edk/system/node_channel.cc
@@ -416,7 +416,7 @@ void NodeChannel::OnChannelMessage(const void* payload,
handle.owning_process = remote_process_handle_;
if (!Channel::Message::RewriteHandles(remote_process_handle_,
base::GetCurrentProcessHandle(),
- handles->data(), handles->size())) {
+ handles.get())) {
DLOG(ERROR) << "Received one or more invalid handles.";
}
} else if (handles) {
@@ -728,11 +728,12 @@ void NodeChannel::WriteChannelMessage(Channel::MessagePtr message) {
// Rewrite outgoing handles if we have a handle to the destination process.
if (remote_process_handle != base::kNullProcessHandle) {
+ ScopedPlatformHandleVectorPtr handles = message->TakeHandles();
if (!message->RewriteHandles(base::GetCurrentProcessHandle(),
Ken Rockot(use gerrit already) 2016/05/25 15:48:12 nit: While you're here please update this call sit
Anand Mistry (off Chromium) 2016/05/25 23:36:38 Done.
- remote_process_handle, message->handles(),
- message->num_handles())) {
+ remote_process_handle, handles.get())) {
DLOG(ERROR) << "Failed to duplicate one or more outgoing handles.";
}
+ message->SetHandles(std::move(handles));
}
}
#elif defined(OS_MACOSX) && !defined(OS_IOS)

Powered by Google App Engine
This is Rietveld 408576698