Expose initiator-url in resourceTiming for more resources #57009
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TaskAttribution is extended to track `initiator-url".
The progress of the "initiatorUrl" reporting after this CL is the below:
A) Supported:
(1) Any static resource from a html file;
(2) Resources fetched in script, in main thread, that's not
an imported script, under the condition that the resource fetch
happens after script loading or beyond a number of common ways
to dispatch an asynchronous call: postTask(); fulfillments of
a promise; queueMicrotask(); requestAnimationFrame();
requestIdleCallback(); setInterval(); setTimeout();
XMLHttpRequest();
B) Not Supported yet but planned:
(1) CSS resources that are initiated from another CSS file;
(2) Script resources that are imported JS;
(3) Resources fetched in the main thread, by the script that are
dispatched via an EventHandler, or a MessageHandler;
(4) Resource fetched by script running in a worker thread;
C) Not planned to support: any rare cases that requires significant
efforts, and any resources fetched via deprecated APIs. Example:
(1) document.write();
(2) Resources fetched in the main thread, by the script that are
dispatched via rarely used asynchronous calls.
In addition, previous tests are re-organized and refactored.
Credit to previous contributor: Some "inline-script" test cases are
merged from(with significant modification):
https://chromium-review.googlesource.com/c/chromium/src/+/4812813 And
For script initiators, TaskAttributionInfo is used according to this
draft CL:
https://chromium-review.googlesource.com/c/chromium/src/+/4931296/21
PERFETTO_TESTS=
autoninja -C out/Default perfetto_diff_tests && out/Default/bin/run_perfetto_diff_testsBug: 40919714
Change-Id: I125e62d488eec5a85f8afa6cd61c399183c56d86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6960132
Commit-Queue: Guohui Deng <[email protected]>
Reviewed-by: Scott Haseley <[email protected]>
Reviewed-by: Mikhail Khokhlov <[email protected]>
Reviewed-by: Michal Mocny <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1565205}