-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: pageVisibility
state when backgroundThrottling
disabled
#39223
Conversation
pageVisibility
state when backgroundThrottling
disabled
452e4b2
to
e0b922c
Compare
patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch
Show resolved
Hide resolved
- observer.OnPageVisibilityChanged(visibility_state); | ||
+ | ||
+ // If backgroundThrottling is disabled, the page is always visible. | ||
+ if (!scheduler_throttling_allowed_) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following style would reduce the number of lines of change and perhaps make the code clearer as well.
if (!scheduler_throttling_allowed_) {
GetPage()->SetVisibilityState(mojom::blink::PageVisibilityState::kVisible, is_initial_state);
GetPage()->GetPageScheduler()->SetPageVisible(true);
return;
}
Looks like this test surfaced a DCHECK that was present prior to this PR in |
e0b922c
to
3b37db2
Compare
3b37db2
to
9a90219
Compare
Release Notes Persisted
|
I was unable to backport this PR to "24-x-y" cleanly; |
I was unable to backport this PR to "26-x-y" cleanly; |
I was unable to backport this PR to "25-x-y" cleanly; |
@codebytere has manually backported this PR to "26-x-y", please check out #39298 |
@codebytere has manually backported this PR to "25-x-y", please check out #39299 |
…ctron#39223) fix: pageVisibility state when backgroundThrottling disabled
…ctron#39223) fix: pageVisibility state when backgroundThrottling disabled
Description of Change
Closes #39165.
Refs CL:2082213
Fixes an issue where the pageVisibility API returned incorrect values in some situations when
backgroundThrottling
was disabled. This happened when page lifecycle state began being managed on the browser side - our existing patch no longer covered all paths that changed the page visibility state. This should address that by ensuring that the page visibility is alwaysvisible
whenbackgroundThrottling
is disabled, and that thevisibilitychange
event is no longer emitted.Also allows us to re-enable the associated test.
Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where the pageVisibility API returned incorrect values in some situations when
backgroundThrottling
was disabled.