Commit 4cc56e90 authored by Timothy Loh's avatar Timothy Loh Committed by Commit Bot

Handle null gained_active in GuestOsEngagementMetrics::OnWindowActivated

The OnWindowActivated observer method does not guarantee that the
|gained_active| argument is non-null, so GuestOsEngagementMetrics should
not assume this.

This is causing tast tests to fail when the PluginVm feature is enabled,
as the matcher used, IsPluginVmWindow(), doesn't null-check the window.
ARC is unaffected as IsArcAppWindow() does a null-check.

Bug: 990252
Change-Id: I4673e1c9fbbc8142057481d51567be0e5677656d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1859417Reviewed-by: default avatarNicholas Verne <nverne@chromium.org>
Commit-Queue: Timothy Loh <timloh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705476}
parent c08084ea
......@@ -98,7 +98,7 @@ void GuestOsEngagementMetrics::OnWindowActivated(
aura::Window* gained_active,
aura::Window* lost_active) {
UpdateEngagementTime();
matched_window_active_ = window_matcher_.Run(gained_active);
matched_window_active_ = gained_active && window_matcher_.Run(gained_active);
}
void GuestOsEngagementMetrics::OnSessionStateChanged() {
......
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