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

Side by Side Diff: third_party/WebKit/Source/core/css/invalidation/InvalidationSet.cpp

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 11 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 HashSet<AtomicString>& InvalidationSet::ensureAttributeSet() { 198 HashSet<AtomicString>& InvalidationSet::ensureAttributeSet() {
199 if (!m_attributes) 199 if (!m_attributes)
200 m_attributes = WTF::wrapUnique(new HashSet<AtomicString>); 200 m_attributes = WTF::wrapUnique(new HashSet<AtomicString>);
201 return *m_attributes; 201 return *m_attributes;
202 } 202 }
203 203
204 void InvalidationSet::addClass(const AtomicString& className) { 204 void InvalidationSet::addClass(const AtomicString& className) {
205 if (wholeSubtreeInvalid()) 205 if (wholeSubtreeInvalid())
206 return; 206 return;
207 DCHECK(!className.isEmpty()); 207 DCHECK(!className.isEmpty());
208 ensureClassSet().add(className); 208 ensureClassSet().insert(className);
209 } 209 }
210 210
211 void InvalidationSet::addId(const AtomicString& id) { 211 void InvalidationSet::addId(const AtomicString& id) {
212 if (wholeSubtreeInvalid()) 212 if (wholeSubtreeInvalid())
213 return; 213 return;
214 DCHECK(!id.isEmpty()); 214 DCHECK(!id.isEmpty());
215 ensureIdSet().add(id); 215 ensureIdSet().insert(id);
216 } 216 }
217 217
218 void InvalidationSet::addTagName(const AtomicString& tagName) { 218 void InvalidationSet::addTagName(const AtomicString& tagName) {
219 if (wholeSubtreeInvalid()) 219 if (wholeSubtreeInvalid())
220 return; 220 return;
221 DCHECK(!tagName.isEmpty()); 221 DCHECK(!tagName.isEmpty());
222 ensureTagNameSet().add(tagName); 222 ensureTagNameSet().insert(tagName);
223 } 223 }
224 224
225 void InvalidationSet::addAttribute(const AtomicString& attribute) { 225 void InvalidationSet::addAttribute(const AtomicString& attribute) {
226 if (wholeSubtreeInvalid()) 226 if (wholeSubtreeInvalid())
227 return; 227 return;
228 DCHECK(!attribute.isEmpty()); 228 DCHECK(!attribute.isEmpty());
229 ensureAttributeSet().add(attribute); 229 ensureAttributeSet().insert(attribute);
230 } 230 }
231 231
232 void InvalidationSet::setWholeSubtreeInvalid() { 232 void InvalidationSet::setWholeSubtreeInvalid() {
233 if (m_allDescendantsMightBeInvalid) 233 if (m_allDescendantsMightBeInvalid)
234 return; 234 return;
235 235
236 m_allDescendantsMightBeInvalid = true; 236 m_allDescendantsMightBeInvalid = true;
237 m_customPseudoInvalid = false; 237 m_customPseudoInvalid = false;
238 m_treeBoundaryCrossing = false; 238 m_treeBoundaryCrossing = false;
239 m_insertionPointCrossing = false; 239 m_insertionPointCrossing = false;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 return *m_siblingDescendantInvalidationSet; 313 return *m_siblingDescendantInvalidationSet;
314 } 314 }
315 315
316 DescendantInvalidationSet& SiblingInvalidationSet::ensureDescendants() { 316 DescendantInvalidationSet& SiblingInvalidationSet::ensureDescendants() {
317 if (!m_descendantInvalidationSet) 317 if (!m_descendantInvalidationSet)
318 m_descendantInvalidationSet = DescendantInvalidationSet::create(); 318 m_descendantInvalidationSet = DescendantInvalidationSet::create();
319 return *m_descendantInvalidationSet; 319 return *m_descendantInvalidationSet;
320 } 320 }
321 321
322 } // namespace blink 322 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698