Commit 45eb70f5 authored by Ken Rockot's avatar Ken Rockot

Mojo: Avoid inappropriate DCHECK when sending invalid handles

It should be safe to send invalid Windows HANDLE values over Mojo, as
we apparently have code relying on this already. Make sure we don't
hit a DCHECK in that case.

TBR=jcivelli@chromium.org

Bug: 859063
Change-Id: I8c9c0c3a31a5904b28a75b78ba74c22440afd83b
Reviewed-on: https://chromium-review.googlesource.com/1120430Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571493}
parent ee124a00
......@@ -59,8 +59,10 @@ class ChannelWin : public Channel,
// If we know the remote process handle, we transfer all outgoing handles
// to the process now rewriting them in the message.
std::vector<PlatformHandleInTransit> handles = message->TakeHandles();
for (auto& handle : handles)
handle.TransferToProcess(remote_process().Clone());
for (auto& handle : handles) {
if (handle.handle().is_valid())
handle.TransferToProcess(remote_process().Clone());
}
message->SetHandles(std::move(handles));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment