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

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

Issue 1418953002: cc: Send shared variables between main and impl side using the channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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
« no previous file with comments | « cc/trees/threaded_channel.h ('k') | cc/trees/threaded_channel_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "cc/trees/threaded_channel.h" 5 #include "cc/trees/threaded_channel.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 10
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 FROM_HERE, base::Bind(&ProxyImpl::BeginMainFrameAbortedOnImpl, 85 FROM_HERE, base::Bind(&ProxyImpl::BeginMainFrameAbortedOnImpl,
86 proxy_impl_->GetImplWeakPtr(), reason)); 86 proxy_impl_->GetImplWeakPtr(), reason));
87 } 87 }
88 88
89 void ThreadedChannel::SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) { 89 void ThreadedChannel::SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) {
90 ImplThreadTaskRunner()->PostTask( 90 ImplThreadTaskRunner()->PostTask(
91 FROM_HERE, base::Bind(&ProxyImpl::SetNeedsRedrawOnImpl, 91 FROM_HERE, base::Bind(&ProxyImpl::SetNeedsRedrawOnImpl,
92 proxy_impl_->GetImplWeakPtr(), damage_rect)); 92 proxy_impl_->GetImplWeakPtr(), damage_rect));
93 } 93 }
94 94
95 void ThreadedChannel::StartCommitOnImpl(CompletionEvent* completion) { 95 void ThreadedChannel::StartCommitOnImpl(CompletionEvent* completion,
96 LayerTreeHost* layer_tree_host,
97 bool hold_commit_for_activation) {
96 ImplThreadTaskRunner()->PostTask( 98 ImplThreadTaskRunner()->PostTask(
97 FROM_HERE, base::Bind(&ProxyImpl::StartCommitOnImpl, 99 FROM_HERE,
100 base::Bind(&ProxyImpl::StartCommitOnImpl, proxy_impl_->GetImplWeakPtr(),
101 completion, layer_tree_host, hold_commit_for_activation));
102 }
103
104 void ThreadedChannel::InitializeImplOnImpl(CompletionEvent* completion,
105 LayerTreeHost* layer_tree_host) {
106 ImplThreadTaskRunner()->PostTask(
107 FROM_HERE,
108 base::Bind(&ProxyImpl::InitializeImplOnImpl,
109 base::Unretained(proxy_impl_), completion, layer_tree_host));
110 }
111
112 void ThreadedChannel::LayerTreeHostClosedOnImpl(CompletionEvent* completion) {
113 ImplThreadTaskRunner()->PostTask(
114 FROM_HERE, base::Bind(&ProxyImpl::LayerTreeHostClosedOnImpl,
98 proxy_impl_->GetImplWeakPtr(), completion)); 115 proxy_impl_->GetImplWeakPtr(), completion));
116 proxy_impl_ = nullptr;
99 } 117 }
100 118
101 void ThreadedChannel::SetVisibleOnImpl(bool visible) { 119 void ThreadedChannel::SetVisibleOnImpl(bool visible) {
102 ImplThreadTaskRunner()->PostTask( 120 ImplThreadTaskRunner()->PostTask(
103 FROM_HERE, base::Bind(&ProxyImpl::SetVisibleOnImpl, 121 FROM_HERE, base::Bind(&ProxyImpl::SetVisibleOnImpl,
104 proxy_impl_->GetImplWeakPtr(), visible)); 122 proxy_impl_->GetImplWeakPtr(), visible));
105 } 123 }
106 124
107 void ThreadedChannel::ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) { 125 void ThreadedChannel::ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) {
108 ImplThreadTaskRunner()->PostTask( 126 ImplThreadTaskRunner()->PostTask(
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 227
210 base::SingleThreadTaskRunner* ThreadedChannel::MainThreadTaskRunner() const { 228 base::SingleThreadTaskRunner* ThreadedChannel::MainThreadTaskRunner() const {
211 return main_task_runner_.get(); 229 return main_task_runner_.get();
212 } 230 }
213 231
214 base::SingleThreadTaskRunner* ThreadedChannel::ImplThreadTaskRunner() const { 232 base::SingleThreadTaskRunner* ThreadedChannel::ImplThreadTaskRunner() const {
215 return impl_task_runner_.get(); 233 return impl_task_runner_.get();
216 } 234 }
217 235
218 } // namespace cc 236 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/threaded_channel.h ('k') | cc/trees/threaded_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698