Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1315)

Unified Diff: Source/core/rendering/svg/RenderSVGResourceContainer.h

Issue 27648002: Refine toRenderSVGResourceContainer() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/svg/RenderSVGResourceContainer.h
diff --git a/Source/core/rendering/svg/RenderSVGResourceContainer.h b/Source/core/rendering/svg/RenderSVGResourceContainer.h
index 9489a6f8a2db7e93ba08436a8be96925b2ee0dc5..3965093b00889038116a7714f7edc08cb920944a 100644
--- a/Source/core/rendering/svg/RenderSVGResourceContainer.h
+++ b/Source/core/rendering/svg/RenderSVGResourceContainer.h
@@ -37,7 +37,6 @@ public:
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE FINAL;
virtual bool isSVGResourceContainer() const OVERRIDE FINAL { return true; }
- virtual RenderSVGResourceContainer* toRenderSVGResourceContainer() OVERRIDE FINAL { return this; }
static bool shouldTransformOnTextPainting(RenderObject*, AffineTransform&);
static AffineTransform transformOnNonScalingStroke(RenderObject*, const AffineTransform& resourceTransform);
@@ -97,6 +96,21 @@ Renderer* getRenderSVGResourceById(Document& document, const AtomicString& id)
return 0;
}
+inline RenderSVGResourceContainer* toRenderSVGResourceContainer(RenderObject* object)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isSVGResourceContainer());
+ return static_cast<RenderSVGResourceContainer*>(object);
+}
+
+inline const RenderSVGResourceContainer* toRenderSVGResourceContainer(const RenderObject* object)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isSVGResourceContainer());
+ return static_cast<const RenderSVGResourceContainer*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toRenderSVGResourceContainer(const RenderSVGResourceContainer*);
+
}
#endif
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResource.cpp ('k') | Source/core/rendering/svg/RenderSVGResourceContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698