-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Reduce unsafeness of dom/ScriptExecutionContext #47023
Conversation
EWS run on previous version of this PR (hash fa0f9cb) |
fa0f9cb
to
a7b6abb
Compare
EWS run on previous version of this PR (hash a7b6abb) |
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. |
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. |
a7b6abb
to
579f171
Compare
EWS run on previous version of this PR (hash 579f171) |
Safer C++ Build #41233 (579f171)
|
579f171
to
6f76138
Compare
EWS run on previous version of this PR (hash 6f76138) |
Safer C++ Build #41239 (6f76138)
|
6f76138
to
84c5410
Compare
EWS run on previous version of this PR (hash 84c5410) |
@@ -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)) { |
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.
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.
84c5410
to
810d20b
Compare
EWS run on current version of this PR (hash 810d20b) |
Failed api-wpe checks. Please resolve failures and re-apply Rejecting #47023 from merge queue. |
Safe-Merge-Queue: Build #61216. |
https://bugs.webkit.org/show_bug.cgi?id=294800 Reviewed by Chris Dumez. Apply https://github.com/WebKit/WebKit/wiki/Safer-CPP-Guidelines Canonical link: https://commits.webkit.org/296551@main
810d20b
to
32c7f45
Compare
Committed 296551@main (32c7f45): https://commits.webkit.org/296551@main Reviewed commits have been landed. Closing PR #47023 and removing active labels. |
32c7f45
810d20b