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

Unified Diff: Source/core/dom/Element.h

Issue 176883005: Have Element::ensureUniqueElementData() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/Attr.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.h
diff --git a/Source/core/dom/Element.h b/Source/core/dom/Element.h
index 6db11f9558b94d9bbed6a02d1b81a55b338f8c0f..9b1b62264a160ba9a937a3a3496e6944ce103e40 100644
--- a/Source/core/dom/Element.h
+++ b/Source/core/dom/Element.h
@@ -285,7 +285,7 @@ public:
void stripScriptingAttributes(Vector<Attribute>&) const;
const ElementData* elementData() const { return m_elementData.get(); }
- UniqueElementData* ensureUniqueElementData();
+ UniqueElementData& ensureUniqueElementData();
void synchronizeAllAttributes() const;
@@ -789,11 +789,11 @@ inline bool Element::hasClass() const
return elementData() && elementData()->hasClass();
}
-inline UniqueElementData* Element::ensureUniqueElementData()
+inline UniqueElementData& Element::ensureUniqueElementData()
{
if (!elementData() || !elementData()->isUnique())
createUniqueElementData();
- return static_cast<UniqueElementData*>(m_elementData.get());
+ return static_cast<UniqueElementData&>(*m_elementData);
}
// Put here to make them inline.
« no previous file with comments | « Source/core/dom/Attr.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698