Commit e977efde authored by Sunny Sachanandani's avatar Sunny Sachanandani Committed by Commit Bot

viz: Fix presentation feedback frame token DCHECKs

Frame tokens are provided by the client and the only guarantee that's
enforced is that they're non-zero.  Therefore, we should not DCHECK
other invariants like not receiving two PresentationFeedbacks for the
same token.

Also add a deserialization error if the client sends a zero frame token
since we have DCHECKs for that anyway.

Bug: 958310
Change-Id: I4ffad483b46999c084f88ca62a0bb824522e6d37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594070Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658802}
parent 034ff717
......@@ -566,7 +566,6 @@ void CompositorFrameSinkSupport::DidPresentCompositorFrame(
uint32_t presentation_token,
const gfx::PresentationFeedback& feedback) {
DCHECK(presentation_token);
DCHECK(!presentation_feedbacks_.count(presentation_token));
presentation_feedbacks_.emplace(presentation_token, feedback);
UpdateNeedsBeginFramesInternal();
}
......
......@@ -28,11 +28,14 @@ bool StructTraits<viz::mojom::CompositorFrameMetadataDataView,
if (!data.ReadScrollableViewportSize(&out->scrollable_viewport_size))
return false;
if (data.frame_token() == 0u)
return false;
out->frame_token = data.frame_token();
out->may_contain_video = data.may_contain_video();
out->is_resourceless_software_draw_with_scroll_or_animation =
data.is_resourceless_software_draw_with_scroll_or_animation();
out->content_source_id = data.content_source_id();
out->frame_token = data.frame_token();
out->send_frame_token_to_embedder = data.send_frame_token_to_embedder();
out->root_background_color = data.root_background_color();
out->min_page_scale_factor = data.min_page_scale_factor();
......
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