Commit e63faf3c authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Commit Bot

[CrOS MultiDevice] Update DCHECK() in AuthenticatedChannelImpl.

This DCHECK() asserted that a SecureChannel status change could only be
AUTHENTICATED => DISCONNECTING, AUTHENTICATED => DISCONNECTED, or
DISCONNECTING => DISCONNECTED.

However, AUTHENTICATING => AUTHENTICATED is also a valid status change,
so I added that to part of the DCHECK().

This issue was discovered when attempting to enable DCHECK()s by
default in accordance with the recent e-mail announcements.

Change-Id: Ia5126b70e25245f49d04939ae2e1e0bc0ea9315a
Reviewed-on: https://chromium-review.googlesource.com/c/1352996Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611928}
parent f3f08efd
......@@ -97,11 +97,14 @@ void AuthenticatedChannelImpl::OnSecureChannelStatusChanged(
const cryptauth::SecureChannel::Status& new_status) {
DCHECK_EQ(secure_channel_.get(), secure_channel);
// The only expected status changes are AUTHENTICATED => DISCONNECTING,
// AUTHENTICATED => DISCONNECTED, and DISCONNECTING => DISCONNECTED.
DCHECK(old_status == cryptauth::SecureChannel::Status::AUTHENTICATED ||
// The only expected status changes are AUTHENTICATING => AUTHENTICATED,
// AUTHENTICATED => DISCONNECTING, AUTHENTICATED => DISCONNECTED, and
// DISCONNECTING => DISCONNECTED.
DCHECK(old_status == cryptauth::SecureChannel::Status::AUTHENTICATING ||
old_status == cryptauth::SecureChannel::Status::AUTHENTICATED ||
old_status == cryptauth::SecureChannel::Status::DISCONNECTING);
DCHECK(new_status == cryptauth::SecureChannel::Status::DISCONNECTING ||
DCHECK(new_status == cryptauth::SecureChannel::Status::AUTHENTICATED ||
new_status == cryptauth::SecureChannel::Status::DISCONNECTING ||
new_status == cryptauth::SecureChannel::Status::DISCONNECTED);
if (new_status == cryptauth::SecureChannel::Status::DISCONNECTED)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment