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

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
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(CompletionEvent* completion, 119 void ThreadedChannel::SetVisibleOnImpl(CompletionEvent* completion,
102 bool visible) { 120 bool visible) {
103 ImplThreadTaskRunner()->PostTask( 121 ImplThreadTaskRunner()->PostTask(
104 FROM_HERE, 122 FROM_HERE,
105 base::Bind(&ProxyImpl::SetVisibleOnImpl, proxy_impl_->GetImplWeakPtr(), 123 base::Bind(&ProxyImpl::SetVisibleOnImpl, proxy_impl_->GetImplWeakPtr(),
106 completion, visible)); 124 completion, visible));
107 } 125 }
108 126
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 229
212 base::SingleThreadTaskRunner* ThreadedChannel::MainThreadTaskRunner() const { 230 base::SingleThreadTaskRunner* ThreadedChannel::MainThreadTaskRunner() const {
213 return main_task_runner_.get(); 231 return main_task_runner_.get();
214 } 232 }
215 233
216 base::SingleThreadTaskRunner* ThreadedChannel::ImplThreadTaskRunner() const { 234 base::SingleThreadTaskRunner* ThreadedChannel::ImplThreadTaskRunner() const {
217 return impl_task_runner_.get(); 235 return impl_task_runner_.get();
218 } 236 }
219 237
220 } // namespace cc 238 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698