Commit d29dc2d1 authored by Francois Doray's avatar Francois Doray Committed by Commit Bot

[blink scheduler] Allow unaligned wake ups in same-origin frames.

This CL uses the unaligned wake ups setting added to WakeUpBudgetPool
in https://crrev.com/c/2249377 to allow unaligned wake ups in
frames that are same-origin with the main frame.

This completes implementation of the policy presented in this
message: https://groups.google.com/a/chromium.org/g/blink-dev/c/8En_5DqV_fU/m/z0Xth2xLAgAJ

Bug: 1075553
Change-Id: I1ac00f1efc58f1a701120514fb7ca4dcca94ba9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2252935
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782051}
parent f5a55d4e
......@@ -18,6 +18,7 @@
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/scheduler/common/features.h"
#include "third_party/blink/renderer/platform/scheduler/common/throttling/budget_pool.h"
#include "third_party/blink/renderer/platform/scheduler/common/throttling/task_queue_throttler.h"
#include "third_party/blink/renderer/platform/scheduler/main_thread/auto_advancing_virtual_time_domain.h"
#include "third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.h"
#include "third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h"
......@@ -637,9 +638,14 @@ void PageSchedulerImpl::MaybeInitializeWakeUpBudgetPools(
main_thread_scheduler_->task_queue_throttler()->CreateWakeUpBudgetPool(
"Page Wake Up Throttling - Cross-Origin to Main Frame");
// The Wake Up Interval is set in UpdateWakeUpBudgetPools(), based on current
// state. The Wake Up Duration is constant and is set here.
// The Wake Up Duration and Unaligned Wake Ups Allowance are constant and set
// here. The Wake Up Interval is set in UpdateWakeUpBudgetPools(), based on
// current state.
same_origin_wake_up_budget_pool_->SetWakeUpDuration(kThrottledWakeUpDuration);
if (IsIntensiveWakeUpThrottlingEnabled()) {
same_origin_wake_up_budget_pool_->AllowUnalignedWakeUpIfNoRecentWakeUp();
}
cross_origin_wake_up_budget_pool_->SetWakeUpDuration(
kThrottledWakeUpDuration);
......
......@@ -286,9 +286,6 @@ class PLATFORM_EXPORT PageSchedulerImpl : public PageScheduler {
//
// This pool allows aligned wake ups and unaligned wake ups if there hasn't
// been a recent wake up.
//
// TODO(https://crbug.com/1075553): Implement unaligned wake ups if there
// hasn't been a recent wake up.
WakeUpBudgetPool* same_origin_wake_up_budget_pool_;
// Throttles wake ups in throttleable TaskQueues of frames that are
// cross-origin with the main frame.
......
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