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

Side by Side Diff: Source/core/svg/SVGDocumentExtensions.cpp

Issue 256743005: Add removeAll method to sets and maps and use them (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved implementation of removeAll to HashTable.h and shared it. Also added it to LinkedHashSet Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/platform/fonts/FontCache.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) 2006 Apple Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Rob Buis <buis@kde.org> 4 * Copyright (C) 2007 Rob Buis <buis@kde.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 HashSet<SVGElement*>* referencingElements = it->value.get(); 343 HashSet<SVGElement*>* referencingElements = it->value.get();
344 HashSet<SVGElement*>::iterator setIt = referencingElements->find(referen cingElement); 344 HashSet<SVGElement*>::iterator setIt = referencingElements->find(referen cingElement);
345 if (setIt == referencingElements->end()) 345 if (setIt == referencingElements->end())
346 continue; 346 continue;
347 347
348 referencingElements->remove(setIt); 348 referencingElements->remove(setIt);
349 if (referencingElements->isEmpty()) 349 if (referencingElements->isEmpty())
350 toBeRemoved.append(referencedElement); 350 toBeRemoved.append(referencedElement);
351 } 351 }
352 352
353 Vector<SVGElement*>::iterator vectorEnd = toBeRemoved.end(); 353 m_elementDependencies.removeAll(toBeRemoved);
354 for (Vector<SVGElement*>::iterator it = toBeRemoved.begin(); it != vectorEnd ; ++it)
355 m_elementDependencies.remove(*it);
356 } 354 }
357 355
358 void SVGDocumentExtensions::rebuildAllElementReferencesForTarget(SVGElement* ref erencedElement) 356 void SVGDocumentExtensions::rebuildAllElementReferencesForTarget(SVGElement* ref erencedElement)
359 { 357 {
360 ASSERT(referencedElement); 358 ASSERT(referencedElement);
361 HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*> > >::iterator it = m_elemen tDependencies.find(referencedElement); 359 HashMap<SVGElement*, OwnPtr<HashSet<SVGElement*> > >::iterator it = m_elemen tDependencies.find(referencedElement);
362 if (it == m_elementDependencies.end()) 360 if (it == m_elementDependencies.end())
363 return; 361 return;
364 ASSERT(it->key == referencedElement); 362 ASSERT(it->key == referencedElement);
365 Vector<SVGElement*> toBeNotified; 363 Vector<SVGElement*> toBeNotified;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 } 436 }
439 437
440 void SVGDocumentExtensions::removePendingSVGFontFaceElementsForRemoval() 438 void SVGDocumentExtensions::removePendingSVGFontFaceElementsForRemoval()
441 { 439 {
442 m_pendingSVGFontFaceElementsForRemoval.clear(); 440 m_pendingSVGFontFaceElementsForRemoval.clear();
443 } 441 }
444 442
445 #endif 443 #endif
446 444
447 } 445 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/platform/fonts/FontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698