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_THREADED_CHANNEL_H_ | 5 #ifndef CC_TREES_THREADED_CHANNEL_H_ |
6 #define CC_TREES_THREADED_CHANNEL_H_ | 6 #define CC_TREES_THREADED_CHANNEL_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // and set ProxyImpl. | 70 // and set ProxyImpl. |
71 ThreadProxy* thread_proxy, | 71 ThreadProxy* thread_proxy, |
72 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 72 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
73 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 73 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
74 | 74 |
75 ~ThreadedChannel() override; | 75 ~ThreadedChannel() override; |
76 | 76 |
77 // ChannelMain Implementation | 77 // ChannelMain Implementation |
78 void SetThrottleFrameProductionOnImpl(bool throttle) override; | 78 void SetThrottleFrameProductionOnImpl(bool throttle) override; |
79 void SetLayerTreeHostClientReadyOnImpl() override; | 79 void SetLayerTreeHostClientReadyOnImpl() override; |
| 80 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override; |
| 81 void MainThreadHasStoppedFlingingOnImpl() override; |
| 82 void SetInputThrottledUntilCommitOnImpl(bool is_throttled) override; |
| 83 void SetDeferCommitsOnImpl(bool defer_commits) override; |
| 84 |
| 85 // Blocking calls to ProxyImpl |
| 86 void FinishAllRenderingOnImpl() override; |
| 87 void SetVisibleOnImpl(bool visible) override; |
| 88 void ReleaseOutputSurfaceOnImpl() override; |
| 89 void FinishGLOnImpl() override; |
| 90 void MainFrameWillHappenOnImplForTesting( |
| 91 bool* main_frame_will_happen) override; |
80 | 92 |
81 // ChannelImpl Implementation | 93 // ChannelImpl Implementation |
82 void DidCompleteSwapBuffers() override; | 94 void DidCompleteSwapBuffers() override; |
| 95 void SetRendererCapabilitiesMainCopy( |
| 96 const RendererCapabilities& capabilities) override; |
| 97 void BeginMainFrameNotExpectedSoon() override; |
| 98 void DidCommitAndDrawFrame() override; |
| 99 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue) override; |
| 100 void DidLoseOutputSurface() override; |
| 101 void RequestNewOutputSurface() override; |
| 102 void DidInitializeOutputSurface( |
| 103 bool success, |
| 104 const RendererCapabilities& capabilities) override; |
| 105 void DidCompletePageScaleAnimation() override; |
| 106 void PostFrameTimingEventsOnMain( |
| 107 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 108 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) |
| 109 override; |
| 110 |
| 111 // TODO(khushalsagar): Remove this. Temporary method to create the weak |
| 112 // pointer on the impl thread |
| 113 void InitImplThreadWeakPtr(); |
| 114 void InvalidateImplThreadWeakPtr(); |
83 | 115 |
84 protected: | 116 protected: |
85 ThreadedChannel(ThreadProxy* thread_proxy, | 117 ThreadedChannel(ThreadProxy* thread_proxy, |
86 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 118 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
87 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 119 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
88 | 120 |
89 private: | 121 private: |
90 base::SingleThreadTaskRunner* MainThreadTaskRunner() const; | 122 base::SingleThreadTaskRunner* MainThreadTaskRunner() const; |
91 base::SingleThreadTaskRunner* ImplThreadTaskRunner() const; | 123 base::SingleThreadTaskRunner* ImplThreadTaskRunner() const; |
92 | 124 |
| 125 void BlockingFinishAllRenderingOnImpl(CompletionEvent* completion); |
| 126 void BlockingSetVisibleOnImpl(CompletionEvent* completion, bool visible); |
| 127 void BlockingReleaseOutputSurfaceOnImpl(CompletionEvent* completion); |
| 128 void BlockingFinishGLOnImpl(CompletionEvent* completion); |
| 129 void BlockingMainFrameWillHappenOnImplForTesting( |
| 130 CompletionEvent* completion, |
| 131 bool* main_frame_will_happen); |
| 132 |
93 ProxyMain* proxy_main_; | 133 ProxyMain* proxy_main_; |
94 | 134 |
95 ProxyImpl* proxy_impl_; | 135 ProxyImpl* proxy_impl_; |
96 | 136 |
97 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 137 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
98 | 138 |
99 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; | 139 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; |
100 | 140 |
| 141 // TODO(khushalsagar): Initialize this in ThreadedChannel when ChannelImpl |
| 142 // gets initialization call. |
| 143 base::WeakPtr<ThreadedChannel> impl_thread_weak_ptr_; |
| 144 |
| 145 base::WeakPtrFactory<ThreadedChannel> impl_weak_factory_; |
| 146 |
101 DISALLOW_COPY_AND_ASSIGN(ThreadedChannel); | 147 DISALLOW_COPY_AND_ASSIGN(ThreadedChannel); |
102 }; | 148 }; |
103 | 149 |
104 } // namespace cc | 150 } // namespace cc |
105 | 151 |
106 #endif // CC_TREES_THREADED_CHANNEL_H_ | 152 #endif // CC_TREES_THREADED_CHANNEL_H_ |
OLD | NEW |