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)); |