Skip to content
Commit 2cdc96d6 authored by Yiren Wang's avatar Yiren Wang Committed by Chromium LUCI CQ
Browse files

Remove redundant OnMediaItemUIDestroyed() calls

Since MediaItemUIObserverSet::OnMediaItemUIDestroyed() already observes
for MediaItemUIView destruction and will stop observing MediaItemUIView,
the owner class of MediaItemUIObserverSet does not need to observe
OnMediaItemUIDestroyed() again.

Also fix MediaItemUIObserverSet::Observe() to remove any pre-existing
MediaItemUIView that has the same ID as observer before starting to
observe the new MediaItemUIView.

See if any of these fixes can stop the crashes.

Bug: 330171266
Change-Id: I3a8cc6ac1fd607c3b4d32f15bc145480a56ee0c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5403987


Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Commit-Queue: Yiren Wang <yrw@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1280471}
parent daf04a9a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment