-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Address safer CPP warnings in NetworkSessionCocoa #47231
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
Address safer CPP warnings in NetworkSessionCocoa #47231
Conversation
EWS run on previous version of this PR (hash 86069d2) |
configuration.get().connectionProxyDictionary = (NSDictionary *)parameters.proxyConfiguration.get() ?: proxyDictionary(parameters.httpProxy, parameters.httpsProxy).get(); | ||
configuration.get().connectionProxyDictionary = RetainPtr<NSDictionary> { (NSDictionary*)parameters.proxyConfiguration.get() }.get() ?: proxyDictionary(parameters.httpProxy, parameters.httpsProxy).get(); |
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 would specially appreciate comments on this one, I am not sure this is the best approach or if it will suffice to address the warning.
86069d2
to
4278a1b
Compare
EWS run on previous version of this PR (hash 4278a1b) |
Safer C++ Build #41671 (4278a1b)❌ Found 1 failing file with 3 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming. |
4278a1b
to
e636cba
Compare
EWS run on previous version of this PR (hash e636cba) |
Safer C++ Build #41678 (e636cba)❌ Found 1 failing file with 1 issue. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming. |
@rniwa there was a way to suppress these, right? https://ews-build.s3-us-west-2.amazonaws.com/macOS-Safer-CPP-Checks-EWS/e636cba0-41678/scan-build-output/StaticAnalyzerRegressions/WebKitLegacy/StaticAnalyzerReports/report-NetworkSessionCocoa.mm-createWebSocketTask-17-bad1e3.html#EndPath |
Oh weird. I thought added the support for recognizing those constants. Anyhow, you can suppress it with |
e636cba
to
a2b4861
Compare
EWS run on current version of this PR (hash a2b4861) |
Ping reviewers. |
Safe-Merge-Queue: Build #61859. |
https://bugs.webkit.org/show_bug.cgi?id=295023 Reviewed by Chris Dumez. WebSocketTaskCocoa needs to inherit from thread-safe checked pointer class for it to safely be able to use CheckedPtr, so do that as well. * Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (processServerTrustEvaluation): (-[WKNetworkSessionDelegate sessionFromTask:]): (NetworkSessionCocoa::setClientAuditToken): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]): (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]): (-[WKNetworkSessionDelegate URLSession:webSocketTask:didOpenWithProtocol:]): (-[WKNetworkSessionDelegate URLSession:webSocketTask:didCloseWithCode:reason:]): (WebKit::proxyDictionary): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::SessionSet::isolatedSession): (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge): (WebKit::NetworkSessionCocoa::createWebSocketTask): (WebKit::NetworkSessionCocoa::forEachSessionWrapper): * Source/WebKit/NetworkProcess/cocoa/WebSocketTaskCocoa.h: * Source/WebKit/SaferCPPExpectations/UncheckedCallArgsCheckerExpectations: * Source/WebKit/SaferCPPExpectations/UncheckedLocalVarsCheckerExpectations: * Source/WebKit/SaferCPPExpectations/UnretainedCallArgsCheckerExpectations: Canonical link: https://commits.webkit.org/296794@main
a2b4861
to
200dfcc
Compare
Committed 296794@main (200dfcc): https://commits.webkit.org/296794@main Reviewed commits have been landed. Closing PR #47231 and removing active labels. |
200dfcc
a2b4861