Commit 23666b47 authored by Sarthak Shah's avatar Sarthak Shah Committed by Commit Bot

Fix a crash in RWHI

When tracing category "disabled-by-default-viz.surface_id_flow" is
enabled, if the value of local_surface_id_allocation is not set on
visual_properties via RenderWidgetHostImpl::GetVisualProperties,
tracing code throws an error resulting in crash.

This CL fixes this issue by returning default value for
LocalSurfaceIdAllocation if it is not set by
RenderWidgetHostImpl::GetVisualProperties.

Bug: 1022882
Change-Id: I45df560ff35d3f0c51f7c716a5f5fadfd50b5c51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1906940Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarDaniel Libby <dlibby@microsoft.com>
Commit-Queue: Sarthak Shah <sarsha@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#714627}
parent b21efacc
......@@ -949,11 +949,15 @@ bool RenderWidgetHostImpl::SynchronizeVisualProperties(
TRACE_EVENT_WITH_FLOW2(
TRACE_DISABLED_BY_DEFAULT("viz.surface_id_flow"),
"RenderWidgetHostImpl::SynchronizeVisualProperties send message",
visual_properties->local_surface_id_allocation->local_surface_id()
visual_properties->local_surface_id_allocation
.value_or(viz::LocalSurfaceIdAllocation())
.local_surface_id()
.submission_trace_id(),
TRACE_EVENT_FLAG_FLOW_OUT, "message",
"WidgetMsg_SynchronizeVisualProperties", "local_surface_id",
visual_properties->local_surface_id_allocation->local_surface_id()
visual_properties->local_surface_id_allocation
.value_or(viz::LocalSurfaceIdAllocation())
.local_surface_id()
.ToString());
visual_properties_ack_pending_ =
DoesVisualPropertiesNeedAck(old_visual_properties_, *visual_properties);
......
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