}
bool Connector::Accept(Message* message) {
- MOJO_DCHECK(message_pipe_.is_valid());
+ MOJO_CHECK(message_pipe_.is_valid());
if (error_)
return false;
}
void Connector::OnHandleReady(MojoResult result) {
- MOJO_DCHECK(async_wait_id_ != 0);
+ MOJO_CHECK(async_wait_id_ != 0);
async_wait_id_ = 0;
if (result != MOJO_RESULT_OK) {
NotifyError();
}
void Connector::WaitToReadMore() {
- MOJO_DCHECK(!async_wait_id_);
+ MOJO_CHECK(!async_wait_id_);
async_wait_id_ = waiter_->AsyncWait(message_pipe_.get().value(),
MOJO_HANDLE_SIGNAL_READABLE,
MOJO_DEADLINE_INDEFINITE,
void Connector::NotifyError() {
error_ = true;
- // The error handler might destroyed |this|. Also, after an error, all method
- // should end early.
- if (destroyed_flag_) {
- *destroyed_flag_ = true; // Propagate flag.
- }
+ CancelWait();
if (error_handler_)
error_handler_->OnConnectionError();
}