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 #ifndef CC_TREES_PROXY_IMPL_H_ | 5 #ifndef CC_TREES_PROXY_IMPL_H_ |
6 #define CC_TREES_PROXY_IMPL_H_ | 6 #define CC_TREES_PROXY_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 public: | 27 public: |
28 ProxyImpl(base::WeakPtr<ProxyMain> proxy_main_weak_ptr, | 28 ProxyImpl(base::WeakPtr<ProxyMain> proxy_main_weak_ptr, |
29 LayerTreeHost* layer_tree_host, | 29 LayerTreeHost* layer_tree_host, |
30 TaskRunnerProvider* task_runner_provider); | 30 TaskRunnerProvider* task_runner_provider); |
31 ~ProxyImpl() override; | 31 ~ProxyImpl() override; |
32 | 32 |
33 void UpdateBrowserControlsStateOnImpl(BrowserControlsState constraints, | 33 void UpdateBrowserControlsStateOnImpl(BrowserControlsState constraints, |
34 BrowserControlsState current, | 34 BrowserControlsState current, |
35 bool animate); | 35 bool animate); |
36 void InitializeCompositorFrameSinkOnImpl( | 36 void InitializeCompositorFrameSinkOnImpl( |
37 CompositorFrameSink* compositor_frame_sink); | 37 CompositorFrameSink* compositor_frame_sink, |
| 38 base::WeakPtr<ProxyMain> compositor_frame_sink_weak_ptr); |
38 void InitializeMutatorOnImpl(std::unique_ptr<LayerTreeMutator> mutator); | 39 void InitializeMutatorOnImpl(std::unique_ptr<LayerTreeMutator> mutator); |
39 void MainThreadHasStoppedFlingingOnImpl(); | 40 void MainThreadHasStoppedFlingingOnImpl(); |
40 void SetInputThrottledUntilCommitOnImpl(bool is_throttled); | 41 void SetInputThrottledUntilCommitOnImpl(bool is_throttled); |
41 void SetDeferCommitsOnImpl(bool defer_commits) const; | 42 void SetDeferCommitsOnImpl(bool defer_commits) const; |
42 void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect); | 43 void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect); |
43 void SetNeedsCommitOnImpl(); | 44 void SetNeedsCommitOnImpl(); |
44 void BeginMainFrameAbortedOnImpl( | 45 void BeginMainFrameAbortedOnImpl( |
45 CommitEarlyOutReason reason, | 46 CommitEarlyOutReason reason, |
46 base::TimeTicks main_thread_start_time, | 47 base::TimeTicks main_thread_start_time, |
47 std::vector<std::unique_ptr<SwapPromise>> swap_promises); | 48 std::vector<std::unique_ptr<SwapPromise>> swap_promises); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 141 |
141 std::unique_ptr<LayerTreeHostImpl> layer_tree_host_impl_; | 142 std::unique_ptr<LayerTreeHostImpl> layer_tree_host_impl_; |
142 | 143 |
143 // Use accessors instead of this variable directly. | 144 // Use accessors instead of this variable directly. |
144 BlockedMainCommitOnly main_thread_blocked_commit_vars_unsafe_; | 145 BlockedMainCommitOnly main_thread_blocked_commit_vars_unsafe_; |
145 BlockedMainCommitOnly& blocked_main_commit(); | 146 BlockedMainCommitOnly& blocked_main_commit(); |
146 | 147 |
147 // Used to post tasks to ProxyMain on the main thread. | 148 // Used to post tasks to ProxyMain on the main thread. |
148 base::WeakPtr<ProxyMain> proxy_main_weak_ptr_; | 149 base::WeakPtr<ProxyMain> proxy_main_weak_ptr_; |
149 | 150 |
| 151 // A weak pointer to ProxyMain that is invalidated when CompositorFrameSink is |
| 152 // released. |
| 153 base::WeakPtr<ProxyMain> compositor_frame_sink_weak_ptr_; |
| 154 |
150 DISALLOW_COPY_AND_ASSIGN(ProxyImpl); | 155 DISALLOW_COPY_AND_ASSIGN(ProxyImpl); |
151 }; | 156 }; |
152 | 157 |
153 } // namespace cc | 158 } // namespace cc |
154 | 159 |
155 #endif // CC_TREES_PROXY_IMPL_H_ | 160 #endif // CC_TREES_PROXY_IMPL_H_ |
OLD | NEW |