Skip to content

CredentialsContainer: performCommonChecks() should take const Document& instead of acquiring it internally#62256

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
marcoscaceres:ws/safer-cpp-performCommonChecks
Apr 8, 2026
Merged

CredentialsContainer: performCommonChecks() should take const Document& instead of acquiring it internally#62256
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
marcoscaceres:ws/safer-cpp-performCommonChecks

Conversation

@marcoscaceres
Copy link
Copy Markdown
Contributor

@marcoscaceres marcoscaceres commented Apr 8, 2026

acecc70

CredentialsContainer: performCommonChecks() should take const Document& instead of acquiring it internally
https://bugs.webkit.org/show_bug.cgi?id=311707
rdar://174293959

Reviewed by Chris Dumez.

Change performCommonChecks() to a static free function that takes
const Document& and returns bool. Callers acquire and null-check the
document themselves before calling it. This keeps the function name
semantically consistent, avoids ref churn, and removes the function
from the header entirely.

* Source/WebCore/Modules/credentialmanagement/CredentialsContainer.cpp:
* Source/WebCore/Modules/credentialmanagement/CredentialsContainer.h:

Canonical link: https://commits.webkit.org/310779@main

1ced303

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ⏳ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 🧪 win-tests ⏳ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe loading 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@marcoscaceres marcoscaceres self-assigned this Apr 8, 2026
@marcoscaceres marcoscaceres added the WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore). label Apr 8, 2026
@marcoscaceres marcoscaceres requested a review from annevk April 8, 2026 07:08
Comment thread Source/WebCore/Modules/credentialmanagement/CredentialsContainer.cpp Outdated
{
RefPtr document = this->document();
RefPtr document = m_document.get();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

RefPtr document = m_document; would compile nowadays.

@marcoscaceres marcoscaceres changed the title CredentialsContainer: performCommonChecks() should return RefPtr<Document> instead of bool CredentialsContainer: performCommonChecks() should take const Document& instead of acquiring it internally Apr 8, 2026
@marcoscaceres marcoscaceres force-pushed the ws/safer-cpp-performCommonChecks branch from 378a7fa to 1ced303 Compare April 8, 2026 07:26
@marcoscaceres marcoscaceres added the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label Apr 8, 2026
@webkit-ews-buildbot webkit-ews-buildbot added merge-queue Applied to send a pull request to merge-queue and removed safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Apr 8, 2026
@webkit-ews-buildbot
Copy link
Copy Markdown
Collaborator

Safe-Merge-Queue: Build #89010.

…t& instead of acquiring it internally

https://bugs.webkit.org/show_bug.cgi?id=311707
rdar://174293959

Reviewed by Chris Dumez.

Change performCommonChecks() to a static free function that takes
const Document& and returns bool. Callers acquire and null-check the
document themselves before calling it. This keeps the function name
semantically consistent, avoids ref churn, and removes the function
from the header entirely.

* Source/WebCore/Modules/credentialmanagement/CredentialsContainer.cpp:
* Source/WebCore/Modules/credentialmanagement/CredentialsContainer.h:

Canonical link: https://commits.webkit.org/310779@main
@webkit-commit-queue webkit-commit-queue force-pushed the ws/safer-cpp-performCommonChecks branch from 1ced303 to acecc70 Compare April 8, 2026 15:09
@webkit-commit-queue
Copy link
Copy Markdown
Collaborator

Committed 310779@main (acecc70): https://commits.webkit.org/310779@main

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

@webkit-commit-queue webkit-commit-queue merged commit acecc70 into WebKit:main Apr 8, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants