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

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: 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
Index: Source/core/css/StyleSheetContents.h
diff --git a/Source/core/css/StyleSheetContents.h b/Source/core/css/StyleSheetContents.h
index 54b75aa89bb6eb8cfedcc806fdf1cdbf8823e382..852ab1cd6039d3c495a8c5259957ff0f6fbb58c2 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;
OwnPtr<RuleSet> m_ruleSet;

Powered by Google App Engine
This is Rietveld 408576698