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(); |