Commit bfff126c authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Speculative fix for image annotator crash

The call to MaybeUpdateLayoutAndCheckValidity() could end up in a call
to OnImageRemoved(), which would remove the image from the map.

Bug: 1144269
Change-Id: I9d38f2db283b41ce25bc40e95f10156849ebd39e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2537571
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827290}
parent dd78a355
......@@ -271,14 +271,14 @@ SkBitmap AXImageAnnotator::GetImageData(const blink::WebAXObject& image) {
void AXImageAnnotator::OnImageAnnotated(
const blink::WebAXObject& image,
image_annotation::mojom::AnnotateImageResultPtr result) {
if (!base::Contains(image_annotations_, image.AxID()))
return;
if (!blink::WebAXObject::MaybeUpdateLayoutAndCheckValidity(
image.GetDocument())) {
return;
}
if (!base::Contains(image_annotations_, image.AxID()))
return;
if (image.IsDetached()) {
image_annotations_.at(image.AxID())
.set_status(ax::mojom::ImageAnnotationStatus::kIneligibleForAnnotation);
......
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