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..044ba949480b6483c81af940ed3a1ca61d87a270 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())) { |
kenrb
2016/09/16 13:37:31
Would it make more sense to test guest_ at the beg
wjmaclean
2016/09/16 13:47:23
I wondered about that, but the comment at the end
|
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_->SetChildFrameSurface(surface_id_, frame_size, scale_factor, |
+ sequence); |
+ } |
} |
cc::SurfaceFactory::DrawCallback ack_callback = base::Bind( |