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

Unified Diff: ipc/ipc_channel_win.cc

Issue 427693004: IPC: Add more debug logic (crash tracking) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 9741dda05a13750f486d21f792f0c4aa6b3b7f65..0dcde1746d2237b84f857734da08f2415573f82e 100644
--- a/ipc/ipc_channel_win.cc
+++ b/ipc/ipc_channel_win.cc
@@ -63,10 +63,11 @@ ChannelWin::ChannelWin(const IPC::ChannelHandle &channel_handle,
peer_pid_(base::kNullProcessId),
waiting_connect_(mode & MODE_SERVER_FLAG),
processing_incoming_(false),
- weak_factory_(this),
validate_client_(false),
+ writing_(false),
debug_flags_(0),
- client_secret_(0) {
+ client_secret_(0),
+ weak_factory_(this) {
CreatePipe(channel_handle, mode);
}
@@ -426,6 +427,8 @@ bool ChannelWin::ProcessOutgoingMessages(
Message* m = output_queue_.front();
DCHECK(m->size() <= INT_MAX);
debug_flags_ |= WRITE_MSG;
+ CHECK(!writing_);
+ writing_ = true;
BOOL ok = WriteFile(pipe_,
m->data(),
static_cast<int>(m->size()),
@@ -441,6 +444,7 @@ bool ChannelWin::ProcessOutgoingMessages(
cpu_(ooo_6.6-7.5) 2014/07/29 19:47:20 ERROR_IO_PENDING is the normal case, right? so wr
rvargas (doing something else) 2014/07/29 20:36:21 Because we are reusing the same overlapped structu
return true;
}
+ writing_ = false;
LOG(ERROR) << "pipe error: " << err;
return false;
}
@@ -498,6 +502,9 @@ void ChannelWin::OnIOCompleted(
ok = ProcessIncomingMessages();
} else {
DCHECK(context == &output_state_.context);
+ CHECK(writing_);
+ CHECK(output_state_.is_pending);
+ writing_ = false;
debug_flags_ |= WRITE_COMPLETED;
if (debug_flags_ & WAIT_FOR_WRITE) {
CHECK(!(debug_flags_ & WAIT_FOR_WRITE_COMPLETE));
« 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