#49706: feat: add support for long-animation-frame script attribution
Description of Change
Fixes #47630.
Backports https://crrev.com/c/7510894 (minus the test changes) and adds an Electron-specific test.
The change is guarded behind the AlwaysLogLOAFURL Chromium feature (--enable-features=AlwaysLogLOAFURL), which is disabled by default. Thus, the change is very low risk and safe to backport.
The backported CL makes it possible to get script attribution for long-animation-frame PerformanceObserver events in Electron apps.
long-animation-frame events can be used to debug UI freezes. Script attribution via the sourceURL attribute lets the application developer figure out which script is slow.
By default, script attribution is only available for http(s), blob, and data URLs. Electron apps use file:// or custom protocols. Hence, this feature is needed to get script attribution working in Electron apps.
Checklist
- PR description included
- I have built and tested this PR
-
npm testpasses - PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: Added support for long-animation-frame script attribution (via --enable-features=AlwaysLogLOAFURL).

Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron