Commit baede72c authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Mojo: Reject writes when ChannelWin IO fails

This is marginally better than what we're doing now, but more
importantly it satisfies a reasonable DCHECK that we currently
violate in these cases.

Bug: 829290
Change-Id: I68621d4f1c8f40c1b689d74e801c1cdb77e4663a
Reviewed-on: https://chromium-review.googlesource.com/997769Reviewed-by: default avatarWez <wez@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548463}
parent 986597ee
......@@ -175,10 +175,15 @@ class ChannelWin : public Channel,
DWORD bytes_transfered,
DWORD error) override {
if (error != ERROR_SUCCESS) {
if (context == &write_context_)
if (context == &write_context_) {
{
base::AutoLock lock(write_lock_);
reject_writes_ = true;
}
OnWriteError(Error::kDisconnected);
else
} else {
OnError(Error::kDisconnected);
}
} else if (context == &connect_context_) {
DCHECK(is_connect_pending_);
is_connect_pending_ = false;
......
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