Emmanuel Romero RuizThanks! Could you point me to a discussion about no longer requiring cross-origin isolation for layout and style? This has security implications so I'd like to better understand the context.
Camille LamyWe started with an explainer that we published in MSEdgeExplainers https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ConditionalMarkersExposure/explainer.md
Then, at the same time, we updated the initial Marker & security thread with our proposal https://github.com/WICG/js-self-profiling/issues/61#issuecomment-982872415 and asked Andrew Comminos for feedback and help to land this PR on the JS Self Profiler repo https://github.com/WICG/js-self-profiling/pull/85.
He mentioned that the proposal made sense, but it would be good to have feedback from other people that collaborated on the initial feature.
Emmanuel Romero RuizThanks for the context. I think it would be helpful to explain in more details when the markers are triggered, and why it's already possible to observe them. Right now, it's not clear to me when the layout and style events are added, and whether the occurences would always be observable.
Thanks for the feedback. You're right, I updated the description to include more
detail on why the timing of these events is already visible.
With this change their occurrences would always be observable when the flag for
markers is enabled. I added a section for this.
For this CL, I'll note that implementation is pending spec approval and your
comments would be very valuable in that PR https://github.com/WICG/js-self-profiling/pull/85.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Bringing some attention to the code change
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Adding @tn...@chromium.org as a reviewer as a suggestion from Victor Huang
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
My bad, adding @toyo...@chromium.org to see if he can help with some comments on the change
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
default:adding default in case is not future change proof and discouraged, but as this seems a common pattern in this header, lgtm.
const bool are_markers_enabled =used only once. can we just inline?
ExecutionContext* execution_context = ExecutionContext::From(script_state_);Potentially could be nullptr?
const bool is_cross_origin_isolated =same, inlined?
marker = ProfileMarkerToPublicMarker(*marker);may be optimized out, but could be marker->AsEnum() and changed the method to take a V8ProfilerMarker::Enum instead?
blink::SetIsCrossOriginIsolated(true);should this be reset in TearDown() to avoid cross-test unexpected side-effect?
[RuntimeEnabled=ExperimentalJSProfilerMarkers, CrossOriginIsolated] ProfilerMarker marker;This part may be also noted in the CL description? Maybe update the last changes part ``` Changes: ...
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thank you very much for the comments. I just address them all
adding default in case is not future change proof and discouraged, but as this seems a common pattern in this header, lgtm.
Done
used only once. can we just inline?
Done
ExecutionContext* execution_context = ExecutionContext::From(script_state_);Emmanuel Romero RuizPotentially could be nullptr?
Done
const bool is_cross_origin_isolated =Emmanuel Romero Ruizsame, inlined?
Done
may be optimized out, but could be marker->AsEnum() and changed the method to take a V8ProfilerMarker::Enum instead?
Done
should this be reset in TearDown() to avoid cross-test unexpected side-effect?
Done
[RuntimeEnabled=ExperimentalJSProfilerMarkers, CrossOriginIsolated] ProfilerMarker marker;This part may be also noted in the CL description? Maybe update the last changes part ``` Changes: ...
- Check ExperimentalJSProfilerMarkersEnabled flag at runtime
- ```
- to say that the marker is always exposed to JS now?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
ProfilerMarker marker;Do we want to also update /third_party/blink/web_tests/external/wpt/interfaces/js-self-profiling.idl?
And, do we plan to add WPT tests for the change, or test updates to be in some separate CL or spec CL?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Do we want to also update /third_party/blink/web_tests/external/wpt/interfaces/js-self-profiling.idl?
And, do we plan to add WPT tests for the change, or test updates to be in some separate CL or spec CL?
This IDL file is auto-generated from the spec by Reffy/webref, so it should not be modified here. It will update automatically once the spec PR lands: https://github.com/WICG/js-self-profiling/pull/85
For WPT tests, I filed https://issues.chromium.org/issues/498095296 to track adding them in a follow-up CL.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
[JS Self-Profiling] Allow safe markers in non-isolated contexts
This CL moves marker exposure logic from IDL to runtime, enabling layout
and style markers in non-Cross-Origin-Isolated contexts.
Previously, all markers required COI through the IDL attribute. Now
ProfilerTraceBuilder filters markers at runtime based on both the
feature flag and the execution context's isolation status.
Changes:
- Remove [CrossOriginIsolated] IDL attribute from profiler_sample.idl;
marker field is now always exposed to JS
- Add GetMarker() method for runtime marker filtering
- Implement ProfileMarkerToPublicMarker() for safe marker selection
- Cache COI status in ProfilerTraceBuilder at construction time
- Check ExperimentalJSProfilerMarkersEnabled flag at runtime to filter
markers
Marker availability:
- COI contexts: All markers (gc, layout, paint, script, style)
- Non-COI contexts: Only layout and style markers
- Feature disabled: No markers exposed
Layout and style markers are safe without COI because their timing is
already observable through:
- Layout: getBoundingClientRect(), offsetHeight, ResizeObserver
- Style: getComputedStyle(), MutationObserver, CSSOM
This provides useful performance data in regular contexts while keeping
sensitive markers behind COI.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |