Skip to content

Reduce unsafeness of dom/ScriptExecutionContext #47023

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

Conversation

@annevk annevk requested review from rniwa and cdumez as code owners June 21, 2025 16:37
@annevk annevk self-assigned this Jun 21, 2025
@annevk annevk added the WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit). label Jun 21, 2025
@annevk annevk force-pushed the eng/Reduce-unsafeness-of-dom-ScriptExecutionContext branch from fa0f9cb to a7b6abb Compare June 21, 2025 16:59
@webkit-ews-buildbot
Copy link
Collaborator

Safer C++ Build #41149 (a7b6abb)

❌ Found 1 failing file with 1 issue. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

@webkit-ews-buildbot
Copy link
Collaborator

Safer C++ Build #41146 (fa0f9cb)

❌ Found 1 failing file with 1 issue. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 21, 2025
@annevk annevk marked this pull request as draft June 23, 2025 08:22
@annevk annevk removed the merging-blocked Applied to prevent a change from being merged label Jun 23, 2025
@annevk annevk force-pushed the eng/Reduce-unsafeness-of-dom-ScriptExecutionContext branch from a7b6abb to 579f171 Compare June 23, 2025 08:24
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 23, 2025
@webkit-ews-buildbot
Copy link
Collaborator

Safer C++ Build #41233 (579f171)

⚠️ Found 1 fixed file! Please update expectations in Source/[Project]/SaferCPPExpectations by running the following command and update your pull request:

  • Tools/Scripts/update-safer-cpp-expectations -p WebCore --UncheckedCallArgsChecker dom/ScriptExecutionContext.cpp --UncheckedLocalVarsChecker dom/ScriptExecutionContext.cpp --UncountedCallArgsChecker dom/ScriptExecutionContext.cpp

@annevk annevk removed the merging-blocked Applied to prevent a change from being merged label Jun 23, 2025
@annevk annevk force-pushed the eng/Reduce-unsafeness-of-dom-ScriptExecutionContext branch from 579f171 to 6f76138 Compare June 23, 2025 10:23
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 23, 2025
@webkit-ews-buildbot
Copy link
Collaborator

Safer C++ Build #41239 (6f76138)

⚠️ Found 1 fixed file! Please update expectations in Source/[Project]/SaferCPPExpectations by running the following command and update your pull request:

  • Tools/Scripts/update-safer-cpp-expectations -p WebCore --UncountedLocalVarsChecker dom/ScriptExecutionContext.cpp

@annevk annevk removed the merging-blocked Applied to prevent a change from being merged label Jun 23, 2025
@annevk annevk force-pushed the eng/Reduce-unsafeness-of-dom-ScriptExecutionContext branch from 6f76138 to 84c5410 Compare June 23, 2025 12:23
@annevk annevk marked this pull request as ready for review June 23, 2025 16:56
@@ -249,11 +250,11 @@ void ScriptExecutionContext::dispatchMessagePortEvents()
auto completionHandlers = std::exchange(m_processMessageWithMessagePortsSoonHandlers, Vector<CompletionHandler<void()>> { });

// Make a frozen copy of the ports so we can iterate while new ones might be added or destroyed.
for (auto* messagePort : copyToVector(m_messagePorts)) {
for (RefPtr messagePort : copyToVector(m_messagePorts)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use copyToVectorOf<RefPtr<MessagePort>> here because otherwise we're still iterating over a vector of raw pointers, which isn't great for safety.

@annevk annevk force-pushed the eng/Reduce-unsafeness-of-dom-ScriptExecutionContext branch from 84c5410 to 810d20b Compare June 23, 2025 17:13
@annevk annevk added the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label Jun 23, 2025
@webkit-ews-buildbot
Copy link
Collaborator

Failed api-wpe checks. Please resolve failures and re-apply safe-merge-queue label.

Rejecting #47023 from merge queue.

@webkit-ews-buildbot webkit-ews-buildbot removed the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label Jun 23, 2025
@webkit-ews-buildbot
Copy link
Collaborator

Safe-Merge-Queue: Build #61216.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 23, 2025
@annevk annevk added unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing and removed merging-blocked Applied to prevent a change from being merged labels Jun 24, 2025
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Reduce-unsafeness-of-dom-ScriptExecutionContext branch from 810d20b to 32c7f45 Compare June 24, 2025 04:58
@webkit-commit-queue
Copy link
Collaborator

Committed 296551@main (32c7f45): https://commits.webkit.org/296551@main

Reviewed commits have been landed. Closing PR #47023 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 32c7f45 into WebKit:main Jun 24, 2025
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Jun 24, 2025
@annevk annevk deleted the eng/Reduce-unsafeness-of-dom-ScriptExecutionContext branch June 24, 2025 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants