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

Side by Side Diff: third_party/WebKit/Source/core/dom/QualifiedName.cpp

Issue 1798913002: WTF HashSet: Implement move semantics for values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/AssociatedURLLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/AssociatedURLLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698