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

Side by Side Diff: third_party/WebKit/Source/wtf/HashCountedSet.h

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 private: 113 private:
114 ImplType m_impl; 114 ImplType m_impl;
115 }; 115 };
116 116
117 template <typename T, typename U, typename V, typename W> 117 template <typename T, typename U, typename V, typename W>
118 inline typename HashCountedSet<T, U, V, W>::AddResult 118 inline typename HashCountedSet<T, U, V, W>::AddResult
119 HashCountedSet<T, U, V, W>::add(const ValueType& value, unsigned count) { 119 HashCountedSet<T, U, V, W>::add(const ValueType& value, unsigned count) {
120 DCHECK_GT(count, 0u); 120 DCHECK_GT(count, 0u);
121 AddResult result = m_impl.add(value, 0); 121 AddResult result = m_impl.insert(value, 0);
122 result.storedValue->value += count; 122 result.storedValue->value += count;
123 return result; 123 return result;
124 } 124 }
125 125
126 template <typename T, typename U, typename V, typename W> 126 template <typename T, typename U, typename V, typename W>
127 inline typename HashCountedSet<T, U, V, W>::AddResult 127 inline typename HashCountedSet<T, U, V, W>::AddResult
128 HashCountedSet<T, U, V, W>::add(const ValueType& value) { 128 HashCountedSet<T, U, V, W>::add(const ValueType& value) {
129 return add(value, 1u); 129 return add(value, 1u);
130 } 130 }
131 131
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 Vector<T> vector; 179 Vector<T> vector;
180 copyToVector(*this, vector); 180 copyToVector(*this, vector);
181 return vector; 181 return vector;
182 } 182 }
183 183
184 } // namespace WTF 184 } // namespace WTF
185 185
186 using WTF::HashCountedSet; 186 using WTF::HashCountedSet;
187 187
188 #endif // WTF_HashCountedSet_h 188 #endif // WTF_HashCountedSet_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/sim/SimNetwork.cpp ('k') | third_party/WebKit/Source/wtf/HashMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698