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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(AtomicString(compone
nts.m_prefix), AtomicString(components.m_localName), AtomicString(components.m_n
amespace)).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.isNewEntry ? adoptRef(*addResult.iterator) : *addResult.i
terator; | 80 m_impl = addResult.isNewEntry ? adoptRef(*addResult.storedValue) : *addResul
t.storedValue; |
81 } | 81 } |
82 | 82 |
83 QualifiedName::~QualifiedName() | 83 QualifiedName::~QualifiedName() |
84 { | 84 { |
85 } | 85 } |
86 | 86 |
87 QualifiedName::QualifiedNameImpl::~QualifiedNameImpl() | 87 QualifiedName::QualifiedNameImpl::~QualifiedNameImpl() |
88 { | 88 { |
89 qualifiedNameCache().remove(this); | 89 qualifiedNameCache().remove(this); |
90 } | 90 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 { | 129 { |
130 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nameNamespac
e); | 130 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nameNamespac
e); |
131 } | 131 } |
132 | 132 |
133 void createQualifiedName(void* targetAddress, StringImpl* name) | 133 void createQualifiedName(void* targetAddress, StringImpl* name) |
134 { | 134 { |
135 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nullAtom); | 135 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nullAtom); |
136 } | 136 } |
137 | 137 |
138 } | 138 } |
OLD | NEW |