summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_win.cc
diff options
context:
space:
mode:
authorrvargas <rvargas@chromium.org>2014-09-15 19:44:15 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-16 02:45:38 +0000
commit431ce7382e8cae58d1dfbdde7c5c8bdc27daee2b (patch)
treee096b607391592158f26da9eb56d1f29db8e70ca /ipc/ipc_channel_win.cc
parent6471a6bf42a061ebddf43665636e8f77c85c33b2 (diff)
downloadchromium_src-431ce7382e8cae58d1dfbdde7c5c8bdc27daee2b.zip
chromium_src-431ce7382e8cae58d1dfbdde7c5c8bdc27daee2b.tar.gz
chromium_src-431ce7382e8cae58d1dfbdde7c5c8bdc27daee2b.tar.bz2
IPC: Add more debug info.
We're still seeing crashes that appear to come from multiple simultaneous writes. Given that writing_ is false when we crash, but the operation matches the current thread, file handle and IPC Channel, it could be that for some reason a failed Write is still genarating a notification. So this CL stores two error codes (one for the current operation and another for a previous failure), and the write size. BUG=387876 R=cpu@chromium.org Review URL: https://codereview.chromium.org/564863003 Cr-Commit-Position: refs/heads/master@{#294993}
Diffstat (limited to 'ipc/ipc_channel_win.cc')
-rw-r--r--ipc/ipc_channel_win.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc
index eabf85e..cff6cd4 100644
--- a/ipc/ipc_channel_win.cc
+++ b/ipc/ipc_channel_win.cc
@@ -66,6 +66,9 @@ ChannelWin::ChannelWin(const IPC::ChannelHandle &channel_handle,
validate_client_(false),
writing_(false),
debug_flags_(0),
+ write_error_(0),
+ last_write_error_(0),
+ write_size_(0),
client_secret_(0),
weak_factory_(this) {
CreatePipe(channel_handle, mode);
@@ -439,14 +442,16 @@ bool ChannelWin::ProcessOutgoingMessages(
debug_flags_ |= WRITE_MSG;
CHECK(!writing_);
writing_ = true;
+ write_size_ = static_cast<uint32>(m->size());
+ write_error_ = 0;
BOOL ok = WriteFile(pipe_,
m->data(),
- static_cast<int>(m->size()),
- &bytes_written,
+ write_size_,
+ NULL,
&output_state_.context.overlapped);
if (!ok) {
- DWORD err = GetLastError();
- if (err == ERROR_IO_PENDING) {
+ write_error_ = GetLastError();
+ if (write_error_ == ERROR_IO_PENDING) {
output_state_.is_pending = true;
DVLOG(2) << "sent pending message @" << m << " on channel @" << this
@@ -455,7 +460,8 @@ bool ChannelWin::ProcessOutgoingMessages(
return true;
}
writing_ = false;
- LOG(ERROR) << "pipe error: " << err;
+ last_write_error_ = write_error_;
+ LOG(ERROR) << "pipe error: " << write_error_;
return false;
}