Repository navigation
Commit a40f3a3
committed
Address safer C++ static analysis warnings in WKObject.h
https://bugs.webkit.org/show_bug.cgi?id=288056
Reviewed by Timothy Hatcher and Darin Adler.
- Replace API::ObjectStorage with a new WTF::AlignedStorage type
- WTF::AlignedStorage offers several benefits since it is strongly typed and it
doesn't rely on std::aligned_storage which is deprecated in C++23. Instead,
it uses `alignas(Alignment) std::byte m_storage[sizeof(T)];` which is the
suggested replacement in the standard. WTF::AlignedStorage also has the
benefit of hiding away the reinterpret_cast which is still required and
requirements suppression to silence static analysis
- The PR adopts WTF::AlignedStorage instead of std::aligned_storage in several
places too.
* Source/JavaScriptCore/dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::ensureCanInitializeWithZeros):
* Source/WTF/WTF.xcodeproj/project.pbxproj:
* Source/WTF/wtf/AlignedStorage.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKTargetedElementInfoInternal.h.
(WTF::sizeof):
* Source/WTF/wtf/HashTable.h:
(WTF::shouldValidateKey>::checkKey):
* Source/WTF/wtf/NeverDestroyed.h:
(WTF::NeverDestroyed::storagePointer const):
(WTF::LazyNeverDestroyed::storagePointerWithoutAccessCheck const):
* Source/WTF/wtf/RobinHoodHashTable.h:
(WTF::SizePolicy>::checkKey):
* Source/WTF/wtf/threads/Signals.h:
* Source/WebKit/SaferCPPExpectations/MemoryUnsafeCastCheckerExpectations:
* Source/WebKit/Shared/API/Cocoa/_WKFrameHandleInternal.h:
* Source/WebKit/Shared/API/Cocoa/_WKHitTestResultInternal.h:
* Source/WebKit/Shared/Cocoa/WKNSArray.mm:
* Source/WebKit/Shared/Cocoa/WKNSData.mm:
* Source/WebKit/Shared/Cocoa/WKNSDictionary.mm:
* Source/WebKit/Shared/Cocoa/WKNSNumber.mm:
* Source/WebKit/Shared/Cocoa/WKObject.h:
(API::ObjectStorage::get): Deleted.
(API::ObjectStorage::operator*): Deleted.
(API::ObjectStorage::operator->): Deleted.
* Source/WebKit/UIProcess/API/Cocoa/WKBackForwardList.mm:
* Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListItem.mm:
* Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStoreInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKContentWorldInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKDownloadInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKFrameInfoInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKNavigation.mm:
* Source/WebKit/UIProcess/API/Cocoa/WKNavigationActionInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKNavigationData.mm:
* Source/WebKit/UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKPreferencesInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKSecurityOriginInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKUserContentControllerInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKUserScriptInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionActionInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionCommandInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionContextInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionControllerConfigurationInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionControllerInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionDataRecordInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionMatchPatternInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionMessagePortInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWindowFeaturesInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifestInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKAttachmentInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKContentRuleListActionInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKContextMenuElementInfoInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKDataTaskInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKFeatureInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKFrameTreeNodeInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKInspectorConfigurationInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKInspectorDebuggableInfoInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKInspectorExtensionInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKInspectorInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfigurationInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKResourceLoadInfoInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstPartyInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdPartyInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKTargetedElementInfoInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKTargetedElementRequestInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKTextRunInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKUserInitiatedActionInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheetInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKVisitedLinkStoreInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponseInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionSidebarInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebPushDaemonConnectionInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebPushMessageInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebPushSubscriptionDataInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h:
* Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInCSSStyleDeclarationHandle.mm:
* Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
* Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
* Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
* Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
* Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
* Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
* Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
Canonical link: https://commits.webkit.org/290792@main1 parent 12c34ef commit a40f3a3
90 files changed
Lines changed: 243 additions & 121 deletions
File tree
- Source
- JavaScriptCore/dfg
- WTF
- SaferCPPExpectations
- WTF.xcodeproj
- wtf
- threads
- WebKit
- SaferCPPExpectations
- UIProcess/API/Cocoa
- WebProcess/InjectedBundle/API
- Cocoa
- mac
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
524 | 526 | | |
525 | 527 | | |
526 | 528 | | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
| 529 | + | |
| 530 | + | |
533 | 531 | | |
534 | 532 | | |
535 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
1247 | 1248 | | |
1248 | 1249 | | |
1249 | 1250 | | |
| 1251 | + | |
1250 | 1252 | | |
1251 | 1253 | | |
1252 | 1254 | | |
| |||
2161 | 2163 | | |
2162 | 2164 | | |
2163 | 2165 | | |
| 2166 | + | |
2164 | 2167 | | |
2165 | 2168 | | |
2166 | 2169 | | |
| |||
3245 | 3248 | | |
3246 | 3249 | | |
3247 | 3250 | | |
| 3251 | + | |
3248 | 3252 | | |
3249 | 3253 | | |
3250 | 3254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
650 | 651 | | |
651 | 652 | | |
652 | 653 | | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
| 654 | + | |
| 655 | + | |
658 | 656 | | |
659 | 657 | | |
660 | 658 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | | - | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
105 | | - | |
106 | | - | |
| 105 | + | |
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
| |||
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
155 | | - | |
| 154 | + | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
| |||
176 | 175 | | |
177 | 176 | | |
178 | 177 | | |
179 | | - | |
180 | | - | |
181 | | - | |
| 178 | + | |
182 | 179 | | |
183 | 180 | | |
184 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
| 329 | + | |
| 330 | + | |
333 | 331 | | |
334 | 332 | | |
335 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 84 | + | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
0 commit comments