Repository navigation
Commit 8037f06
Prepare to switch from WTF::Variant to std::variant
https://bugs.webkit.org/show_bug.cgi?id=231239
Patch by Alex Christensen <achristensen@webkit.org> on 2021-10-11
Reviewed by Chris Dumez.
Source/JavaScriptCore:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCallDOM):
* parser/Lexer.cpp:
(JSC::Lexer<T>::parseHex):
(JSC::Lexer<T>::parseBinary):
(JSC::Lexer<T>::parseOctal):
(JSC::Lexer<T>::parseDecimal):
* runtime/CachePayload.cpp:
(JSC::CachePayload::data const):
(JSC::CachePayload::size const):
* runtime/CacheUpdate.cpp:
(JSC::CacheUpdate::CacheUpdate):
Source/WebCore:
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::isolatedResponseBody):
(WebCore::DOMCacheEngine::copyResponseBody):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::loadingException const):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::sourceObjectStoreIdentifier const):
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::showMediaControlsContextMenu):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addIceCandidate):
* Modules/mediastream/RTCRtpTransform.cpp:
(WebCore::RTCRtpTransform::isAttached const):
(WebCore::operator==):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::videoSource):
(WebCore::LibWebRTCRtpSenderBackend::hasSource const):
(WebCore::operator==): Deleted.
* Modules/webxr/WebXRFrame.cpp:
(WebCore::WebXRFrame::getViewerPose):
* Modules/webxr/WebXRWebGLLayer.cpp:
(WebCore::WebXRWebGLLayer::canvas const):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::intPointAttributeValue const):
(WebCore::AXIsolatedObject::objectAttributeValue const):
(WebCore::AXIsolatedObject::rectAttributeValue const):
(WebCore::AXIsolatedObject::vectorAttributeValue const):
(WebCore::AXIsolatedObject::optionSetAttributeValue const):
(WebCore::AXIsolatedObject::pairAttributeValue const):
(WebCore::AXIsolatedObject::uint64AttributeValue const):
(WebCore::AXIsolatedObject::urlAttributeValue const):
(WebCore::AXIsolatedObject::pathAttributeValue const):
(WebCore::AXIsolatedObject::colorAttributeValue const):
(WebCore::AXIsolatedObject::floatAttributeValue const):
(WebCore::AXIsolatedObject::doubleAttributeValue const):
(WebCore::AXIsolatedObject::unsignedAttributeValue const):
* bindings/IDLTypes.h:
* bindings/js/JSDOMConvertWebGL.cpp:
(WebCore::convertToJSValue):
* bindings/js/JSPaymentMethodChangeEventCustom.cpp:
(WebCore::JSPaymentMethodChangeEvent::methodDetails const):
* bindings/js/JSValueInWrappedObject.h:
(WebCore::JSValueInWrappedObject::operator JSC::JSValue const):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontWeight):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::memoryCost const):
* editing/Editor.cpp:
(WebCore::Editor::advanceToNextMisspelling):
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::ExclusionRule::match const):
* html/URLSearchParams.cpp:
(WebCore::URLSearchParams::create):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::canvasContext const):
(WebCore::InspectorCanvas::canvasElement const):
(WebCore::InspectorCanvas::scriptExecutionContext const):
(WebCore::InspectorCanvas::buildObjectForCanvas):
(WebCore::InspectorCanvas::indexForData):
* inspector/InspectorShaderProgram.cpp:
(WebCore::InspectorShaderProgram::program const):
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::DataSegment::data const):
(WebCore::SharedBuffer::DataSegment::size const):
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::createCFData const):
(WebCore::SharedBuffer::hintMemoryNotNeededSoon const):
* platform/generic/KeyedDecoderGeneric.cpp:
(WebCore::KeyedDecoderGeneric::Dictionary::add):
(WebCore::KeyedDecoderGeneric::getPointerFromDictionaryStack):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfTrack):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::clone):
* platform/mock/MockMediaDevice.h:
(WebCore::MockMediaDevice::encode const):
* platform/network/FormData.cpp:
(WebCore::FormData::imageOrMediaFilesCount const):
(WebCore::FormDataElement::lengthInBytes const):
(WebCore::FormDataElement::isolatedCopy const):
(WebCore::FormData::appendData):
(WebCore::FormData::flatten const):
(WebCore::FormData::prepareForUpload):
(WebCore::FormData::asBlobURL const):
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::advanceCurrentStream):
(WebCore::setHTTPBody):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableSSLForHost):
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::read):
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateSoupMessageBody const):
* style/StyleResolveForFontRaw.cpp:
(WebCore::Style::resolveForFontRaw):
Source/WebKit:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
* Platform/IPC/FormDataReference.h:
(IPC::FormDataReference::encode const):
* Shared/mac/MediaFormatReader/MediaSampleCursor.cpp:
(WebKit::MediaSampleCursor::locateIterator const):
* UIProcess/API/APIWebAuthenticationPanel.h:
* UIProcess/Automation/SimulatedInputDispatcher.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.h:
Source/WTF:
This is the pieces of bug 231086 that can be done without changing behavior.
1. It makes WTF::get_if look more like std::get_if by taking a pointer to a variant instead of a reference.
2. std::visit is pickier than WTF::visit. The former allows taking lambdas with different return types as long
as the return types can be converted to the overall desired return type. std::visit has a static_assert that the
return types of all the lambdas are all exactly the same type, so I explicitly declare the return type of many lambdas.
3. It also resolves some types that will become ambiguous by using WTF::in_place,
which will become wrapped by std::in_place_type then removed.
4. It adds a few explicit WTF:: and #include <wtf/Variant.h> that will be needed after removing Variant from Forward.h.
5. It removes the fast malloc check in the one place a Variant is dynamically allocated in KeyedDecoderGeneric.cpp
(which is for non-cocoa platforms) because std::variant isn't fast allocated.
* wtf/LikelyDenseUnsignedIntegerSet.h:
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator* const):
* wtf/Variant.h:
(WTF::get_if):
Tools:
* TestWebKitAPI/Tests/WTF/Hasher.cpp:
(TestWebKitAPI::add):
* TestWebKitAPI/Tests/WTF/Variant.cpp:
(TestWebKitAPI::TEST):
Canonical link: https://commits.webkit.org/242780@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283906 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent 6ef3702 commit 8037f06
54 files changed
Lines changed: 341 additions & 189 deletions
File tree
- Source
- JavaScriptCore
- dfg
- parser
- runtime
- WTF
- wtf
- WebCore
- Modules
- cache
- fetch
- indexeddb
- mediacontrols
- mediastream
- libwebrtc
- webxr
- accessibility/isolatedtree
- bindings
- js
- css/parser
- dom
- editing
- html
- inspector
- platform
- cf
- generic
- graphics
- gstreamer
- texmap
- mock
- network
- cf
- curl
- soup
- style
- WebKit
- NetworkProcess
- Platform/IPC
- UIProcess
- API
- Automation
- Cocoa
- Tools
- TestWebKitAPI/Tests/WTF
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 | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
1 | 21 | | |
2 | 22 | | |
3 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10548 | 10548 | | |
10549 | 10549 | | |
10550 | 10550 | | |
10551 | | - | |
| 10551 | + | |
| 10552 | + | |
10552 | 10553 | | |
10553 | 10554 | | |
10554 | 10555 | | |
10555 | 10556 | | |
10556 | 10557 | | |
10557 | | - | |
| 10558 | + | |
10558 | 10559 | | |
10559 | 10560 | | |
10560 | 10561 | | |
10561 | 10562 | | |
10562 | 10563 | | |
10563 | 10564 | | |
10564 | 10565 | | |
10565 | | - | |
| 10566 | + | |
10566 | 10567 | | |
10567 | 10568 | | |
10568 | 10569 | | |
10569 | 10570 | | |
10570 | 10571 | | |
10571 | | - | |
| 10572 | + | |
10572 | 10573 | | |
10573 | 10574 | | |
10574 | 10575 | | |
10575 | 10576 | | |
10576 | 10577 | | |
10577 | | - | |
| 10578 | + | |
10578 | 10579 | | |
10579 | 10580 | | |
10580 | 10581 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1550 | 1550 | | |
1551 | 1551 | | |
1552 | 1552 | | |
1553 | | - | |
| 1553 | + | |
1554 | 1554 | | |
1555 | 1555 | | |
1556 | 1556 | | |
| |||
1609 | 1609 | | |
1610 | 1610 | | |
1611 | 1611 | | |
1612 | | - | |
| 1612 | + | |
1613 | 1613 | | |
1614 | 1614 | | |
1615 | 1615 | | |
| |||
1665 | 1665 | | |
1666 | 1666 | | |
1667 | 1667 | | |
1668 | | - | |
| 1668 | + | |
1669 | 1669 | | |
1670 | 1670 | | |
1671 | 1671 | | |
| |||
1724 | 1724 | | |
1725 | 1725 | | |
1726 | 1726 | | |
1727 | | - | |
| 1727 | + | |
1728 | 1728 | | |
1729 | 1729 | | |
1730 | 1730 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
66 | 65 | | |
67 | | - | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | | - | |
76 | | - | |
| 75 | + | |
77 | 76 | | |
78 | | - | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 41 | + | |
48 | 42 | | |
49 | 43 | | |
50 | 44 | | |
| |||
| 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 | + | |
1 | 25 | | |
2 | 26 | | |
3 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
| 208 | + | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
1822 | 1822 | | |
1823 | 1823 | | |
1824 | 1824 | | |
1825 | | - | |
1826 | | - | |
| 1825 | + | |
| 1826 | + | |
1827 | 1827 | | |
1828 | 1828 | | |
1829 | 1829 | | |
1830 | | - | |
1831 | | - | |
| 1830 | + | |
| 1831 | + | |
1832 | 1832 | | |
1833 | 1833 | | |
1834 | 1834 | | |
1835 | | - | |
1836 | | - | |
1837 | | - | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
1838 | 1838 | | |
1839 | 1839 | | |
1840 | 1840 | | |
1841 | | - | |
1842 | | - | |
1843 | | - | |
1844 | | - | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
1845 | 1845 | | |
1846 | 1846 | | |
1847 | 1847 | | |
| |||
| 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 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
1 | 106 | | |
2 | 107 | | |
3 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
0 commit comments