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

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

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 | « no previous file | Source/core/dom/QualifiedName.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/QualifiedName.h
diff --git a/Source/core/dom/QualifiedName.h b/Source/core/dom/QualifiedName.h
index b42f9e45cd28b8ecb28236df4a86cc0e25d37d3d..638ce0b34bb0b83c184bece90494ebd68b7d301e 100644
--- a/Source/core/dom/QualifiedName.h
+++ b/Source/core/dom/QualifiedName.h
@@ -67,15 +67,17 @@ public:
};
QualifiedName(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI);
- QualifiedName(WTF::HashTableDeletedValueType) : m_impl(hashTableDeletedValue()) { }
- bool isHashTableDeletedValue() const { return m_impl == hashTableDeletedValue(); }
~QualifiedName();
#ifdef QNAME_DEFAULT_CONSTRUCTOR
- QualifiedName() : m_impl(0) { }
+ QualifiedName() { }
#endif
- QualifiedName(const QualifiedName& other) : m_impl(other.m_impl) { ref(); }
- const QualifiedName& operator=(const QualifiedName& other) { other.ref(); deref(); m_impl = other.m_impl; return *this; }
+ QualifiedName(const QualifiedName& other) : m_impl(other.m_impl) { }
+ const QualifiedName& operator=(const QualifiedName& other) { m_impl = other.m_impl; return *this; }
+
+ // Hash table deleted values, which are only constructed and never copied or destroyed.
+ QualifiedName(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { }
+ bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue(); }
bool operator==(const QualifiedName& other) const { return m_impl == other.m_impl; }
bool operator!=(const QualifiedName& other) const { return !(*this == other); }
@@ -96,18 +98,13 @@ public:
String toString() const;
- QualifiedNameImpl* impl() const { return m_impl; }
+ QualifiedNameImpl* impl() const { return m_impl.get(); }
// Init routine for globals
static void init();
private:
- void ref() const { m_impl->ref(); }
- void deref();
-
- static QualifiedNameImpl* hashTableDeletedValue() { return RefPtr<QualifiedNameImpl>::hashTableDeletedValue(); }
-
- QualifiedNameImpl* m_impl;
+ RefPtr<QualifiedNameImpl> m_impl;
};
#ifndef WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS
« no previous file with comments | « no previous file | Source/core/dom/QualifiedName.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698