Commit ec673cae authored by danakj@chromium.org's avatar danakj@chromium.org

cc: Fix thread race on writing commit_waits_for_activation_.

Under non-impl-side painting, the thread proxy ends up releasing the
main thread then setting commit_waits_for_activation_ to false, which
is the wrong way around. This puts the order right.

R=enne
BUG=334611

Review URL: https://codereview.chromium.org/139553003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245269 0039d316-1c4b-4281-b951-d872f2087c98
parent f7c7487a
......@@ -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_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment