Replace some stack raw pointers with RefPtrs within WebCore/svg
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Nov 2017 03:55:05 +0000 (03:55 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Nov 2017 03:55:05 +0000 (03:55 +0000)
commitb0381111eaa2a57cbb265e22f199fc5de0a603c5
tree774eb99f5f43b1f855a022b1570d8e4aefd1c47b
parent34ed440d3612ab9c5f0f5ca78419213f2d68732f
Replace some stack raw pointers with RefPtrs within WebCore/svg
https://bugs.webkit.org/show_bug.cgi?id=179314
<rdar://problem/34842204>

Reviewed by Ryosuke Niwa.

Besides replacing pointers directly, some of the methods are changed to return
RefPtrs as well.

No changes in behaviors.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::remoteSVGRootElement const):
* dom/EventPath.h:
(WebCore::EventPath::eventTargetRespectingTargetRules):
* page/FrameView.cpp:
(WebCore::FrameView::scrollToAnchor):
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler):
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::hasValidAttributeType):
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):
(WebCore::SVGAnimateElementBase::calculateFromAndToValues):
(WebCore::SVGAnimateElementBase::calculateFromAndByValues):
(WebCore::SVGAnimateElementBase::resetAnimatedType):
(WebCore::SVGAnimateElementBase::applyResultsToTarget):
(WebCore::SVGAnimateElementBase::calculateDistance):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::hasValidAttributeType):
(WebCore::SVGAnimateMotionElement::updateAnimationPath):
(WebCore::SVGAnimateMotionElement::resetAnimatedType):
(WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
(WebCore::SVGAnimateMotionElement::applyResultsToTarget):
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::hasValidAttributeType):
* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::adjustForInheritance):
(WebCore::SVGAnimationElement::determinePropertyValueTypes):
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::rootElement):
(WebCore::SVGDocument::zoomAndPanEnabled const):
(WebCore::SVGDocument::startPan):
(WebCore::SVGDocument::updatePan const):
* svg/SVGDocument.h:
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::removeElementFromPendingResourcesForRemovalMap):
* svg/SVGDocumentExtensions.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::~SVGElement):
(WebCore::SVGElement::correspondingUseElement const):
(WebCore::SVGElement::setCorrespondingElement):
(WebCore::SVGElement::resolveCustomStyle):
(WebCore::SVGElement::computedStyle):
(WebCore::SVGElement::buildPendingResourcesIfNeeded):
(WebCore::SVGElement::updateRelativeLengthsInformation):
(WebCore::SVGElement::invalidateInstances):
* svg/SVGElement.h:
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::build):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::build):
* svg/SVGFEComponentTransferElement.cpp:
(WebCore::SVGFEComponentTransferElement::build):
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::build):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::build):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::build):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::build):
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::build):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::buildPendingResource):
(WebCore::SVGFEImageElement::notifyFinished):
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::findLightSource):
(WebCore::SVGFELightElement::svgAttributeChanged):
(WebCore::SVGFELightElement::childrenChanged):
* svg/SVGFEMergeElement.cpp:
(WebCore::SVGFEMergeElement::build):
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::build):
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build):
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::build):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::invalidateFilterPrimitiveParent):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):
* svg/SVGFontFaceFormatElement.cpp:
(WebCore::SVGFontFaceFormatElement::childrenChanged):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::childrenChanged):
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::rendererIsNeeded):
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::determineViewport const):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::buildPendingResource):
(WebCore::SVGMPathElement::pathElement):
* svg/SVGMPathElement.h:
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::frameForCurrentScale const):
(WebCore::SVGSVGElement::currentScale const):
(WebCore::SVGSVGElement::setCurrentScale):
(WebCore::SVGSVGElement::deselectAll):
(WebCore::SVGSVGElement::localCoordinateSpaceTransform const):
(WebCore::SVGSVGElement::scrollToAnchor):
(WebCore::SVGSVGElement::getElementById):
* svg/SVGSVGElement.h:
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::setDisabled):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::detachTarget):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::elementFromRenderer):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::buildPendingResource):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::transferSizeAttributesToTargetClone const):
(WebCore::SVGUseElement::svgAttributeChanged):
(WebCore::SVGUseElement::targetClone const):
(WebCore::SVGUseElement::toClipPath):
(WebCore::SVGUseElement::rendererClipChild const):
(WebCore::SVGUseElement::findTarget const):
(WebCore::SVGUseElement::invalidateDependentShadowTrees):
(WebCore::SVGUseElement::selfHasRelativeLengths const):
* svg/SVGUseElement.h:
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::updateAnimations):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
(WebCore::SVGSMILElement::insertedIntoAncestor):
(WebCore::SVGSMILElement::connectConditions):
(WebCore::SVGSMILElement::disconnectConditions):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::rootElement const):
(WebCore::SVGImage::hasSingleSecurityOrigin const):
(WebCore::SVGImage::setContainerSize):
(WebCore::SVGImage::containerSize const):
(WebCore::SVGImage::draw):
(WebCore::SVGImage::embeddedContentBox const):
(WebCore::SVGImage::hasRelativeWidth const):
(WebCore::SVGImage::hasRelativeHeight const):
(WebCore::SVGImage::computeIntrinsicDimensions):
(WebCore::SVGImage::startAnimation):
(WebCore::SVGImage::stopAnimation):
(WebCore::SVGImage::isAnimating const):
(WebCore::SVGImage::reportApproximateMemoryCost const):
* svg/graphics/SVGImage.h:
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::platformApplySoftware):
* svg/graphics/filters/SVGFilterBuilder.cpp:
(WebCore::SVGFilterBuilder::getEffectById const):
* svg/graphics/filters/SVGFilterBuilder.h:
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGListPropertyTearOff.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
60 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/dom/EventPath.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/svg/SVGAElement.cpp
Source/WebCore/svg/SVGAltGlyphElement.cpp
Source/WebCore/svg/SVGAnimateElementBase.cpp
Source/WebCore/svg/SVGAnimateMotionElement.cpp
Source/WebCore/svg/SVGAnimateTransformElement.cpp
Source/WebCore/svg/SVGAnimatedPath.cpp
Source/WebCore/svg/SVGAnimationElement.cpp
Source/WebCore/svg/SVGDocument.cpp
Source/WebCore/svg/SVGDocument.h
Source/WebCore/svg/SVGDocumentExtensions.cpp
Source/WebCore/svg/SVGDocumentExtensions.h
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGElement.h
Source/WebCore/svg/SVGFEBlendElement.cpp
Source/WebCore/svg/SVGFEColorMatrixElement.cpp
Source/WebCore/svg/SVGFEComponentTransferElement.cpp
Source/WebCore/svg/SVGFECompositeElement.cpp
Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp
Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
Source/WebCore/svg/SVGFEDisplacementMapElement.cpp
Source/WebCore/svg/SVGFEDropShadowElement.cpp
Source/WebCore/svg/SVGFEGaussianBlurElement.cpp
Source/WebCore/svg/SVGFEImageElement.cpp
Source/WebCore/svg/SVGFELightElement.cpp
Source/WebCore/svg/SVGFEMergeElement.cpp
Source/WebCore/svg/SVGFEMorphologyElement.cpp
Source/WebCore/svg/SVGFEOffsetElement.cpp
Source/WebCore/svg/SVGFESpecularLightingElement.cpp
Source/WebCore/svg/SVGFETileElement.cpp
Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
Source/WebCore/svg/SVGFontFaceElement.cpp
Source/WebCore/svg/SVGFontFaceFormatElement.cpp
Source/WebCore/svg/SVGFontFaceUriElement.cpp
Source/WebCore/svg/SVGForeignObjectElement.cpp
Source/WebCore/svg/SVGLengthContext.cpp
Source/WebCore/svg/SVGLinearGradientElement.cpp
Source/WebCore/svg/SVGMPathElement.cpp
Source/WebCore/svg/SVGMPathElement.h
Source/WebCore/svg/SVGRadialGradientElement.cpp
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/SVGSVGElement.h
Source/WebCore/svg/SVGStyleElement.cpp
Source/WebCore/svg/SVGTRefElement.cpp
Source/WebCore/svg/SVGTextContentElement.cpp
Source/WebCore/svg/SVGTextPathElement.cpp
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/svg/SVGUseElement.h
Source/WebCore/svg/animation/SMILTimeContainer.cpp
Source/WebCore/svg/animation/SVGSMILElement.cpp
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebCore/svg/graphics/SVGImage.h
Source/WebCore/svg/graphics/filters/SVGFEImage.cpp
Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp
Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h
Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h
Source/WebCore/svg/properties/SVGListPropertyTearOff.h