Skip to content

Commit 8037f06

Browse files
Alex Christensenwebkit-commit-queue
authored andcommitted
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-d52691b4dbfc
1 parent 6ef3702 commit 8037f06

54 files changed

Lines changed: 341 additions & 189 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
2021-10-11 Alex Christensen <achristensen@webkit.org>
2+
3+
Prepare to switch from WTF::Variant to std::variant
4+
https://bugs.webkit.org/show_bug.cgi?id=231239
5+
6+
Reviewed by Chris Dumez.
7+
8+
* dfg/DFGSpeculativeJIT.cpp:
9+
(JSC::DFG::SpeculativeJIT::compileCallDOM):
10+
* parser/Lexer.cpp:
11+
(JSC::Lexer<T>::parseHex):
12+
(JSC::Lexer<T>::parseBinary):
13+
(JSC::Lexer<T>::parseOctal):
14+
(JSC::Lexer<T>::parseDecimal):
15+
* runtime/CachePayload.cpp:
16+
(JSC::CachePayload::data const):
17+
(JSC::CachePayload::size const):
18+
* runtime/CacheUpdate.cpp:
19+
(JSC::CacheUpdate::CacheUpdate):
20+
121
2021-10-11 Keith Miller <keith_miller@apple.com>
222

323
SourceID should have a type name and only be 32-bits

‎Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10548,33 +10548,34 @@ void SpeculativeJIT::compileCallDOM(Node* node)
1054810548

1054910549
// FIXME: We should have a way to call functions with the vector of registers.
1055010550
// https://bugs.webkit.org/show_bug.cgi?id=163099
10551-
Vector<Variant<SpeculateCellOperand, SpeculateInt32Operand, SpeculateBooleanOperand>, JSC_DOMJIT_SIGNATURE_MAX_ARGUMENTS_INCLUDING_THIS> operands;
10551+
using OperandVariant = Variant<SpeculateCellOperand, SpeculateInt32Operand, SpeculateBooleanOperand>;
10552+
Vector<OperandVariant, JSC_DOMJIT_SIGNATURE_MAX_ARGUMENTS_INCLUDING_THIS> operands;
1055210553
Vector<GPRReg, JSC_DOMJIT_SIGNATURE_MAX_ARGUMENTS_INCLUDING_THIS> regs;
1055310554

1055410555
auto appendCell = [&](Edge& edge) {
1055510556
SpeculateCellOperand operand(this, edge);
1055610557
regs.append(operand.gpr());
10557-
operands.append(WTFMove(operand));
10558+
operands.append(OperandVariant(WTF::in_place<SpeculateCellOperand>, WTFMove(operand)));
1055810559
};
1055910560

1056010561
auto appendString = [&](Edge& edge) {
1056110562
SpeculateCellOperand operand(this, edge);
1056210563
GPRReg gpr = operand.gpr();
1056310564
regs.append(gpr);
1056410565
speculateString(edge, gpr);
10565-
operands.append(WTFMove(operand));
10566+
operands.append(OperandVariant(WTF::in_place<SpeculateCellOperand>, WTFMove(operand)));
1056610567
};
1056710568

1056810569
auto appendInt32 = [&](Edge& edge) {
1056910570
SpeculateInt32Operand operand(this, edge);
1057010571
regs.append(operand.gpr());
10571-
operands.append(WTFMove(operand));
10572+
operands.append(OperandVariant(WTF::in_place<SpeculateInt32Operand>, WTFMove(operand)));
1057210573
};
1057310574

1057410575
auto appendBoolean = [&](Edge& edge) {
1057510576
SpeculateBooleanOperand operand(this, edge);
1057610577
regs.append(operand.gpr());
10577-
operands.append(WTFMove(operand));
10578+
operands.append(OperandVariant(WTF::in_place<SpeculateBooleanOperand>, WTFMove(operand)));
1057810579
};
1057910580

1058010581
unsigned index = 0;

‎Source/JavaScriptCore/parser/Lexer.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ ALWAYS_INLINE auto Lexer<T>::parseHex() -> std::optional<NumberParseResult>
15501550
} while (isASCIIHexDigitOrSeparator(m_current) && maximumDigits >= 0);
15511551

15521552
if (LIKELY(maximumDigits >= 0 && m_current != 'n'))
1553-
return NumberParseResult { hexValue };
1553+
return NumberParseResult { static_cast<double>(hexValue) };
15541554

15551555
// No more place in the hexValue buffer.
15561556
// The values are shifted out and placed into the m_buffer8 vector.
@@ -1609,7 +1609,7 @@ ALWAYS_INLINE auto Lexer<T>::parseBinary() -> std::optional<NumberParseResult>
16091609
} while (isASCIIBinaryDigitOrSeparator(m_current) && digit >= 0);
16101610

16111611
if (LIKELY(!isASCIIDigitOrSeparator(m_current) && digit >= 0 && m_current != 'n'))
1612-
return NumberParseResult { binaryValue };
1612+
return NumberParseResult { static_cast<double>(binaryValue) };
16131613

16141614
for (int i = maximumDigits - 1; i > digit; --i)
16151615
record8(digits[i]);
@@ -1665,7 +1665,7 @@ ALWAYS_INLINE auto Lexer<T>::parseOctal() -> std::optional<NumberParseResult>
16651665
} while (isASCIIOctalDigitOrSeparator(m_current) && digit >= 0);
16661666

16671667
if (LIKELY(!isASCIIDigitOrSeparator(m_current) && digit >= 0 && m_current != 'n'))
1668-
return NumberParseResult { octalValue };
1668+
return NumberParseResult { static_cast<double>(octalValue) };
16691669

16701670
for (int i = maximumDigits - 1; i > digit; --i)
16711671
record8(digits[i]);
@@ -1724,7 +1724,7 @@ ALWAYS_INLINE auto Lexer<T>::parseDecimal() -> std::optional<NumberParseResult>
17241724
} while (isASCIIDigitOrSeparator(m_current) && digit >= 0);
17251725

17261726
if (digit >= 0 && m_current != '.' && !isASCIIAlphaCaselessEqual(m_current, 'e') && m_current != 'n')
1727-
return NumberParseResult { decimalValue };
1727+
return NumberParseResult { static_cast<double>(decimalValue) };
17281728

17291729
for (int i = maximumDigits - 1; i > digit; --i)
17301730
record8(digits[i]);

‎Source/JavaScriptCore/runtime/CachePayload.cpp‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,21 @@ const uint8_t* CachePayload::data() const
6161
return WTF::switchOn(m_data,
6262
[](const FileSystem::MappedFileData& data) {
6363
return static_cast<const uint8_t*>(data.data());
64-
},
65-
[](const std::pair<MallocPtr<uint8_t, VMMalloc>, size_t>& data) {
64+
}, [](const std::pair<MallocPtr<uint8_t, VMMalloc>, size_t>& data) -> const uint8_t* {
6665
return data.first.get();
67-
});
66+
}
67+
);
6868
}
6969

7070
size_t CachePayload::size() const
7171
{
7272
return WTF::switchOn(m_data,
73-
[](const FileSystem::MappedFileData& data) {
73+
[](const FileSystem::MappedFileData& data) -> size_t {
7474
return data.size();
75-
},
76-
[](const std::pair<MallocPtr<uint8_t, VMMalloc>, size_t>& data) {
75+
}, [](const std::pair<MallocPtr<uint8_t, VMMalloc>, size_t>& data) -> size_t {
7776
return data.second;
78-
});
77+
}
78+
);
7979
}
8080

8181
} // namespace JSC

‎Source/JavaScriptCore/runtime/CacheUpdate.cpp‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ CacheUpdate::CacheUpdate(FunctionUpdate&& update)
3838
{
3939
}
4040

41-
CacheUpdate::CacheUpdate(CacheUpdate&& other)
42-
{
43-
if (WTF::holds_alternative<GlobalUpdate>(other.m_update))
44-
new (this) CacheUpdate(WTFMove(WTF::get<GlobalUpdate>(other.m_update)));
45-
else
46-
new (this) CacheUpdate(WTFMove(WTF::get<FunctionUpdate>(other.m_update)));
47-
}
41+
CacheUpdate::CacheUpdate(CacheUpdate&&) = default;
4842

4943
CacheUpdate& CacheUpdate::operator=(CacheUpdate&& other)
5044
{

‎Source/WTF/ChangeLog‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2021-10-11 Alex Christensen <achristensen@webkit.org>
2+
3+
Prepare to switch from WTF::Variant to std::variant
4+
https://bugs.webkit.org/show_bug.cgi?id=231239
5+
6+
Reviewed by Chris Dumez.
7+
8+
This is the pieces of bug 231086 that can be done without changing behavior.
9+
10+
1. It makes WTF::get_if look more like std::get_if by taking a pointer to a variant instead of a reference.
11+
2. std::visit is pickier than WTF::visit. The former allows taking lambdas with different return types as long
12+
as the return types can be converted to the overall desired return type. std::visit has a static_assert that the
13+
return types of all the lambdas are all exactly the same type, so I explicitly declare the return type of many lambdas.
14+
3. It also resolves some types that will become ambiguous by using WTF::in_place,
15+
which will become wrapped by std::in_place_type then removed.
16+
4. It adds a few explicit WTF:: and #include <wtf/Variant.h> that will be needed after removing Variant from Forward.h.
17+
5. It removes the fast malloc check in the one place a Variant is dynamically allocated in KeyedDecoderGeneric.cpp
18+
(which is for non-cocoa platforms) because std::variant isn't fast allocated.
19+
20+
* wtf/LikelyDenseUnsignedIntegerSet.h:
21+
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator* const):
22+
* wtf/Variant.h:
23+
(WTF::get_if):
24+
125
2021-10-08 Tim Horton <timothy_horton@apple.com>
226

327
defaultAlternateFormControlDesignEnabled() can't read UIUserInterfaceIdiom in the Web Content process

‎Source/WTF/wtf/LikelyDenseUnsignedIntegerSet.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ class LikelyDenseUnsignedIntegerSet {
205205
IndexType operator*() const
206206
{
207207
return WTF::switchOn(m_underlying,
208-
[&](const BitVector::iterator& it) { return *it + m_shift; },
209-
[](const typename Set::iterator& it) { return *it; });
208+
[&](const BitVector::iterator& it) -> IndexType { return *it + m_shift; },
209+
[](const typename Set::iterator& it) -> IndexType { return *it; });
210210
}
211211

212212
bool operator==(const iterator& other) const

‎Source/WTF/wtf/Variant.h‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,17 @@ constexpr const typename __indexed_type<_Index, _Types...>::__type &&
238238
get(Variant<_Types...> const &&);
239239

240240
template<typename _Type,typename ... _Types>
241-
constexpr std::add_pointer_t<_Type> get_if(Variant<_Types...>&);
241+
constexpr std::add_pointer_t<_Type> get_if(Variant<_Types...>*);
242242

243243
template<typename _Type,typename ... _Types>
244-
constexpr std::add_pointer_t<_Type const> get_if(Variant<_Types...> const&);
244+
constexpr std::add_pointer_t<_Type const> get_if(Variant<_Types...> const*);
245245

246246
template<ptrdiff_t _Index,typename ... _Types>
247-
constexpr std::add_pointer_t<typename __indexed_type<_Index,_Types...>::__type> get_if(Variant<_Types...>&);
247+
constexpr std::add_pointer_t<typename __indexed_type<_Index, _Types...>::__type> get_if(Variant<_Types...>*);
248248

249249
template<ptrdiff_t _Index,typename ... _Types>
250250
constexpr std::add_pointer_t<typename __indexed_type<_Index,_Types...>::__type const> get_if(
251-
Variant<_Types...> const&);
251+
Variant<_Types...> const*);
252252

253253
template<ptrdiff_t _Index,typename ... _Types>
254254
struct __variant_accessor;
@@ -1822,26 +1822,26 @@ constexpr const typename __indexed_type<_Index,_Types...>::__type&& get(Variant<
18221822
}
18231823

18241824
template<typename _Type,typename ... _Types>
1825-
constexpr std::add_pointer_t<_Type> get_if(Variant<_Types...>& __v){
1826-
return (__type_index<_Type,_Types...>::__value!=__v.index())?nullptr:std::addressof(get<_Type>(__v));
1825+
constexpr std::add_pointer_t<_Type> get_if(Variant<_Types...>* __v) {
1826+
return (__type_index<_Type, _Types...>::__value != __v->index()) ? nullptr : std::addressof(get<_Type>(*__v));
18271827
}
18281828

18291829
template<typename _Type,typename ... _Types>
1830-
constexpr std::add_pointer_t<_Type const> get_if(Variant<_Types...> const& __v){
1831-
return (__type_index<_Type,_Types...>::__value!=__v.index())?nullptr:std::addressof(get<_Type>(__v));
1830+
constexpr std::add_pointer_t<_Type const> get_if(Variant<_Types...> const* __v) {
1831+
return (__type_index<_Type, _Types...>::__value != __v->index()) ? nullptr : std::addressof(get<_Type>(*__v));
18321832
}
18331833

18341834
template<ptrdiff_t _Index,typename ... _Types>
1835-
constexpr std::add_pointer_t<typename __indexed_type<_Index,_Types...>::__type> get_if(Variant<_Types...>& __v){
1836-
return ((_Index!=__v.index())?nullptr:
1837-
std::addressof(__variant_accessor<_Index,_Types...>::get(__v)));
1835+
constexpr std::add_pointer_t<typename __indexed_type<_Index, _Types...>::__type> get_if(Variant<_Types...>* __v) {
1836+
return ((_Index != __v->index()) ? nullptr :
1837+
std::addressof(__variant_accessor<_Index, _Types...>::get(*__v)));
18381838
}
18391839

18401840
template<ptrdiff_t _Index,typename ... _Types>
1841-
constexpr std::add_pointer_t<typename __indexed_type<_Index,_Types...>::__type const> get_if(
1842-
Variant<_Types...> const& __v){
1843-
return ((_Index!=__v.index())?nullptr:
1844-
std::addressof(__variant_accessor<_Index,_Types...>::get(__v)));
1841+
constexpr std::add_pointer_t<typename __indexed_type<_Index, _Types...>::__type const> get_if(
1842+
Variant<_Types...> const* __v) {
1843+
return ((_Index != __v->index()) ? nullptr :
1844+
std::addressof(__variant_accessor<_Index, _Types...>::get(*__v)));
18451845
}
18461846

18471847
template<typename _Type,typename ... _Types>

‎Source/WebCore/ChangeLog‎

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,108 @@
1+
2021-10-11 Alex Christensen <achristensen@webkit.org>
2+
3+
Prepare to switch from WTF::Variant to std::variant
4+
https://bugs.webkit.org/show_bug.cgi?id=231239
5+
6+
Reviewed by Chris Dumez.
7+
8+
* Modules/cache/DOMCacheEngine.cpp:
9+
(WebCore::DOMCacheEngine::isolatedResponseBody):
10+
(WebCore::DOMCacheEngine::copyResponseBody):
11+
* Modules/fetch/FetchBodyOwner.cpp:
12+
(WebCore::FetchBodyOwner::loadingException const):
13+
* Modules/indexeddb/IDBRequest.cpp:
14+
(WebCore::IDBRequest::sourceObjectStoreIdentifier const):
15+
* Modules/mediacontrols/MediaControlsHost.cpp:
16+
(WebCore::MediaControlsHost::showMediaControlsContextMenu):
17+
* Modules/mediastream/RTCPeerConnection.cpp:
18+
(WebCore::RTCPeerConnection::addIceCandidate):
19+
* Modules/mediastream/RTCRtpTransform.cpp:
20+
(WebCore::RTCRtpTransform::isAttached const):
21+
(WebCore::operator==):
22+
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
23+
(WebCore::LibWebRTCRtpSenderBackend::videoSource):
24+
(WebCore::LibWebRTCRtpSenderBackend::hasSource const):
25+
(WebCore::operator==): Deleted.
26+
* Modules/webxr/WebXRFrame.cpp:
27+
(WebCore::WebXRFrame::getViewerPose):
28+
* Modules/webxr/WebXRWebGLLayer.cpp:
29+
(WebCore::WebXRWebGLLayer::canvas const):
30+
* accessibility/isolatedtree/AXIsolatedObject.cpp:
31+
(WebCore::AXIsolatedObject::intPointAttributeValue const):
32+
(WebCore::AXIsolatedObject::objectAttributeValue const):
33+
(WebCore::AXIsolatedObject::rectAttributeValue const):
34+
(WebCore::AXIsolatedObject::vectorAttributeValue const):
35+
(WebCore::AXIsolatedObject::optionSetAttributeValue const):
36+
(WebCore::AXIsolatedObject::pairAttributeValue const):
37+
(WebCore::AXIsolatedObject::uint64AttributeValue const):
38+
(WebCore::AXIsolatedObject::urlAttributeValue const):
39+
(WebCore::AXIsolatedObject::pathAttributeValue const):
40+
(WebCore::AXIsolatedObject::colorAttributeValue const):
41+
(WebCore::AXIsolatedObject::floatAttributeValue const):
42+
(WebCore::AXIsolatedObject::doubleAttributeValue const):
43+
(WebCore::AXIsolatedObject::unsignedAttributeValue const):
44+
* bindings/IDLTypes.h:
45+
* bindings/js/JSDOMConvertWebGL.cpp:
46+
(WebCore::convertToJSValue):
47+
* bindings/js/JSPaymentMethodChangeEventCustom.cpp:
48+
(WebCore::JSPaymentMethodChangeEvent::methodDetails const):
49+
* bindings/js/JSValueInWrappedObject.h:
50+
(WebCore::JSValueInWrappedObject::operator JSC::JSValue const):
51+
* css/parser/CSSPropertyParser.cpp:
52+
(WebCore::consumeFontWeight):
53+
* dom/MessageEvent.cpp:
54+
(WebCore::MessageEvent::memoryCost const):
55+
* editing/Editor.cpp:
56+
(WebCore::Editor::advanceToNextMisspelling):
57+
* editing/TextManipulationController.cpp:
58+
(WebCore::TextManipulationController::ExclusionRule::match const):
59+
* html/URLSearchParams.cpp:
60+
(WebCore::URLSearchParams::create):
61+
* inspector/InspectorCanvas.cpp:
62+
(WebCore::InspectorCanvas::canvasContext const):
63+
(WebCore::InspectorCanvas::canvasElement const):
64+
(WebCore::InspectorCanvas::scriptExecutionContext const):
65+
(WebCore::InspectorCanvas::buildObjectForCanvas):
66+
(WebCore::InspectorCanvas::indexForData):
67+
* inspector/InspectorShaderProgram.cpp:
68+
(WebCore::InspectorShaderProgram::program const):
69+
* platform/SharedBuffer.cpp:
70+
(WebCore::SharedBuffer::DataSegment::data const):
71+
(WebCore::SharedBuffer::DataSegment::size const):
72+
* platform/cf/SharedBufferCF.cpp:
73+
(WebCore::SharedBuffer::createCFData const):
74+
(WebCore::SharedBuffer::hintMemoryNotNeededSoon const):
75+
* platform/generic/KeyedDecoderGeneric.cpp:
76+
(WebCore::KeyedDecoderGeneric::Dictionary::add):
77+
(WebCore::KeyedDecoderGeneric::getPointerFromDictionaryStack):
78+
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
79+
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfTrack):
80+
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
81+
(WebCore::TextureMapperPlatformLayerBuffer::clone):
82+
* platform/mock/MockMediaDevice.h:
83+
(WebCore::MockMediaDevice::encode const):
84+
* platform/network/FormData.cpp:
85+
(WebCore::FormData::imageOrMediaFilesCount const):
86+
(WebCore::FormDataElement::lengthInBytes const):
87+
(WebCore::FormDataElement::isolatedCopy const):
88+
(WebCore::FormData::appendData):
89+
(WebCore::FormData::flatten const):
90+
(WebCore::FormData::prepareForUpload):
91+
(WebCore::FormData::asBlobURL const):
92+
* platform/network/cf/FormDataStreamCFNet.cpp:
93+
(WebCore::advanceCurrentStream):
94+
(WebCore::setHTTPBody):
95+
* platform/network/curl/CurlContext.cpp:
96+
(WebCore::CurlHandle::enableSSLForHost):
97+
* platform/network/curl/CurlFormDataStream.cpp:
98+
(WebCore::CurlFormDataStream::read):
99+
* platform/network/curl/CurlSSLVerifier.cpp:
100+
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
101+
* platform/network/soup/ResourceRequestSoup.cpp:
102+
(WebCore::ResourceRequest::updateSoupMessageBody const):
103+
* style/StyleResolveForFontRaw.cpp:
104+
(WebCore::Style::resolveForFontRaw):
105+
1106
2021-10-11 Antti Koivisto <antti@apple.com>
2107

3108
[LFC][Integration] Use inline box isFirstBox/isLastBox bits in iterator

‎Source/WebCore/Modules/cache/DOMCacheEngine.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,22 @@ bool queryCacheMatch(const ResourceRequest& request, const URL& url, bool hasVar
129129

130130
ResponseBody isolatedResponseBody(const ResponseBody& body)
131131
{
132-
return WTF::switchOn(body, [](const Ref<FormData>& formData) {
132+
return WTF::switchOn(body, [](const Ref<FormData>& formData) -> ResponseBody {
133133
return formData->isolatedCopy();
134-
}, [](const Ref<SharedBuffer>& buffer) {
134+
}, [](const Ref<SharedBuffer>& buffer) -> ResponseBody {
135135
return buffer->copy();
136-
}, [](const std::nullptr_t&) {
136+
}, [](const std::nullptr_t&) -> ResponseBody {
137137
return DOMCacheEngine::ResponseBody { };
138138
});
139139
}
140140

141141
ResponseBody copyResponseBody(const ResponseBody& body)
142142
{
143-
return WTF::switchOn(body, [](const Ref<FormData>& formData) {
143+
return WTF::switchOn(body, [](const Ref<FormData>& formData) -> ResponseBody {
144144
return formData.copyRef();
145-
}, [](const Ref<SharedBuffer>& buffer) {
145+
}, [](const Ref<SharedBuffer>& buffer) -> ResponseBody {
146146
return buffer.copyRef();
147-
}, [](const std::nullptr_t&) {
147+
}, [](const std::nullptr_t&) -> ResponseBody {
148148
return DOMCacheEngine::ResponseBody { };
149149
});
150150
}

0 commit comments

Comments
 (0)