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

Unified Diff: Source/core/dom/ElementData.cpp

Issue 405923002: Introduce DEFINE_ELEMENT_DATA_TYPE_CASTS, and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « Source/core/dom/ElementData.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ElementData.cpp
diff --git a/Source/core/dom/ElementData.cpp b/Source/core/dom/ElementData.cpp
index 87bc696327833f69e9bf045727815d42b9f6ebf8..2922961534e2fe08005d222aac804c9fb6b50cc1 100644
--- a/Source/core/dom/ElementData.cpp
+++ b/Source/core/dom/ElementData.cpp
@@ -83,25 +83,25 @@ ElementData::ElementData(const ElementData& other, bool isUnique)
void ElementData::finalizeGarbageCollectedObject()
{
if (m_isUnique)
- static_cast<UniqueElementData*>(this)->~UniqueElementData();
+ toUniqueElementData(this)->~UniqueElementData();
else
- static_cast<ShareableElementData*>(this)->~ShareableElementData();
+ toShareableElementData(this)->~ShareableElementData();
}
#else
void ElementData::destroy()
{
if (m_isUnique)
- delete static_cast<UniqueElementData*>(this);
+ delete toUniqueElementData(this);
else
- delete static_cast<ShareableElementData*>(this);
+ delete toShareableElementData(this);
}
#endif
PassRefPtrWillBeRawPtr<UniqueElementData> ElementData::makeUniqueCopy() const
{
if (isUnique())
- return adoptRefWillBeNoop(new UniqueElementData(static_cast<const UniqueElementData&>(*this)));
- return adoptRefWillBeNoop(new UniqueElementData(static_cast<const ShareableElementData&>(*this)));
+ return adoptRefWillBeNoop(new UniqueElementData(toUniqueElementData(*this)));
+ return adoptRefWillBeNoop(new UniqueElementData(toShareableElementData(*this)));
}
bool ElementData::isEquivalent(const ElementData* other) const
@@ -126,9 +126,9 @@ bool ElementData::isEquivalent(const ElementData* other) const
void ElementData::trace(Visitor* visitor)
{
if (m_isUnique)
- static_cast<UniqueElementData*>(this)->traceAfterDispatch(visitor);
+ toUniqueElementData(this)->traceAfterDispatch(visitor);
else
- static_cast<ShareableElementData*>(this)->traceAfterDispatch(visitor);
+ toShareableElementData(this)->traceAfterDispatch(visitor);
}
void ElementData::traceAfterDispatch(Visitor* visitor)
« no previous file with comments | « Source/core/dom/ElementData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698