Skip to content

Conversation

@jelee53
Copy link
Contributor

@jelee53 jelee53 commented Jul 16, 2025

8829d30

Adopt smart pointers in DatabaseUtilities.cpp
https://bugs.webkit.org/show_bug.cgi?id=296074
rdar://155992246

Reviewed by NOBODY (OOPS!).

Apply https://github.com/WebKit/WebKit/wiki/Safer-CPP-Guidelines

* Source/WebKit/NetworkProcess/DatabaseUtilities.cpp:
(WebKit::DatabaseUtilities::openDatabaseAndCreateSchemaIfNecessary):
(WebKit::DatabaseUtilities::enableForeignKeys):
(WebKit::DatabaseUtilities::currentTableAndIndexQueries):
(WebKit::DatabaseUtilities::migrateDataToNewTablesIfNecessary):
(WebKit::DatabaseUtilities::columnsForTable):
(WebKit::DatabaseUtilities::addMissingColumnToTable):
* Source/WebKit/SaferCPPExpectations/UncheckedCallArgsCheckerExpectations:

8829d30

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ⏳ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ⏳ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@jelee53 jelee53 self-assigned this Jul 16, 2025
@jelee53 jelee53 added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Jul 16, 2025
https://bugs.webkit.org/show_bug.cgi?id=296074
rdar://155992246

Reviewed by NOBODY (OOPS!).

Apply https://github.com/WebKit/WebKit/wiki/Safer-CPP-Guidelines

* Source/WebKit/NetworkProcess/DatabaseUtilities.cpp:
(WebKit::DatabaseUtilities::openDatabaseAndCreateSchemaIfNecessary):
(WebKit::DatabaseUtilities::enableForeignKeys):
(WebKit::DatabaseUtilities::currentTableAndIndexQueries):
(WebKit::DatabaseUtilities::migrateDataToNewTablesIfNecessary):
(WebKit::DatabaseUtilities::columnsForTable):
(WebKit::DatabaseUtilities::addMissingColumnToTable):
* Source/WebKit/SaferCPPExpectations/UncheckedCallArgsCheckerExpectations:
@jelee53 jelee53 force-pushed the eng/Adopt-smart-pointers-in-DatabaseUtilities-cpp branch from 7142515 to 8829d30 Compare July 16, 2025 20:21
@jelee53 jelee53 marked this pull request as ready for review July 17, 2025 18:24
@jelee53 jelee53 requested a review from cdumez as a code owner July 17, 2025 18:24
@jelee53 jelee53 requested review from RupinMittal, pvollan and rniwa July 17, 2025 18:24
@jelee53
Copy link
Contributor Author

jelee53 commented Jul 17, 2025

This pull-request is being declined because the changes are unnecessary. Many of these variables were mis-identified as unsafe. The misidentification is-as so in which the analyzer identifies a variable that already lives on stack as unchecked.

function() {

auto statement = prepareStatement(...) or scopedStatement(...);

statement->doSomething; // analyzer incorrectly identifies as unsafe // statement already lives on stack and guaranteed to exist during function execution so no need to check lifetime
}

There is a separate tooling ticket filed to fix the Safer CPP analyzer.

@jelee53 jelee53 closed this Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Bugs Unclassified bugs are placed in this component until the correct component can be determined.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants