Commit 8d53835d authored by liberato@chromium.org's avatar liberato@chromium.org Committed by Commit Bot

Don't remove CodecImages from the wrong CodecImageGroup.

MaybeRenderEarlyManager tried to remove images from the wrong codec
group in some cases, leaving the right group with a raw pointer to
the CodecImage, and no way to remove it.

This can be simplified, but this is a small text change to permit
merge back to beta.

Bug: 986783
Change-Id: I3643cd0b847250157b0ce2162c176f0113975bec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1801330Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696146}
parent db7ca126
......@@ -51,7 +51,13 @@ class GpuMaybeRenderEarlyImpl {
// adding a DestructionCB to CodecImage. However, since we use a weak ptr
// for the callback, it isn't safe. CodecImageGroup uses a strong ref.
DCHECK(std::find(images_.begin(), images_.end(), image) != images_.end());
image_group_->RemoveCodecImage(image);
// Remember that |image_group_| might not be the same one that |image|
// belongs to. So, we can't remove it. Instead, trust that the destruction
// cb will also be run.
// TODO(liberato): Simplify this. We don't need both callbacks. The
// destruction CB can be renamed to the unused cb, and CodecImageGroup can
// set it like it used to, and notify us about it. It would be called both
// on CodecImage destruction and (with pooling) when it's unused.
base::Erase(images_, image);
internal::MaybeRenderEarly(&images_);
}
......
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