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

Unified Diff: cc/trees/thread_proxy.cc

Issue 139553003: cc: Fix thread race on writing commit_waits_for_activation_. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index a1ce1b557c987fa121498a7acafb657db9b04655..43e1eb9cafdc4d1b19c4b85805ca5a1f2bb1cc58 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -1011,6 +1011,7 @@ void ThreadProxy::BeginMainFrameAbortedOnImplThread(bool did_handle) {
void ThreadProxy::ScheduledActionCommit() {
TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit");
DCHECK(IsImplThread());
+ DCHECK(IsMainThreadBlocked());
DCHECK(commit_completion_event_on_impl_thread_);
DCHECK(current_resource_update_controller_on_impl_thread_);
@@ -1031,8 +1032,11 @@ void ThreadProxy::ScheduledActionCommit() {
next_frame_is_newly_committed_frame_on_impl_thread_ = true;
- if (layer_tree_host()->settings().impl_side_painting &&
- commit_waits_for_activation_) {
+ bool hold_commit = layer_tree_host()->settings().impl_side_painting &&
+ commit_waits_for_activation_;
+ commit_waits_for_activation_ = false;
+
+ if (hold_commit) {
// For some layer types in impl-side painting, the commit is held until
// the pending tree is activated. It's also possible that the
// pending tree has already activated if there was no work to be done.
@@ -1045,8 +1049,6 @@ void ThreadProxy::ScheduledActionCommit() {
commit_completion_event_on_impl_thread_ = NULL;
}
- commit_waits_for_activation_ = false;
-
commit_complete_time_ = base::TimeTicks::HighResNow();
begin_main_frame_to_commit_duration_history_.InsertSample(
commit_complete_time_ - begin_main_frame_sent_time_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698