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

Side by Side Diff: sky/engine/wtf/HashCountedSet.h

Issue 729733002: Remove more bits of the Oilpan tracing system (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/wtf/Deque.h ('k') | sky/engine/wtf/HashMap.h » ('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, 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 bool remove(const ValueType& value) { return remove(find(value)); } 73 bool remove(const ValueType& value) { return remove(find(value)); }
74 bool remove(iterator); 74 bool remove(iterator);
75 75
76 // Removes the value, regardless of its count. 76 // Removes the value, regardless of its count.
77 void removeAll(const ValueType& value) { removeAll(find(value)); } 77 void removeAll(const ValueType& value) { removeAll(find(value)); }
78 void removeAll(iterator); 78 void removeAll(iterator);
79 79
80 // Clears the whole set. 80 // Clears the whole set.
81 void clear() { m_impl.clear(); } 81 void clear() { m_impl.clear(); }
82 82
83 void trace(typename Allocator::Visitor* visitor) { m_impl.trace(visitor) ; }
84
85 private: 83 private:
86 ImplType m_impl; 84 ImplType m_impl;
87 }; 85 };
88 86
89 template<typename T, typename U, typename V, typename W> 87 template<typename T, typename U, typename V, typename W>
90 inline typename HashCountedSet<T, U, V, W>::AddResult HashCountedSet<T, U, V , W>::add(const ValueType& value) 88 inline typename HashCountedSet<T, U, V, W>::AddResult HashCountedSet<T, U, V , W>::add(const ValueType& value)
91 { 89 {
92 AddResult result = m_impl.add(value, 0); 90 AddResult result = m_impl.add(value, 0);
93 ++result.storedValue->value; 91 ++result.storedValue->value;
94 return result; 92 return result;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 typedef typename HashCountedSet<Value, HashFunctions, Traits, Allocator> ::const_iterator iterator; 138 typedef typename HashCountedSet<Value, HashFunctions, Traits, Allocator> ::const_iterator iterator;
141 139
142 vector.resize(collection.size()); 140 vector.resize(collection.size());
143 141
144 iterator it = collection.begin(); 142 iterator it = collection.begin();
145 iterator end = collection.end(); 143 iterator end = collection.end();
146 for (unsigned i = 0; it != end; ++it, ++i) 144 for (unsigned i = 0; it != end; ++it, ++i)
147 vector[i] = (*it).key; 145 vector[i] = (*it).key;
148 } 146 }
149 147
150 #if !ENABLE(OILPAN)
151 template<typename T, typename U, typename V>
152 struct NeedsTracing<HashCountedSet<T, U, V> > {
153 static const bool value = false;
154 };
155 #endif
156
157 } // namespace WTF 148 } // namespace WTF
158 149
159 using WTF::HashCountedSet; 150 using WTF::HashCountedSet;
160 151
161 #endif /* WTF_HashCountedSet_h */ 152 #endif /* WTF_HashCountedSet_h */
OLDNEW
« no previous file with comments | « sky/engine/wtf/Deque.h ('k') | sky/engine/wtf/HashMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698