Commit b4314c2c authored by Mounir Lamouri's avatar Mounir Lamouri Committed by Commit Bot

Media Controls: fix crash when actions and dismiss on oveflow are racing.

This doesn't fix the cause but only the crash because we will need to
send this to Beta. A proper fix will require some refactoring. It means
that M67 will probably have slightly different data for time to dismiss
and time to action.

Bug: 835748
Change-Id: Iec87eb0b05f07c54c3c292180a6a59a1aa35666d
Reviewed-on: https://chromium-review.googlesource.com/1034742Reviewed-by: default avatarBecca Hughes <beccahughes@chromium.org>
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554792}
parent aeef5e8b
......@@ -21,7 +21,11 @@ MediaControlOverflowMenuListElement::MediaControlOverflowMenuListElement(
void MediaControlOverflowMenuListElement::MaybeRecordTimeTaken(
TimeTakenHistogram histogram_name) {
DCHECK(time_shown_);
// TODO(mlamouri): we may end up hitting a race where both actions and dismiss
// are fired very close to eachother. This change is meant to prevent a crash
// but doesn't avoid the sometimes incorrect metrics recording.
if (!time_shown_)
return;
if (current_task_handle_.IsActive())
current_task_handle_.Cancel();
......
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