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

Unified Diff: cc/trees/threaded_channel.cc

Issue 1377063003: Split ThreadProxy methods to ProxyMain and ProxyImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use completion events for blocking calls from ProxyMain. 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 side-by-side diff with in-line comments
Download patch
« cc/trees/thread_proxy.cc ('K') | « cc/trees/threaded_channel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/threaded_channel.cc
diff --git a/cc/trees/threaded_channel.cc b/cc/trees/threaded_channel.cc
index 38efdc682d560586f93aed1e68be68bf5c18d3f5..1f090a981b8eed21ce8183a9fbca3d7f69eb84a0 100644
--- a/cc/trees/threaded_channel.cc
+++ b/cc/trees/threaded_channel.cc
@@ -33,12 +33,136 @@ void ThreadedChannel::SetThrottleFrameProductionOnImpl(bool throttle) {
proxy_impl_->GetImplWeakPtr(), throttle));
}
+void ThreadedChannel::InitializeOutputSurfaceOnImpl(
+ OutputSurface* output_surface) {
+ ImplThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyImpl::InitializeOutputSurfaceOnImpl,
+ proxy_impl_->GetImplWeakPtr(), output_surface));
+}
+
+void ThreadedChannel::MainThreadHasStoppedFlingingOnImpl() {
+ ImplThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyImpl::MainThreadHasStoppedFlingingOnImpl,
+ proxy_impl_->GetImplWeakPtr()));
+}
+
+void ThreadedChannel::SetInputThrottledUntilCommitOnImpl(bool is_throttled) {
+ ImplThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyImpl::SetInputThrottledUntilCommitOnImpl,
+ proxy_impl_->GetImplWeakPtr(), is_throttled));
+}
+
+void ThreadedChannel::SetDeferCommitsOnImpl(bool defer_commits) {
+ ImplThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyImpl::SetDeferCommitsOnImpl,
+ proxy_impl_->GetImplWeakPtr(), defer_commits));
+}
+
+void ThreadedChannel::FinishAllRenderingOnImpl(CompletionEvent* completion) {
+ ImplThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyImpl::FinishAllRenderingOnImpl,
+ proxy_impl_->GetImplWeakPtr(), completion));
+}
+
+void ThreadedChannel::SetVisibleOnImpl(CompletionEvent* completion,
+ bool visible) {
+ ImplThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ProxyImpl::SetVisibleOnImpl, proxy_impl_->GetImplWeakPtr(),
+ completion, visible));
+}
+
+void ThreadedChannel::ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) {
+ ImplThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyImpl::ReleaseOutputSurfaceOnImpl,
+ proxy_impl_->GetImplWeakPtr(), completion));
+}
+
+void ThreadedChannel::FinishGLOnImpl(CompletionEvent* completion) {
+ ImplThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyImpl::FinishGLOnImpl,
+ proxy_impl_->GetImplWeakPtr(), completion));
+}
+
+void ThreadedChannel::MainFrameWillHappenOnImplForTesting(
+ CompletionEvent* completion,
+ bool* main_frame_will_happen) {
+ ImplThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyImpl::MainFrameWillHappenOnImplForTesting,
+ proxy_impl_->GetImplWeakPtr(), completion,
+ main_frame_will_happen));
+}
+
void ThreadedChannel::DidCompleteSwapBuffers() {
MainThreadTaskRunner()->PostTask(
FROM_HERE, base::Bind(&ProxyMain::DidCompleteSwapBuffers,
proxy_main_->GetMainWeakPtr()));
}
+void ThreadedChannel::SetRendererCapabilitiesMainCopy(
+ const RendererCapabilities& capabilities) {
+ MainThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyMain::SetRendererCapabilitiesMainCopy,
+ proxy_main_->GetMainWeakPtr(), capabilities));
+}
+
+void ThreadedChannel::BeginMainFrameNotExpectedSoon() {
+ MainThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyMain::BeginMainFrameNotExpectedSoon,
+ proxy_main_->GetMainWeakPtr()));
+}
+
+void ThreadedChannel::DidCommitAndDrawFrame() {
+ MainThreadTaskRunner()->PostTask(FROM_HERE,
+ base::Bind(&ProxyMain::DidCommitAndDrawFrame,
+ proxy_main_->GetMainWeakPtr()));
+}
+
+void ThreadedChannel::SetAnimationEvents(
+ scoped_ptr<AnimationEventsVector> queue) {
+ MainThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ProxyMain::SetAnimationEvents, proxy_main_->GetMainWeakPtr(),
+ base::Passed(&queue)));
+}
+
+void ThreadedChannel::DidLoseOutputSurface() {
+ MainThreadTaskRunner()->PostTask(FROM_HERE,
+ base::Bind(&ProxyMain::DidLoseOutputSurface,
+ proxy_main_->GetMainWeakPtr()));
+}
+
+void ThreadedChannel::RequestNewOutputSurface() {
+ MainThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyMain::RequestNewOutputSurface,
+ proxy_main_->GetMainWeakPtr()));
+}
+
+void ThreadedChannel::DidInitializeOutputSurface(
+ bool success,
+ const RendererCapabilities& capabilities) {
+ MainThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ProxyMain::DidInitializeOutputSurface,
+ proxy_main_->GetMainWeakPtr(), success, capabilities));
+}
+
+void ThreadedChannel::DidCompletePageScaleAnimation() {
+ MainThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyMain::DidCompletePageScaleAnimation,
+ proxy_main_->GetMainWeakPtr()));
+}
+
+void ThreadedChannel::PostFrameTimingEventsOnMain(
+ scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events,
+ scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) {
+ MainThreadTaskRunner()->PostTask(
+ FROM_HERE, base::Bind(&ProxyMain::PostFrameTimingEventsOnMain,
+ proxy_main_->GetMainWeakPtr(),
+ base::Passed(composite_events.Pass()),
+ base::Passed(main_frame_events.Pass())));
+}
+
ThreadedChannel::~ThreadedChannel() {
TRACE_EVENT0("cc", "ThreadChannel::~ThreadChannel");
}
« cc/trees/thread_proxy.cc ('K') | « cc/trees/threaded_channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698