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

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

Issue 204423002: Should remove StyleSheetContents from cache even if document is not active. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/css/CSSStyleSheet.cpp ('k') | no next file » | 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 581
582 void StyleSheetContents::clientLoadStarted(CSSStyleSheet* sheet) 582 void StyleSheetContents::clientLoadStarted(CSSStyleSheet* sheet)
583 { 583 {
584 ASSERT(m_completedClients.contains(sheet)); 584 ASSERT(m_completedClients.contains(sheet));
585 m_completedClients.remove(sheet); 585 m_completedClients.remove(sheet);
586 m_loadingClients.add(sheet); 586 m_loadingClients.add(sheet);
587 } 587 }
588 588
589 void StyleSheetContents::removeSheetFromCache(Document* document) 589 void StyleSheetContents::removeSheetFromCache(Document* document)
590 { 590 {
591 ASSERT(document);
591 if (!maybeCacheable()) 592 if (!maybeCacheable())
592 return; 593 return;
593 if (!document || !document->isActive())
594 return;
595 document->styleEngine()->removeSheet(this); 594 document->styleEngine()->removeSheet(this);
596 } 595 }
597 596
598 void StyleSheetContents::addedToMemoryCache() 597 void StyleSheetContents::addedToMemoryCache()
599 { 598 {
600 ASSERT(!m_isInMemoryCache); 599 ASSERT(!m_isInMemoryCache);
601 ASSERT(isCacheable()); 600 ASSERT(isCacheable());
602 m_isInMemoryCache = true; 601 m_isInMemoryCache = true;
603 } 602 }
604 603
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 { 695 {
697 visitor->trace(m_ownerRule); 696 visitor->trace(m_ownerRule);
698 visitor->trace(m_importRules); 697 visitor->trace(m_importRules);
699 visitor->trace(m_childRules); 698 visitor->trace(m_childRules);
700 visitor->trace(m_loadingClients); 699 visitor->trace(m_loadingClients);
701 visitor->trace(m_completedClients); 700 visitor->trace(m_completedClients);
702 visitor->trace(m_ruleSet); 701 visitor->trace(m_ruleSet);
703 } 702 }
704 703
705 } 704 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSStyleSheet.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698