OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/proxy_impl.h" | 5 #include "cc/trees/proxy_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 ProxyImpl::BlockedMainCommitOnly::BlockedMainCommitOnly() | 108 ProxyImpl::BlockedMainCommitOnly::BlockedMainCommitOnly() |
109 : layer_tree_host(nullptr) {} | 109 : layer_tree_host(nullptr) {} |
110 | 110 |
111 ProxyImpl::BlockedMainCommitOnly::~BlockedMainCommitOnly() {} | 111 ProxyImpl::BlockedMainCommitOnly::~BlockedMainCommitOnly() {} |
112 | 112 |
113 ProxyImpl::~ProxyImpl() { | 113 ProxyImpl::~ProxyImpl() { |
114 TRACE_EVENT0("cc", "ProxyImpl::~ProxyImpl"); | 114 TRACE_EVENT0("cc", "ProxyImpl::~ProxyImpl"); |
115 DCHECK(IsImplThread()); | 115 DCHECK(IsImplThread()); |
116 DCHECK(IsMainThreadBlocked()); | 116 DCHECK(IsMainThreadBlocked()); |
117 | 117 |
| 118 // Take away the OutputSurface before destroying things so it doesn't try |
| 119 // to call into its client mid-shutdown. |
| 120 layer_tree_host_impl_->ReleaseOutputSurface(); |
| 121 |
118 scheduler_ = nullptr; | 122 scheduler_ = nullptr; |
119 external_begin_frame_source_ = nullptr; | 123 external_begin_frame_source_ = nullptr; |
120 unthrottled_begin_frame_source_ = nullptr; | 124 unthrottled_begin_frame_source_ = nullptr; |
121 synthetic_begin_frame_source_ = nullptr; | 125 synthetic_begin_frame_source_ = nullptr; |
122 layer_tree_host_impl_ = nullptr; | 126 layer_tree_host_impl_ = nullptr; |
123 // We need to explicitly shutdown the notifier to destroy any weakptrs it is | 127 // We need to explicitly shutdown the notifier to destroy any weakptrs it is |
124 // holding while still on the compositor thread. This also ensures any | 128 // holding while still on the compositor thread. This also ensures any |
125 // callbacks holding a ProxyImpl pointer are cancelled. | 129 // callbacks holding a ProxyImpl pointer are cancelled. |
126 smoothness_priority_expiration_notifier_.Shutdown(); | 130 smoothness_priority_expiration_notifier_.Shutdown(); |
127 } | 131 } |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 bool ProxyImpl::IsMainThreadBlocked() const { | 679 bool ProxyImpl::IsMainThreadBlocked() const { |
676 return task_runner_provider_->IsMainThreadBlocked(); | 680 return task_runner_provider_->IsMainThreadBlocked(); |
677 } | 681 } |
678 | 682 |
679 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 683 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
680 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 684 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
681 return main_thread_blocked_commit_vars_unsafe_; | 685 return main_thread_blocked_commit_vars_unsafe_; |
682 } | 686 } |
683 | 687 |
684 } // namespace cc | 688 } // namespace cc |
OLD | NEW |