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

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

Issue 1210073004: Remove some unused code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « Source/core/css/StyleSheetContents.h ('k') | Source/core/css/resolver/StyleResolver.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 * (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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 return (*root->m_loadingClients.begin())->ownerNode(); 417 return (*root->m_loadingClients.begin())->ownerNode();
418 return (*root->m_completedClients.begin())->ownerNode(); 418 return (*root->m_completedClients.begin())->ownerNode();
419 } 419 }
420 420
421 Document* StyleSheetContents::singleOwnerDocument() const 421 Document* StyleSheetContents::singleOwnerDocument() const
422 { 422 {
423 StyleSheetContents* root = rootStyleSheet(); 423 StyleSheetContents* root = rootStyleSheet();
424 return root->clientSingleOwnerDocument(); 424 return root->clientSingleOwnerDocument();
425 } 425 }
426 426
427 KURL StyleSheetContents::completeURL(const String& url) const
428 {
429 // FIXME: This is only OK when we have a singleOwnerNode, right?
430 return m_parserContext.completeURL(url);
431 }
432
433 static bool childRulesHaveFailedOrCanceledSubresources(const WillBeHeapVector<Re fPtrWillBeMember<StyleRuleBase>>& rules) 427 static bool childRulesHaveFailedOrCanceledSubresources(const WillBeHeapVector<Re fPtrWillBeMember<StyleRuleBase>>& rules)
434 { 428 {
435 for (unsigned i = 0; i < rules.size(); ++i) { 429 for (unsigned i = 0; i < rules.size(); ++i) {
436 const StyleRuleBase* rule = rules[i].get(); 430 const StyleRuleBase* rule = rules[i].get();
437 switch (rule->type()) { 431 switch (rule->type()) {
438 case StyleRuleBase::Style: 432 case StyleRuleBase::Style:
439 if (toStyleRule(rule)->properties().hasFailedOrCanceledSubresources( )) 433 if (toStyleRule(rule)->properties().hasFailedOrCanceledSubresources( ))
440 return true; 434 return true;
441 break; 435 break;
442 case StyleRuleBase::FontFace: 436 case StyleRuleBase::FontFace:
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 m_isInMemoryCache = true; 537 m_isInMemoryCache = true;
544 } 538 }
545 539
546 void StyleSheetContents::removedFromMemoryCache() 540 void StyleSheetContents::removedFromMemoryCache()
547 { 541 {
548 ASSERT(m_isInMemoryCache); 542 ASSERT(m_isInMemoryCache);
549 ASSERT(isCacheable()); 543 ASSERT(isCacheable());
550 m_isInMemoryCache = false; 544 m_isInMemoryCache = false;
551 } 545 }
552 546
553 void StyleSheetContents::shrinkToFit()
554 {
555 m_importRules.shrinkToFit();
556 m_childRules.shrinkToFit();
557 }
558
559 RuleSet& StyleSheetContents::ensureRuleSet(const MediaQueryEvaluator& medium, Ad dRuleFlags addRuleFlags) 547 RuleSet& StyleSheetContents::ensureRuleSet(const MediaQueryEvaluator& medium, Ad dRuleFlags addRuleFlags)
560 { 548 {
561 if (!m_ruleSet) { 549 if (!m_ruleSet) {
562 m_ruleSet = RuleSet::create(); 550 m_ruleSet = RuleSet::create();
563 m_ruleSet->addRulesFromSheet(this, medium, addRuleFlags); 551 m_ruleSet->addRulesFromSheet(this, medium, addRuleFlags);
564 } 552 }
565 return *m_ruleSet.get(); 553 return *m_ruleSet.get();
566 } 554 }
567 555
568 static void clearResolvers(WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleShee t>>& clients) 556 static void clearResolvers(WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleShee t>>& clients)
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 visitor->trace(m_ownerRule); 627 visitor->trace(m_ownerRule);
640 visitor->trace(m_importRules); 628 visitor->trace(m_importRules);
641 visitor->trace(m_childRules); 629 visitor->trace(m_childRules);
642 visitor->trace(m_loadingClients); 630 visitor->trace(m_loadingClients);
643 visitor->trace(m_completedClients); 631 visitor->trace(m_completedClients);
644 visitor->trace(m_ruleSet); 632 visitor->trace(m_ruleSet);
645 #endif 633 #endif
646 } 634 }
647 635
648 } 636 }
OLDNEW
« no previous file with comments | « Source/core/css/StyleSheetContents.h ('k') | Source/core/css/resolver/StyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698