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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 504373002: Don't destroy RenderWidgetCompositor during DoDeferredClose (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
Index: cc/trees/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 12898df950658050255fc33a4667f3ac758d72f8..ef79496033773c29f4d3890a41cdd763e1a43d69 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -43,6 +43,7 @@ SingleThreadProxy::SingleThreadProxy(
defer_commits_(false),
commit_was_deferred_(false),
commit_requested_(false),
+ host_client_finished_(false),
weak_factory_(this) {
TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy");
DCHECK(Proxy::IsMainThread());
@@ -97,6 +98,11 @@ void SingleThreadProxy::SetLayerTreeHostClientReady() {
}
}
+void SingleThreadProxy::SetLayerTreeHostClientFinished() {
+ DCHECK(Proxy::IsMainThread());
+ host_client_finished_ = true;
+}
+
void SingleThreadProxy::SetVisible(bool visible) {
TRACE_EVENT0("cc", "SingleThreadProxy::SetVisible");
DebugScopedSetImplThread impl(this);
@@ -113,6 +119,12 @@ void SingleThreadProxy::CreateAndInitializeOutputSurface() {
DCHECK(Proxy::IsMainThread());
DCHECK(layer_tree_host_->output_surface_lost());
+ // TODO(enne): in the future this could get handled by asynchronous
+ // output surface creation where the host client could just decline
+ // to ever create a surface when shutting down.
+ if (host_client_finished_)
+ return;
+
scoped_ptr<OutputSurface> output_surface =
layer_tree_host_->CreateOutputSurface();

Powered by Google App Engine
This is Rietveld 408576698