| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 static unsigned hash(const QualifiedNameComponents& components) | 62 static unsigned hash(const QualifiedNameComponents& components) |
| 63 { | 63 { |
| 64 return hashComponents(components); | 64 return hashComponents(components); |
| 65 } | 65 } |
| 66 static bool equal(QualifiedName::QualifiedNameImpl* name, const QualifiedNam
eComponents& c) | 66 static bool equal(QualifiedName::QualifiedNameImpl* name, const QualifiedNam
eComponents& c) |
| 67 { | 67 { |
| 68 return c.m_prefix == name->m_prefix.impl() && c.m_localName == name->m_l
ocalName.impl() && c.m_namespace == name->m_namespace.impl(); | 68 return c.m_prefix == name->m_prefix.impl() && c.m_localName == name->m_l
ocalName.impl() && c.m_namespace == name->m_namespace.impl(); |
| 69 } | 69 } |
| 70 static void translate(QualifiedName::QualifiedNameImpl*& location, const Qua
lifiedNameComponents& components, unsigned) | 70 static void translate(QualifiedName::QualifiedNameImpl*& location, const Qua
lifiedNameComponents& components, unsigned) |
| 71 { | 71 { |
| 72 location = QualifiedName::QualifiedNameImpl::create(components.m_prefix,
components.m_localName, components.m_namespace).leakRef(); | 72 location = QualifiedName::QualifiedNameImpl::create(AtomicString(compone
nts.m_prefix), AtomicString(components.m_localName), AtomicString(components.m_n
amespace)).leakRef(); |
| 73 } | 73 } |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 QualifiedName::QualifiedName(const AtomicString& p, const AtomicString& l, const
AtomicString& n) | 76 QualifiedName::QualifiedName(const AtomicString& p, const AtomicString& l, const
AtomicString& n) |
| 77 { | 77 { |
| 78 QualifiedNameComponents components = { p.impl(), l.impl(), n.isEmpty() ? nul
lAtom.impl() : n.impl() }; | 78 QualifiedNameComponents components = { p.impl(), l.impl(), n.isEmpty() ? nul
lAtom.impl() : n.impl() }; |
| 79 QualifiedNameCache::AddResult addResult = qualifiedNameCache().add<QNameComp
onentsTranslator>(components); | 79 QualifiedNameCache::AddResult addResult = qualifiedNameCache().add<QNameComp
onentsTranslator>(components); |
| 80 m_impl = *addResult.iterator; | 80 m_impl = *addResult.iterator; |
| 81 if (!addResult.isNewEntry) | 81 if (!addResult.isNewEntry) |
| 82 m_impl->ref(); | 82 m_impl->ref(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 { | 142 { |
| 143 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nameNamespac
e); | 143 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nameNamespac
e); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void createQualifiedName(void* targetAddress, StringImpl* name) | 146 void createQualifiedName(void* targetAddress, StringImpl* name) |
| 147 { | 147 { |
| 148 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nullAtom); | 148 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nullAtom); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } | 151 } |
| OLD | NEW |