[webkit-changes] [WebKit/WebKit] 5fe8dd: Replace potentially more confusing decltype() usag...
Sam Weinig
noreply at github.com
Fri May 3 18:13:51 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5fe8dd6a3b46ad9e11f397ea324c5615cb7680bf
https://github.com/WebKit/WebKit/commit/5fe8dd6a3b46ad9e11f397ea324c5615cb7680bf
Author: Sam Weinig <weinig at apple.com>
Date: 2024-05-03 (Fri, 03 May 2024)
Changed paths:
M Source/WebCore/Modules/cache/DOMCache.cpp
M Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp
M Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp
M Source/WebCore/Modules/fetch/WindowOrWorkerGlobalScopeFetch.cpp
M Source/WebCore/Modules/indexeddb/IDBKeyData.cpp
M Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
M Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
M Source/WebCore/bindings/js/JSDOMConvertUnion.h
M Source/WebCore/css/CSSGradientValue.cpp
M Source/WebCore/css/CSSValue.cpp
M Source/WebCore/css/DeprecatedCSSOMValue.cpp
M Source/WebCore/css/StyleRule.cpp
M Source/WebCore/css/color/CSSResolvedColorMix.cpp
M Source/WebCore/dom/Node.cpp
M Source/WebCore/loader/SubresourceIntegrity.cpp
M Source/WebCore/loader/appcache/ApplicationCacheManifestParser.cpp
M Source/WebCore/platform/Length.cpp
M Source/WebCore/platform/graphics/Color.cpp
M Source/WebCore/platform/graphics/ColorBlending.cpp
M Source/WebCore/platform/graphics/ColorConversion.cpp
M Source/WebCore/platform/graphics/ColorInterpolation.cpp
M Source/WebCore/platform/graphics/ColorInterpolationMethod.cpp
M Source/WebCore/platform/graphics/ColorInterpolationMethod.h
M Source/WebCore/platform/graphics/ColorSpace.h
M Source/WebCore/platform/graphics/PathSegment.cpp
M Source/WebCore/platform/graphics/cg/GradientRendererCG.cpp
M Source/WebCore/platform/graphics/displaylists/DisplayListItem.cpp
M Source/WebCore/rendering/RenderBox.h
M Source/WebCore/rendering/svg/SVGRenderSupport.cpp
M Source/WebCore/style/RuleFeature.cpp
M Source/WebCore/svg/SVGViewSpec.cpp
M Source/WebCore/workers/service/ServiceWorkerClients.cpp
M Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp
Log Message:
-----------
Replace potentially more confusing decltype() usage with template lambdas where possible
https://bugs.webkit.org/show_bug.cgi?id=273694
Reviewed by Darin Adler.
A somewhat common patter in WebCore is for a call site to use a generic lambda but still
want to know what the type of the generic argument was. Something like:
function([](auto parameter) {
using Type = std::decay_t<decltype(parameter)>;
...
});
This was necessary in the past due to the lack of template lambdas, but now we have them
and this can be come:
function([]<typename Type>(Type parameter) {
...
});
Additionally, this now lets us provide a template parameter without the need for passing
an argument. For example, if the actual value of the parameter was not needed in the
example above, we could instead write:
function([]<typename Type>() {
...
});
This allows us to generalize a few places that needed a mapping of color space to color
type, allowing us to remove some duplicate copies of the big switch.
* Source/WebCore/Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::matchAll):
* Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::retrieveRecords):
* Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp:
(WebCore::FileSystemEntry::getParent):
* Source/WebCore/Modules/fetch/WindowOrWorkerGlobalScopeFetch.cpp:
(WebCore::doFetch):
* Source/WebCore/Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::type const):
* Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::addIceCandidate):
* Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addIceCandidate):
* Source/WebCore/bindings/js/JSDOMConvertUnion.h:
(WebCore::Detail::forEachArgs):
(WebCore::forEach):
* Source/WebCore/css/CSSGradientValue.cpp:
(WebCore::appendColorInterpolationMethod):
* Source/WebCore/css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::operator delete):
* Source/WebCore/css/DeprecatedCSSOMValue.cpp:
(WebCore::DeprecatedCSSOMValue::operator delete):
* Source/WebCore/css/StyleRule.cpp:
(WebCore::StyleRuleBase::operator delete):
(WebCore::StyleRuleBase::copy const):
* Source/WebCore/css/color/CSSResolvedColorMix.cpp:
(WebCore::mix):
* Source/WebCore/dom/Node.cpp:
(WebCore::NodeRareData::operator delete):
* Source/WebCore/loader/SubresourceIntegrity.cpp:
(WebCore::parseIntegrityMetadata):
* Source/WebCore/loader/appcache/ApplicationCacheManifestParser.cpp:
(WebCore::parseApplicationCacheManifest):
* Source/WebCore/platform/Length.cpp:
(WebCore::Length::Length):
* Source/WebCore/platform/graphics/Color.cpp:
(WebCore::Color::anyComponentIsNone const):
(WebCore::Color::invertedColorWithAlpha const):
* Source/WebCore/platform/graphics/ColorBlending.cpp:
(WebCore::requiresLegacyInterpolationRules):
* Source/WebCore/platform/graphics/ColorConversion.cpp:
(WebCore::convertAndResolveColorComponents):
* Source/WebCore/platform/graphics/ColorInterpolation.cpp:
(WebCore::interpolateColors):
* Source/WebCore/platform/graphics/ColorInterpolationMethod.cpp:
(WebCore::serializationForCSS):
(WebCore::operator<<):
* Source/WebCore/platform/graphics/ColorInterpolationMethod.h:
(WebCore::add):
(WebCore::serializationForCSS):
* Source/WebCore/platform/graphics/ColorSpace.h:
(WebCore::callWithColorType):
* Source/WebCore/platform/graphics/PathSegment.cpp:
(WebCore::PathSegment::applyElements const):
(WebCore::PathSegment::transform):
* Source/WebCore/platform/graphics/cg/GradientRendererCG.cpp:
(WebCore::GradientRendererCG::makeShading const):
* Source/WebCore/platform/graphics/displaylists/DisplayListItem.cpp:
(WebCore::DisplayList::isValid):
(WebCore::DisplayList::dumpItem):
* Source/WebCore/rendering/RenderBox.h:
(WebCore::RenderBox::lastLineBaseline const):
* Source/WebCore/rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::calculateApproximateStrokeBoundingBox):
* Source/WebCore/style/RuleFeature.cpp:
(WebCore::Style::RuleFeatureSet::collectFeatures):
* Source/WebCore/svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::parseViewSpec):
* Source/WebCore/workers/service/ServiceWorkerClients.cpp:
(WebCore::ServiceWorkerClients::get):
(WebCore::ServiceWorkerClients::openWindow):
* Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
Canonical link: https://commits.webkit.org/278358@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list