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

Unified Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 1038133003: Fix crash in taking a screenshot of a closed popup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/renderer/gpu/render_widget_compositor.cc
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 56e655c833d3b50b91df83e730f706f82d5756d5..d06095ea44dbee673f3d56c3d4574b3063ad249d 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -798,9 +798,14 @@ void RenderWidgetCompositor::Layout() {
widget_->webwidget()->layout();
if (temporary_copy_output_request_) {
- DCHECK(layer_tree_host_->root_layer());
- layer_tree_host_->root_layer()->RequestCopyOfOutput(
- temporary_copy_output_request_.Pass());
+ // For WebViewImpl cases, this will always have a root layer.
+ // For other widgets, the widget may be closed before servicing this
+ // request, so ignore it.
+ if (cc::Layer* root_layer = layer_tree_host_->root_layer())
+ root_layer->RequestCopyOfOutput(temporary_copy_output_request_.Pass());
+ else
+ temporary_copy_output_request_->SendEmptyResult();
+ temporary_copy_output_request_ = nullptr;
piman 2015/03/26 23:09:58 nit: wrong indent, or did you forget brackets? (it
enne (OOO) 2015/03/27 17:40:52 Last minute edit; forgot brackets. <_< *blush*
}
}
« 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