In display locking, the lifecycle phases should be co-operative. As a first step, we should just yield between lifecycle phases. This bug tracks the implementation.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bfa40879994ac2a1370653c0f1188cb8e775d25a commit bfa40879994ac2a1370653c0f1188cb8e775d25a Author: Vladimir Levin <vmpstr@chromium.org> Date: Fri Dec 14 15:49:51 2018 [DL]: Implement a budget interface in display locking. This patch does a few things: - Removes the debugging macro code since it's losing its value. - Add a DisplayLockBudget with two implementations: - Unyielding budget that never yields and finishes everything - Strict yielding budget that always yields between every lifecycle phase. - Pulls out the lifecycle state from the context to the budget - Adds tests for the budgets. The step after this would be to implement a yielding budget, which should be a combination of strictly yielding logic with some sort of a deadline. R=chrishtr@chromium.org, mstensho@chromium.org Bug: 907619 , 882663 Change-Id: Idc75abd2334ce7b5aa6b48714b5b720d3da81b42 Reviewed-on: https://chromium-review.googlesource.com/c/1372307 Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Commit-Queue: vmpstr <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/master@{#616687} [modify] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/BUILD.gn [modify] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/display_lock/BUILD.gn [add] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/display_lock/display_lock_budget.cc [add] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/display_lock/display_lock_budget.h [add] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/display_lock/display_lock_budget_test.cc [modify] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/display_lock/display_lock_context.cc [modify] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/display_lock/display_lock_context.h [modify] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/display_lock/display_lock_context_test.cc [add] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/display_lock/strict_yielding_display_lock_budget.cc [add] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/display_lock/strict_yielding_display_lock_budget.h [add] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/display_lock/unyielding_display_lock_budget.cc [add] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/display_lock/unyielding_display_lock_budget.h [modify] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/dom/element.cc [modify] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/frame/local_frame_view.cc [modify] https://crrev.com/bfa40879994ac2a1370653c0f1188cb8e775d25a/third_party/blink/renderer/core/frame/local_frame_view.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1266d1fbfe7bc8ea757a5a3712917b8be61a4ffb commit 1266d1fbfe7bc8ea757a5a3712917b8be61a4ffb Author: Vladimir Levin <vmpstr@chromium.org> Date: Wed Jan 02 19:17:31 2019 [DL]: Add a budget that yields between lifecycles if the deadline is passed. This patch adds a yielding budget which tries to do as much work as possible within the budget. If the budget expires, it yields between lifecycles. This patch also makes this the default budget, since it's the best behavior currently implemented. See YieldingDisplayLockBudget::GetCurrentBudgetMs() for the time budgets. These were picked arbitrarily, but I think they seem reasonable. R=chrishtr@chromium.org Bug: 907619 , 882663 Change-Id: If8b3680df6b52690c238f23a319591dd8e181add Reviewed-on: https://chromium-review.googlesource.com/c/1388159 Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Commit-Queue: vmpstr <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/master@{#619453} [modify] https://crrev.com/1266d1fbfe7bc8ea757a5a3712917b8be61a4ffb/third_party/blink/renderer/core/display_lock/BUILD.gn [modify] https://crrev.com/1266d1fbfe7bc8ea757a5a3712917b8be61a4ffb/third_party/blink/renderer/core/display_lock/display_lock_budget_test.cc [modify] https://crrev.com/1266d1fbfe7bc8ea757a5a3712917b8be61a4ffb/third_party/blink/renderer/core/display_lock/display_lock_context.cc [modify] https://crrev.com/1266d1fbfe7bc8ea757a5a3712917b8be61a4ffb/third_party/blink/renderer/core/display_lock/display_lock_context.h [add] https://crrev.com/1266d1fbfe7bc8ea757a5a3712917b8be61a4ffb/third_party/blink/renderer/core/display_lock/yielding_display_lock_budget.cc [add] https://crrev.com/1266d1fbfe7bc8ea757a5a3712917b8be61a4ffb/third_party/blink/renderer/core/display_lock/yielding_display_lock_budget.h
Comment 1 by vmp...@chromium.org
, Nov 21