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

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

Issue 2696183002: Migrate WTF::HashSet::remove() to ::erase() [part 1] (Closed)
Patch Set: one more platform-specific reference 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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 return; 572 return;
573 573
574 if (Document* document = clientSingleOwnerDocument()) { 574 if (Document* document = clientSingleOwnerDocument()) {
575 if (sheet->ownerDocument() != document) 575 if (sheet->ownerDocument() != document)
576 m_hasSingleOwnerDocument = false; 576 m_hasSingleOwnerDocument = false;
577 } 577 }
578 m_loadingClients.insert(sheet); 578 m_loadingClients.insert(sheet);
579 } 579 }
580 580
581 void StyleSheetContents::unregisterClient(CSSStyleSheet* sheet) { 581 void StyleSheetContents::unregisterClient(CSSStyleSheet* sheet) {
582 m_loadingClients.remove(sheet); 582 m_loadingClients.erase(sheet);
583 m_completedClients.remove(sheet); 583 m_completedClients.erase(sheet);
584 584
585 if (!sheet->ownerDocument() || !m_loadingClients.isEmpty() || 585 if (!sheet->ownerDocument() || !m_loadingClients.isEmpty() ||
586 !m_completedClients.isEmpty()) 586 !m_completedClients.isEmpty())
587 return; 587 return;
588 588
589 m_hasSingleOwnerDocument = true; 589 m_hasSingleOwnerDocument = true;
590 } 590 }
591 591
592 void StyleSheetContents::clientLoadCompleted(CSSStyleSheet* sheet) { 592 void StyleSheetContents::clientLoadCompleted(CSSStyleSheet* sheet) {
593 ASSERT(m_loadingClients.contains(sheet) || !sheet->ownerDocument()); 593 ASSERT(m_loadingClients.contains(sheet) || !sheet->ownerDocument());
594 m_loadingClients.remove(sheet); 594 m_loadingClients.erase(sheet);
595 // In m_ownerNode->sheetLoaded, the CSSStyleSheet might be detached. 595 // In m_ownerNode->sheetLoaded, the CSSStyleSheet might be detached.
596 // (i.e. clearOwnerNode was invoked.) 596 // (i.e. clearOwnerNode was invoked.)
597 // In this case, we don't need to add the stylesheet to completed clients. 597 // In this case, we don't need to add the stylesheet to completed clients.
598 if (!sheet->ownerDocument()) 598 if (!sheet->ownerDocument())
599 return; 599 return;
600 m_completedClients.insert(sheet); 600 m_completedClients.insert(sheet);
601 } 601 }
602 602
603 void StyleSheetContents::clientLoadStarted(CSSStyleSheet* sheet) { 603 void StyleSheetContents::clientLoadStarted(CSSStyleSheet* sheet) {
604 ASSERT(m_completedClients.contains(sheet)); 604 ASSERT(m_completedClients.contains(sheet));
605 m_completedClients.remove(sheet); 605 m_completedClients.erase(sheet);
606 m_loadingClients.insert(sheet); 606 m_loadingClients.insert(sheet);
607 } 607 }
608 608
609 void StyleSheetContents::setReferencedFromResource( 609 void StyleSheetContents::setReferencedFromResource(
610 CSSStyleSheetResource* resource) { 610 CSSStyleSheetResource* resource) {
611 DCHECK(resource); 611 DCHECK(resource);
612 DCHECK(!isReferencedFromResource()); 612 DCHECK(!isReferencedFromResource());
613 DCHECK(isCacheableForResource()); 613 DCHECK(isCacheableForResource());
614 m_referencedFromResource = resource; 614 m_referencedFromResource = resource;
615 } 615 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 visitor->trace(m_namespaceRules); 702 visitor->trace(m_namespaceRules);
703 visitor->trace(m_childRules); 703 visitor->trace(m_childRules);
704 visitor->trace(m_loadingClients); 704 visitor->trace(m_loadingClients);
705 visitor->trace(m_completedClients); 705 visitor->trace(m_completedClients);
706 visitor->trace(m_ruleSet); 706 visitor->trace(m_ruleSet);
707 visitor->trace(m_referencedFromResource); 707 visitor->trace(m_referencedFromResource);
708 visitor->trace(m_parserContext); 708 visitor->trace(m_parserContext);
709 } 709 }
710 710
711 } // namespace blink 711 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698