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

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

Issue 136063002: Use a RefPtr to store implementation in QualifiedName (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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/QualifiedName.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/QualifiedName.cpp
diff --git a/Source/core/dom/QualifiedName.cpp b/Source/core/dom/QualifiedName.cpp
index 1912986ead27560babbe7265dfbb9b291b446eff..de0ba4185f189b3c21df567de4830e9803c8d2f4 100644
--- a/Source/core/dom/QualifiedName.cpp
+++ b/Source/core/dom/QualifiedName.cpp
@@ -77,24 +77,11 @@ QualifiedName::QualifiedName(const AtomicString& p, const AtomicString& l, const
{
QualifiedNameComponents components = { p.impl(), l.impl(), n.isEmpty() ? nullAtom.impl() : n.impl() };
QualifiedNameCache::AddResult addResult = qualifiedNameCache().add<QNameComponentsTranslator>(components);
- m_impl = *addResult.iterator;
- if (!addResult.isNewEntry)
- m_impl->ref();
+ m_impl = addResult.isNewEntry ? adoptRef(*addResult.iterator) : *addResult.iterator;
}
QualifiedName::~QualifiedName()
{
- deref();
-}
-
-void QualifiedName::deref()
-{
-#ifdef QNAME_DEFAULT_CONSTRUCTOR
- if (!m_impl)
- return;
-#endif
- ASSERT(!isHashTableDeletedValue());
- m_impl->deref();
}
QualifiedName::QualifiedNameImpl::~QualifiedNameImpl()
« no previous file with comments | « Source/core/dom/QualifiedName.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698