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

Unified Diff: Source/core/css/StyleSheetContents.h

Issue 196653006: Optimize StyleSheetContents::checkLoaded by keeping track of completed (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSStyleSheet.cpp ('k') | Source/core/css/StyleSheetContents.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StyleSheetContents.h
diff --git a/Source/core/css/StyleSheetContents.h b/Source/core/css/StyleSheetContents.h
index be057560e0f0fa2346b157328dccc756a9abc739..8090f8e4b4df48c115f1d95bd2819a51c0266376 100644
--- a/Source/core/css/StyleSheetContents.h
+++ b/Source/core/css/StyleSheetContents.h
@@ -139,7 +139,9 @@ public:
void registerClient(CSSStyleSheet*);
void unregisterClient(CSSStyleSheet*);
- bool hasOneClient() { return m_clients.size() == 1; }
+ bool hasOneClient() { return (m_loadingClients.size() + m_completedClients.size()) == 1; }
+ void clientLoadCompleted(CSSStyleSheet*);
+ void clientLoadStarted(CSSStyleSheet*);
bool isMutable() const { return m_isMutable; }
void setMutable() { m_isMutable = true; }
@@ -185,7 +187,8 @@ private:
CSSParserContext m_parserContext;
- WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet> > m_clients;
+ WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet> > m_loadingClients;
+ WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet> > m_completedClients;
typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet> >::iterator ClientsIterator;
OwnPtrWillBeMember<RuleSet> m_ruleSet;
« no previous file with comments | « Source/core/css/CSSStyleSheet.cpp ('k') | Source/core/css/StyleSheetContents.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698