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_MAIN_H_ | 5 #ifndef CC_TREES_PROXY_MAIN_H_ |
6 #define CC_TREES_PROXY_MAIN_H_ | 6 #define CC_TREES_PROXY_MAIN_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "cc/animation/animation_events.h" |
9 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| 11 #include "cc/debug/frame_timing_tracker.h" |
| 12 #include "cc/output/renderer_capabilities.h" |
| 13 #include "cc/trees/proxy_common.h" |
10 | 14 |
11 namespace cc { | 15 namespace cc { |
12 class ThreadedChannel; | 16 class ThreadedChannel; |
13 | 17 |
14 // TODO(khushalsagar): The main side of ThreadProxy. It is currently defined as | 18 // TODO(khushalsagar): The main side of ThreadProxy. It is currently defined as |
15 // an interface with the implementation provided by ThreadProxy and will be | 19 // an interface with the implementation provided by ThreadProxy and will be |
16 // made an independent class. | 20 // made an independent class. |
17 // The methods added to this interface should only use the MainThreadOnly or | 21 // The methods added to this interface should only use the MainThreadOnly or |
18 // BlockedMainThread variables from ThreadProxy. | 22 // BlockedMainThread variables from ThreadProxy. |
19 // See crbug/527200. | 23 // See crbug/527200. |
20 class CC_EXPORT ProxyMain { | 24 class CC_EXPORT ProxyMain { |
21 public: | 25 public: |
22 // TODO(khushalsagar): Make this ChannelMain*. When ProxyMain and | 26 // TODO(khushalsagar): Make this ChannelMain*. When ProxyMain and |
23 // ProxyImpl are split, ProxyImpl will be passed a reference to ChannelImpl | 27 // ProxyImpl are split, ProxyImpl will be passed a reference to ChannelImpl |
24 // at creation. Right now we just set it directly from ThreadedChannel | 28 // at creation. Right now we just set it directly from ThreadedChannel |
25 // when the impl side is initialized. | 29 // when the impl side is initialized. |
26 virtual void SetChannel(scoped_ptr<ThreadedChannel> threaded_channel) = 0; | 30 virtual void SetChannel(scoped_ptr<ThreadedChannel> threaded_channel) = 0; |
27 | 31 |
| 32 protected: |
| 33 virtual ~ProxyMain() {} |
| 34 |
| 35 private: |
| 36 friend class ThreadedChannel; |
28 // Callback for main side commands received from the Channel. | 37 // Callback for main side commands received from the Channel. |
29 virtual void DidCompleteSwapBuffers() = 0; | 38 virtual void DidCompleteSwapBuffers() = 0; |
| 39 virtual void SetRendererCapabilitiesMainCopy( |
| 40 const RendererCapabilities& capabilities) = 0; |
| 41 virtual void BeginMainFrameNotExpectedSoon() = 0; |
| 42 virtual void DidCommitAndDrawFrame() = 0; |
| 43 virtual void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue) = 0; |
| 44 virtual void DidLoseOutputSurface() = 0; |
| 45 virtual void RequestNewOutputSurface() = 0; |
| 46 virtual void DidInitializeOutputSurface( |
| 47 bool success, |
| 48 const RendererCapabilities& capabilities) = 0; |
| 49 virtual void DidCompletePageScaleAnimation() = 0; |
| 50 virtual void PostFrameTimingEventsOnMain( |
| 51 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 52 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) = 0; |
| 53 virtual void BeginMainFrame( |
| 54 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) = 0; |
30 | 55 |
31 // TODO(khushalsagar): Rename as GetWeakPtr() once ThreadProxy is split. | 56 // TODO(khushalsagar): Rename as GetWeakPtr() once ThreadProxy is split. |
32 virtual base::WeakPtr<ProxyMain> GetMainWeakPtr() = 0; | 57 virtual base::WeakPtr<ProxyMain> GetMainWeakPtr() = 0; |
33 | |
34 protected: | |
35 virtual ~ProxyMain() {} | |
36 }; | 58 }; |
37 | 59 |
38 } // namespace cc | 60 } // namespace cc |
39 | 61 |
40 #endif // CC_TREES_PROXY_MAIN_H_ | 62 #endif // CC_TREES_PROXY_MAIN_H_ |
OLD | NEW |