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

Unified Diff: ipc/ipc_channel_win.cc

Issue 564863003: IPC: Add more debug info. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « ipc/ipc_channel_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_win.cc
diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc
index eabf85e3e0fe0e2e0d68ec0bc5b563dad3b0e381..cff6cd4335686c09007f18ce054608729b0b6659 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;
}
« no previous file with comments | « ipc/ipc_channel_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698