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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: 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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 558
559 // InspectorCSSAgent::buildObjectForRule creates CSSStyleSheet without any 559 // InspectorCSSAgent::buildObjectForRule creates CSSStyleSheet without any
560 // owner node. 560 // owner node.
561 if (!sheet->ownerDocument()) 561 if (!sheet->ownerDocument())
562 return; 562 return;
563 563
564 if (Document* document = clientSingleOwnerDocument()) { 564 if (Document* document = clientSingleOwnerDocument()) {
565 if (sheet->ownerDocument() != document) 565 if (sheet->ownerDocument() != document)
566 m_hasSingleOwnerDocument = false; 566 m_hasSingleOwnerDocument = false;
567 } 567 }
568 m_loadingClients.add(sheet); 568 m_loadingClients.insert(sheet);
569 } 569 }
570 570
571 void StyleSheetContents::unregisterClient(CSSStyleSheet* sheet) { 571 void StyleSheetContents::unregisterClient(CSSStyleSheet* sheet) {
572 m_loadingClients.remove(sheet); 572 m_loadingClients.remove(sheet);
573 m_completedClients.remove(sheet); 573 m_completedClients.remove(sheet);
574 574
575 if (!sheet->ownerDocument() || !m_loadingClients.isEmpty() || 575 if (!sheet->ownerDocument() || !m_loadingClients.isEmpty() ||
576 !m_completedClients.isEmpty()) 576 !m_completedClients.isEmpty())
577 return; 577 return;
578 578
579 m_hasSingleOwnerDocument = true; 579 m_hasSingleOwnerDocument = true;
580 } 580 }
581 581
582 void StyleSheetContents::clientLoadCompleted(CSSStyleSheet* sheet) { 582 void StyleSheetContents::clientLoadCompleted(CSSStyleSheet* sheet) {
583 ASSERT(m_loadingClients.contains(sheet) || !sheet->ownerDocument()); 583 ASSERT(m_loadingClients.contains(sheet) || !sheet->ownerDocument());
584 m_loadingClients.remove(sheet); 584 m_loadingClients.remove(sheet);
585 // In m_ownerNode->sheetLoaded, the CSSStyleSheet might be detached. 585 // In m_ownerNode->sheetLoaded, the CSSStyleSheet might be detached.
586 // (i.e. clearOwnerNode was invoked.) 586 // (i.e. clearOwnerNode was invoked.)
587 // In this case, we don't need to add the stylesheet to completed clients. 587 // In this case, we don't need to add the stylesheet to completed clients.
588 if (!sheet->ownerDocument()) 588 if (!sheet->ownerDocument())
589 return; 589 return;
590 m_completedClients.add(sheet); 590 m_completedClients.insert(sheet);
591 } 591 }
592 592
593 void StyleSheetContents::clientLoadStarted(CSSStyleSheet* sheet) { 593 void StyleSheetContents::clientLoadStarted(CSSStyleSheet* sheet) {
594 ASSERT(m_completedClients.contains(sheet)); 594 ASSERT(m_completedClients.contains(sheet));
595 m_completedClients.remove(sheet); 595 m_completedClients.remove(sheet);
596 m_loadingClients.add(sheet); 596 m_loadingClients.insert(sheet);
597 } 597 }
598 598
599 void StyleSheetContents::setReferencedFromResource( 599 void StyleSheetContents::setReferencedFromResource(
600 CSSStyleSheetResource* resource) { 600 CSSStyleSheetResource* resource) {
601 DCHECK(resource); 601 DCHECK(resource);
602 DCHECK(!isReferencedFromResource()); 602 DCHECK(!isReferencedFromResource());
603 DCHECK(isCacheableForResource()); 603 DCHECK(isCacheableForResource());
604 m_referencedFromResource = resource; 604 m_referencedFromResource = resource;
605 } 605 }
606 606
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 visitor->trace(m_namespaceRules); 692 visitor->trace(m_namespaceRules);
693 visitor->trace(m_childRules); 693 visitor->trace(m_childRules);
694 visitor->trace(m_loadingClients); 694 visitor->trace(m_loadingClients);
695 visitor->trace(m_completedClients); 695 visitor->trace(m_completedClients);
696 visitor->trace(m_ruleSet); 696 visitor->trace(m_ruleSet);
697 visitor->trace(m_referencedFromResource); 697 visitor->trace(m_referencedFromResource);
698 visitor->trace(m_parserContext); 698 visitor->trace(m_parserContext);
699 } 699 }
700 700
701 } // namespace blink 701 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698