Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Unified Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 2346863004: Speculative fix for OnSwapCompositorFrame crasher. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698