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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // SetLayerTreeClosed | 63 // SetLayerTreeClosed |
64 // ---------------------------------------------------------------------------- | 64 // ---------------------------------------------------------------------------- |
65 | 65 |
66 class CC_EXPORT ThreadedChannel : public ChannelMain, public ChannelImpl { | 66 class CC_EXPORT ThreadedChannel : public ChannelMain, public ChannelImpl { |
67 public: | 67 public: |
68 static scoped_ptr<ThreadedChannel> Create( | 68 static scoped_ptr<ThreadedChannel> Create( |
69 // TODO(khushalsagar): Make this ProxyMain* and write the initialization | 69 // TODO(khushalsagar): Make this ProxyMain* and write the initialization |
70 // sequence. Currently ThreadProxy implements both so we pass the pointer | 70 // sequence. Currently ThreadProxy implements both so we pass the pointer |
71 // and set ProxyImpl. | 71 // and set ProxyImpl. |
72 ThreadProxy* thread_proxy, | 72 ThreadProxy* thread_proxy, |
73 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 73 TaskRunnerProvider* task_runner_provider); |
74 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | |
75 | 74 |
76 ~ThreadedChannel() override; | 75 ~ThreadedChannel() override; |
77 | 76 |
78 // ChannelMain Implementation | 77 // ChannelMain Implementation |
79 void SetThrottleFrameProductionOnImpl(bool throttle) override; | 78 void SetThrottleFrameProductionOnImpl(bool throttle) override; |
80 void UpdateTopControlsStateOnImpl(TopControlsState constraints, | 79 void UpdateTopControlsStateOnImpl(TopControlsState constraints, |
81 TopControlsState current, | 80 TopControlsState current, |
82 bool animate) override; | 81 bool animate) override; |
83 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override; | 82 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override; |
84 void MainThreadHasStoppedFlingingOnImpl() override; | 83 void MainThreadHasStoppedFlingingOnImpl() override; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 void DidCompletePageScaleAnimation() override; | 117 void DidCompletePageScaleAnimation() override; |
119 void PostFrameTimingEventsOnMain( | 118 void PostFrameTimingEventsOnMain( |
120 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 119 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
121 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) | 120 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) |
122 override; | 121 override; |
123 void BeginMainFrame( | 122 void BeginMainFrame( |
124 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) override; | 123 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) override; |
125 | 124 |
126 protected: | 125 protected: |
127 ThreadedChannel(ThreadProxy* thread_proxy, | 126 ThreadedChannel(ThreadProxy* thread_proxy, |
128 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 127 TaskRunnerProvider* task_runner_provider); |
129 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | |
130 | 128 |
131 private: | 129 private: |
132 base::SingleThreadTaskRunner* MainThreadTaskRunner() const; | 130 base::SingleThreadTaskRunner* MainThreadTaskRunner() const; |
133 base::SingleThreadTaskRunner* ImplThreadTaskRunner() const; | 131 base::SingleThreadTaskRunner* ImplThreadTaskRunner() const; |
134 | 132 |
135 ProxyMain* proxy_main_; | 133 ProxyMain* proxy_main_; |
136 | 134 |
137 ProxyImpl* proxy_impl_; | 135 ProxyImpl* proxy_impl_; |
138 | 136 |
139 // TODO(khushalsagar): Temporary variable to access proxy for assertion checks | 137 TaskRunnerProvider* task_runner_provider_; |
140 // Remove this once the proxy class is split and the complete | |
141 // implementation for controlling communication across threads is moved to | |
142 // ThreadedChannel. | |
143 Proxy* proxy_; | |
144 | 138 |
145 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 139 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
146 | 140 |
147 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; | 141 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; |
148 | 142 |
149 DISALLOW_COPY_AND_ASSIGN(ThreadedChannel); | 143 DISALLOW_COPY_AND_ASSIGN(ThreadedChannel); |
150 }; | 144 }; |
151 | 145 |
152 } // namespace cc | 146 } // namespace cc |
153 | 147 |
154 #endif // CC_TREES_THREADED_CHANNEL_H_ | 148 #endif // CC_TREES_THREADED_CHANNEL_H_ |
OLD | NEW |