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

Unified Diff: cc/trees/proxy_impl.cc

Issue 2158973002: cc: Clean up LayerTreeTest and TestHooks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: proxy-impls: test Created 4 years, 5 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
« no previous file with comments | « cc/trees/proxy_impl.h ('k') | cc/trees/proxy_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/proxy_impl.cc
diff --git a/cc/trees/proxy_impl.cc b/cc/trees/proxy_impl.cc
index cf0dd57bb0b10839f4ab37f704fba30c04ee407e..8e651144d8e6f231300921f518f19518a53eb50f 100644
--- a/cc/trees/proxy_impl.cc
+++ b/cc/trees/proxy_impl.cc
@@ -36,16 +36,6 @@ unsigned int nextBeginFrameId = 0;
} // namespace
-std::unique_ptr<ProxyImpl> ProxyImpl::Create(
- ChannelImpl* channel_impl,
- LayerTreeHost* layer_tree_host,
- TaskRunnerProvider* task_runner_provider,
- std::unique_ptr<BeginFrameSource> external_begin_frame_source) {
- return base::WrapUnique(
- new ProxyImpl(channel_impl, layer_tree_host, task_runner_provider,
- std::move(external_begin_frame_source)));
-}
-
ProxyImpl::ProxyImpl(
ChannelImpl* channel_impl,
LayerTreeHost* layer_tree_host,
@@ -72,6 +62,10 @@ ProxyImpl::ProxyImpl(
DCHECK(IsImplThread());
DCHECK(IsMainThreadBlocked());
+ // Double checking we set this correctly since double->int truncations are
+ // silent and have been done mistakenly: crbug.com/568120.
+ DCHECK(!smoothness_priority_expiration_notifier_.delay().is_zero());
+
layer_tree_host_impl_ = layer_tree_host->CreateLayerTreeHostImpl(this);
SchedulerSettings scheduler_settings(
@@ -256,21 +250,12 @@ void ProxyImpl::MainFrameWillHappenOnImplForTesting(
completion->Signal();
}
-void ProxyImpl::BlockNotifyReadyToActivateForTesting(bool block) {
- DCHECK(IsImplThread());
- layer_tree_host_impl_->BlockNotifyReadyToActivateForTesting(block);
-}
-
-CompletionEvent* ProxyImpl::ActivationCompletionEventForTesting() {
- DCHECK(IsImplThread());
- return activation_completion_event_;
-}
-
-void ProxyImpl::StartCommitOnImpl(CompletionEvent* completion,
- LayerTreeHost* layer_tree_host,
- base::TimeTicks main_thread_start_time,
- bool hold_commit_for_activation) {
- TRACE_EVENT0("cc", "ProxyImpl::StartCommitOnImplThread");
+void ProxyImpl::NotifyReadyToCommitOnImpl(
+ CompletionEvent* completion,
+ LayerTreeHost* layer_tree_host,
+ base::TimeTicks main_thread_start_time,
+ bool hold_commit_for_activation) {
+ TRACE_EVENT0("cc", "ProxyImpl::NotifyReadyToCommitOnImpl");
DCHECK(!commit_completion_event_);
DCHECK(IsImplThread() && IsMainThreadBlocked());
DCHECK(scheduler_);
@@ -287,6 +272,8 @@ void ProxyImpl::StartCommitOnImpl(CompletionEvent* completion,
// But, we can avoid a PostTask in here.
scheduler_->NotifyBeginMainFrameStarted(main_thread_start_time);
+ layer_tree_host_impl_->ReadyToCommit();
+
commit_completion_event_ = completion;
commit_completion_waits_for_activation_ = hold_commit_for_activation;
« no previous file with comments | « cc/trees/proxy_impl.h ('k') | cc/trees/proxy_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698