Commit fb988852 authored by wjmaclean's avatar wjmaclean Committed by Commit bot

Speculative fix for OnSwapCompositorFrame crasher.

Speculative fix for crasher in RenderWidgetHostViewGuest::
OnSwapCompositorFrame(), in case it is caused by guest_ being null.

BUG=646736
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2346863004
Cr-Commit-Position: refs/heads/master@{#419586}
parent ef46c00e
......@@ -284,7 +284,7 @@ void RenderWidgetHostViewGuest::OnSwapCompositorFrame(
if (compositor_frame_sink_id != last_compositor_frame_sink_id_ ||
frame_size != current_surface_size_ ||
scale_factor != current_surface_scale_factor_ ||
guest_->has_attached_since_surface_set()) {
(guest_ && guest_->has_attached_since_surface_set())) {
ClearCompositorSurfaceIfNecessary();
last_compositor_frame_sink_id_ = compositor_frame_sink_id;
current_surface_size_ = frame_size;
......@@ -306,8 +306,14 @@ void RenderWidgetHostViewGuest::OnSwapCompositorFrame(
// SurfaceLayer.
cc::SurfaceManager* manager = GetSurfaceManager();
manager->GetSurfaceForId(surface_id_)->AddDestructionDependency(sequence);
guest_->SetChildFrameSurface(surface_id_, frame_size, scale_factor,
sequence);
// TODO(wjmaclean): I'm not sure what it means to create a surface id
// without setting it on the child, though since we will in this case be
// guaranteed to call ClearCompositorSurfaceIfNecessary() below, I suspect
// skipping SetChildFrameSurface() here is irrelevant.
if (guest_ && !guest_->is_in_destruction()) {
guest_->SetChildFrameSurface(surface_id_, frame_size, scale_factor,
sequence);
}
}
cc::SurfaceFactory::DrawCallback ack_callback = base::Bind(
......
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