Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: cc/trees/threaded_channel.h

Issue 1377063003: Split ThreadProxy methods to ProxyMain and ProxyImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add remaining post task methods. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "cc/trees/channel_impl.h" 11 #include "cc/trees/channel_impl.h"
12 #include "cc/trees/channel_main.h" 12 #include "cc/trees/channel_main.h"
13 #include "cc/trees/proxy_common.h"
13 #include "cc/trees/proxy_impl.h" 14 #include "cc/trees/proxy_impl.h"
14 #include "cc/trees/proxy_main.h" 15 #include "cc/trees/proxy_main.h"
15 #include "cc/trees/thread_proxy.h" 16 #include "cc/trees/thread_proxy.h"
16 17
17 namespace base { 18 namespace base {
18 class SingleThreadTaskRunner; 19 class SingleThreadTaskRunner;
19 } 20 }
20 21
21 namespace cc { 22 namespace cc {
22 class ChannelImpl; 23 class ChannelImpl;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 73 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
73 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); 74 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner);
74 75
75 ~ThreadedChannel() override; 76 ~ThreadedChannel() override;
76 77
77 // ChannelMain Implementation 78 // ChannelMain Implementation
78 void SetThrottleFrameProductionOnImpl(bool throttle) override; 79 void SetThrottleFrameProductionOnImpl(bool throttle) override;
79 void UpdateTopControlsStateOnImpl(TopControlsState constraints, 80 void UpdateTopControlsStateOnImpl(TopControlsState constraints,
80 TopControlsState current, 81 TopControlsState current,
81 bool animate) override; 82 bool animate) override;
83 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override;
84 void MainThreadHasStoppedFlingingOnImpl() override;
85 void SetInputThrottledUntilCommitOnImpl(bool is_throttled) override;
86 void SetDeferCommitsOnImpl(bool defer_commits) override;
87 void SetNeedsCommitOnImpl() override;
88 void BeginMainFrameAbortedOnImpl(CommitEarlyOutReason reason) override;
89 void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) override;
90
91 // Blocking calls to ProxyImpl
92 void FinishAllRenderingOnImpl(CompletionEvent* completion) override;
93 void SetVisibleOnImpl(CompletionEvent* completion, bool visible) override;
94 void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) override;
95 void FinishGLOnImpl(CompletionEvent* completion) override;
96 void MainFrameWillHappenOnImplForTesting(
97 CompletionEvent* completion,
98 bool* main_frame_will_happen) override;
99 void StartCommitOnImpl(
100 CompletionEvent* completion,
101 BlockedMainCommitState* blocked_main_commit_state) override;
82 102
83 // ChannelImpl Implementation 103 // ChannelImpl Implementation
84 void DidCompleteSwapBuffers() override; 104 void DidCompleteSwapBuffers() override;
105 void SetRendererCapabilitiesMainCopy(
106 const RendererCapabilities& capabilities) override;
107 void BeginMainFrameNotExpectedSoon() override;
108 void DidCommitAndDrawFrame() override;
109 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue) override;
110 void DidLoseOutputSurface() override;
111 void RequestNewOutputSurface() override;
112 void DidInitializeOutputSurface(
113 bool success,
114 const RendererCapabilities& capabilities) override;
115 void DidCompletePageScaleAnimation() override;
116 void PostFrameTimingEventsOnMain(
117 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events,
118 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events)
119 override;
120 void BeginMainFrame(
121 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) override;
85 122
86 protected: 123 protected:
87 ThreadedChannel(ThreadProxy* thread_proxy, 124 ThreadedChannel(ThreadProxy* thread_proxy,
88 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 125 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
89 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); 126 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner);
90 127
91 private: 128 private:
92 base::SingleThreadTaskRunner* MainThreadTaskRunner() const; 129 base::SingleThreadTaskRunner* MainThreadTaskRunner() const;
93 base::SingleThreadTaskRunner* ImplThreadTaskRunner() const; 130 base::SingleThreadTaskRunner* ImplThreadTaskRunner() const;
94 131
95 ProxyMain* proxy_main_; 132 ProxyMain* proxy_main_;
96 133
97 ProxyImpl* proxy_impl_; 134 ProxyImpl* proxy_impl_;
98 135
136 // TODO(khushalsagar): Temporary variable to access proxy for assertion checks
137 // Remove this once the proxy class is split and the complete
138 // implementation for controlling communication across threads is moved to
139 // ThreadedChannel.
140 Proxy* proxy_;
141
99 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 142 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
100 143
101 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; 144 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_;
102 145
103 DISALLOW_COPY_AND_ASSIGN(ThreadedChannel); 146 DISALLOW_COPY_AND_ASSIGN(ThreadedChannel);
104 }; 147 };
105 148
106 } // namespace cc 149 } // namespace cc
107 150
108 #endif // CC_TREES_THREADED_CHANNEL_H_ 151 #endif // CC_TREES_THREADED_CHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698