Commit 5325997f authored by oka@chromium.org's avatar oka@chromium.org Committed by Commit Bot

Make unexpected VK state transition cause crash to help debug

Bug: 719905
Test: try
Change-Id: I58915c60e7ca582bae77a19e54b9ba5ac6fadf84
Reviewed-on: https://chromium-review.googlesource.com/558165
Commit-Queue: Keigo Oka <oka@chromium.org>
Reviewed-by: default avatarYuichiro Hanada <yhanada@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487406}
parent 471dee5c
......@@ -729,13 +729,6 @@ void KeyboardController::CheckStateTransition(KeyboardControllerState prev,
error_message << "Unexpected transition";
// TODO(oka): Add more condition check.
// Emit log on release build too for debug.
// TODO(oka): Change this to DLOG_IF once enough data is collected.
LOG_IF(ERROR, !error_message.str().empty())
<< "State: " << StateToStr(prev) << " -> " << StateToStr(next) << " "
<< error_message.str()
<< " stack trace: " << base::debug::StackTrace(10).ToString();
// Emit UMA
const int transition_record =
(valid_transition ? 1 : -1) *
......@@ -744,6 +737,13 @@ void KeyboardController::CheckStateTransition(KeyboardControllerState prev,
transition_record);
UMA_HISTOGRAM_BOOLEAN("VirtualKeyboard.ControllerStateTransitionIsValid",
transition_record > 0);
// Crash on release build too for debug.
// TODO(oka): Change this to DCHECK once enough data is collected.
CHECK(error_message.str().empty())
<< "State: " << StateToStr(prev) << " -> " << StateToStr(next) << " "
<< error_message.str()
<< " stack trace: " << base::debug::StackTrace(10).ToString();
}
void KeyboardController::ChangeState(KeyboardControllerState state) {
......
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