| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 static void translate(QualifiedName::QualifiedNameImpl*& location, const Qua
lifiedNameData& data, unsigned) | 63 static void translate(QualifiedName::QualifiedNameImpl*& location, const Qua
lifiedNameData& data, unsigned) |
| 64 { | 64 { |
| 65 const QualifiedNameComponents& components = data.m_components; | 65 const QualifiedNameComponents& components = data.m_components; |
| 66 location = QualifiedName::QualifiedNameImpl::create(AtomicString(compone
nts.m_prefix), AtomicString(components.m_localName), AtomicString(components.m_n
amespace), data.m_isStatic).leakRef(); | 66 location = QualifiedName::QualifiedNameImpl::create(AtomicString(compone
nts.m_prefix), AtomicString(components.m_localName), AtomicString(components.m_n
amespace), data.m_isStatic).leakRef(); |
| 67 } | 67 } |
| 68 }; | 68 }; |
| 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 QualifiedNameData data = { { p.impl(), l.impl(), n.isEmpty() ? nullAtom.impl
() : n.impl() }, false }; | 72 QualifiedNameData data = { { p.impl(), l.impl(), n.isEmpty() ? nullAtom.impl
() : n.impl() }, false }; |
| 73 QualifiedNameCache::AddResult addResult = qualifiedNameCache().add<QNameComp
onentsTranslator>(data); | 73 QualifiedNameCache::AddResult addResult = qualifiedNameCache().addWithTransl
ator<QNameComponentsTranslator>(data); |
| 74 m_impl = addResult.isNewEntry ? adoptRef(*addResult.storedValue) : *addResul
t.storedValue; | 74 m_impl = addResult.isNewEntry ? adoptRef(*addResult.storedValue) : *addResul
t.storedValue; |
| 75 } | 75 } |
| 76 | 76 |
| 77 QualifiedName::QualifiedName(const AtomicString& p, const AtomicString& l, const
AtomicString& n, bool isStatic) | 77 QualifiedName::QualifiedName(const AtomicString& p, const AtomicString& l, const
AtomicString& n, bool isStatic) |
| 78 { | 78 { |
| 79 QualifiedNameData data = { { p.impl(), l.impl(), n.impl() }, isStatic }; | 79 QualifiedNameData data = { { p.impl(), l.impl(), n.impl() }, isStatic }; |
| 80 QualifiedNameCache::AddResult addResult = qualifiedNameCache().add<QNameComp
onentsTranslator>(data); | 80 QualifiedNameCache::AddResult addResult = qualifiedNameCache().addWithTransl
ator<QNameComponentsTranslator>(data); |
| 81 m_impl = addResult.isNewEntry ? adoptRef(*addResult.storedValue) : *addResul
t.storedValue; | 81 m_impl = addResult.isNewEntry ? adoptRef(*addResult.storedValue) : *addResul
t.storedValue; |
| 82 } | 82 } |
| 83 | 83 |
| 84 QualifiedName::~QualifiedName() | 84 QualifiedName::~QualifiedName() |
| 85 { | 85 { |
| 86 } | 86 } |
| 87 | 87 |
| 88 QualifiedName::QualifiedNameImpl::~QualifiedNameImpl() | 88 QualifiedName::QualifiedNameImpl::~QualifiedNameImpl() |
| 89 { | 89 { |
| 90 qualifiedNameCache().remove(this); | 90 qualifiedNameCache().remove(this); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 { | 132 { |
| 133 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nameNamespac
e, true); | 133 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nameNamespac
e, true); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void QualifiedName::createStatic(void* targetAddress, StringImpl* name) | 136 void QualifiedName::createStatic(void* targetAddress, StringImpl* name) |
| 137 { | 137 { |
| 138 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nullAtom, tr
ue); | 138 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nullAtom, tr
ue); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace blink | 141 } // namespace blink |
| OLD | NEW |