Chromium Code Reviews| Index: content/browser/frame_host/render_widget_host_view_guest.cc |
| diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc |
| index cdb2d1799beccd2d50f0f35f1589df85cae22850..3fd814852f9e1445ecc8af62fe82e213d3628bd5 100644 |
| --- a/content/browser/frame_host/render_widget_host_view_guest.cc |
| +++ b/content/browser/frame_host/render_widget_host_view_guest.cc |
| @@ -283,7 +283,7 @@ void RenderWidgetHostViewGuest::OnSwapCompositorFrame( |
| if (output_surface_id != last_output_surface_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_output_surface_id_ = output_surface_id; |
| current_surface_size_ = frame_size; |
| @@ -305,8 +305,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()) { |
|
Charlie Reis
2016/09/19 17:29:21
If the crash is actually a UaF on guest_, then nei
|
| + guest_->SetChildFrameSurface(surface_id_, frame_size, scale_factor, |
| + sequence); |
| + } |
| } |
| cc::SurfaceFactory::DrawCallback ack_callback = base::Bind( |