Use more smart pointers for dynamicDowncast<>in SVG code#27385
Conversation
|
EWS run on previous version of this PR (hash 4fb3246) Details |
cdumez
left a comment
There was a problem hiding this comment.
We need to be careful when adopting smart pointers to actually follow the guidelines. Otherwise, we'll make the performance worse without actually improving security.
If you find it difficult, maybe we should wait for the static analyzer bot to be ready.
There was a problem hiding this comment.
Not strictly needed since layoutAttributes() is a trivial inline function. If this is hot code, we could consider not making this change.
There was a problem hiding this comment.
Ah, sorry, did not check layoutAttributes properly.
There was a problem hiding this comment.
Not strictly needed, isLayoutSizeChanged() is a trivial inline getter.
There was a problem hiding this comment.
Not strictly needed since the call site is supposed to have a Ref/RefPtr to svgElement on the stack. It's not this function's job to keep parameters alive.
Same comment applies elsewhere in this function.
There was a problem hiding this comment.
gradientElement.releaseNonNull() to avoid refcounting churn. Or keep it as a raw pointer. There was nothing wrong with this code.
4fb3246 to
7cd1ccd
Compare
|
EWS run on current version of this PR (hash 7cd1ccd) Details |
https://bugs.webkit.org/show_bug.cgi?id=272817 Reviewed by Chris Dumez. Use more smart pointers for dynamicDowncast<>in SVG code. * Source/WebCore/rendering/svg/RenderSVGText.cpp: (WebCore::findPreviousAndNextAttributes): * Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp: (WebCore::RenderSVGTransformableContainer::additionalContainerTranslation const): * Source/WebCore/rendering/svg/SVGBoundingBoxComputation.cpp: (WebCore::SVGBoundingBoxComputation::handleRootOrContainer const): * Source/WebCore/rendering/svg/SVGContainerLayout.cpp: (WebCore::SVGContainerLayout::layoutChildren): (WebCore::SVGContainerLayout::positionChildrenRelativeToContainer): * Source/WebCore/rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::checkForSVGRepaintDuringLayout): (WebCore::updateObjectBoundingBox): (WebCore::SVGRenderSupport::computeContainerBoundingBoxes): (WebCore::SVGRenderSupport::computeContainerStrokeBoundingBox): (WebCore::layoutSizeOfNearestViewportChanged): (WebCore::SVGRenderSupport::layoutChildren): (WebCore::isPointInCSSClippingArea): (WebCore::SVGRenderSupport::clipContextToCSSClippingArea): (WebCore::SVGRenderSupport::calculateApproximateStrokeBoundingBox): * Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::writeSVGPaintingFeatures): (WebCore::writeResources): * Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::walkTree): * Source/WebCore/rendering/svg/SVGTextQuery.cpp: (WebCore::flowBoxForRenderer): * Source/WebCore/rendering/svg/legacy/LegacyRenderSVGModelObject.cpp: (WebCore::getElementCTM): * Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceClipper.cpp: (WebCore::LegacyRenderSVGResourceClipper::pathOnlyClipping): * Source/WebCore/rendering/svg/legacy/LegacyRenderSVGTransformableContainer.cpp: (WebCore::LegacyRenderSVGTransformableContainer::calculateLocalTransform): * Source/WebCore/svg/SVGFEComponentTransferElement.cpp: (WebCore::SVGFEComponentTransferElement::setFilterEffectAttributeFromChild): * Source/WebCore/svg/SVGFontFaceSrcElement.cpp: (WebCore::SVGFontFaceSrcElement::createSrcValue const): * Source/WebCore/svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::invalidateResourceImageBuffersIfNeeded): Canonical link: https://commits.webkit.org/277661@main
7cd1ccd to
7196d1f
Compare
|
Committed 277661@main (7196d1f): https://commits.webkit.org/277661@main Reviewed commits have been landed. Closing PR #27385 and removing active labels. |
7196d1f
7cd1ccd
🧪 wpe-wk2🧪 api-mac🧪 mac-wk1🧪 gtk-wk2🧪 api-gtk