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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 }; | 66 }; |
67 | 67 |
68 static QNameSet* gNameCache; | 68 static QNameSet* gNameCache; |
69 | 69 |
70 QualifiedName::QualifiedName(const AtomicString& p, const AtomicString& l, const
AtomicString& n) | 70 QualifiedName::QualifiedName(const AtomicString& p, const AtomicString& l, const
AtomicString& n) |
71 { | 71 { |
72 if (!gNameCache) | 72 if (!gNameCache) |
73 gNameCache = new QNameSet; | 73 gNameCache = new QNameSet; |
74 QualifiedNameComponents components = { p.impl(), l.impl(), n.isEmpty() ? nul
lAtom.impl() : n.impl() }; | 74 QualifiedNameComponents components = { p.impl(), l.impl(), n.isEmpty() ? nul
lAtom.impl() : n.impl() }; |
75 QNameSet::AddResult addResult = gNameCache->add<QualifiedNameComponents, QNa
meComponentsTranslator>(components); | 75 QNameSet::AddResult addResult = gNameCache->add<QNameComponentsTranslator>(c
omponents); |
76 m_impl = *addResult.iterator; | 76 m_impl = *addResult.iterator; |
77 if (!addResult.isNewEntry) | 77 if (!addResult.isNewEntry) |
78 m_impl->ref(); | 78 m_impl->ref(); |
79 } | 79 } |
80 | 80 |
81 QualifiedName::~QualifiedName() | 81 QualifiedName::~QualifiedName() |
82 { | 82 { |
83 deref(); | 83 deref(); |
84 } | 84 } |
85 | 85 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 { | 158 { |
159 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nameNamespace); | 159 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nameNamespace); |
160 } | 160 } |
161 | 161 |
162 void createQualifiedName(void* targetAddress, StringImpl* name) | 162 void createQualifiedName(void* targetAddress, StringImpl* name) |
163 { | 163 { |
164 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nullAtom); | 164 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nullAtom); |
165 } | 165 } |
166 | 166 |
167 } | 167 } |
OLD | NEW |