Commit f1137516 authored by John Bauman's avatar John Bauman Committed by Commit Bot

Add CHECK when removing SurfaceId from referenced_surfaces_

This surface ID should still be contained in referenced_surfaces_, but
there are crashes sometimes because the iterator from find is invalid.
Add CHECKs to see if we're attempting to remove the wrong surface id,
or if it's just not found in the structure.

Bug: 745684
Change-Id: Idf4a94f01e55ec20c51b6f72a4c7603c40226df6
Reviewed-on: https://chromium-review.googlesource.com/580404
Commit-Queue: John Bauman <jbauman@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488795}
parent 6c33b71d
......@@ -768,7 +768,12 @@ gfx::Rect SurfaceAggregator::PrewalkTree(const SurfaceId& surface_id,
}
}
referenced_surfaces_.erase(referenced_surfaces_.find(surface->surface_id()));
// TODO(jbauman): Remove when https://crbug.com/745684 fixed.
CHECK(surface->surface_id() == surface_id);
auto it = referenced_surfaces_.find(surface_id);
// TODO(jbauman): Remove when https://crbug.com/745684 fixed.
CHECK(referenced_surfaces_.end() != it);
referenced_surfaces_.erase(it);
if (!damage_rect.IsEmpty() && frame.metadata.may_contain_video)
result->may_contain_video = true;
return damage_rect;
......
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