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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSStyleSheet.cpp ('k') | Source/core/css/StyleSheetContents.cpp » ('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, 2008, 2009, 2010, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 bool wrapperInsertRule(PassRefPtrWillBeRawPtr<StyleRuleBase>, unsigned index ); 132 bool wrapperInsertRule(PassRefPtrWillBeRawPtr<StyleRuleBase>, unsigned index );
133 void wrapperDeleteRule(unsigned index); 133 void wrapperDeleteRule(unsigned index);
134 134
135 PassRefPtrWillBeRawPtr<StyleSheetContents> copy() const 135 PassRefPtrWillBeRawPtr<StyleSheetContents> copy() const
136 { 136 {
137 return adoptRefWillBeNoop(new StyleSheetContents(*this)); 137 return adoptRefWillBeNoop(new StyleSheetContents(*this));
138 } 138 }
139 139
140 void registerClient(CSSStyleSheet*); 140 void registerClient(CSSStyleSheet*);
141 void unregisterClient(CSSStyleSheet*); 141 void unregisterClient(CSSStyleSheet*);
142 bool hasOneClient() { return m_clients.size() == 1; } 142 bool hasOneClient() { return (m_loadingClients.size() + m_completedClients.s ize()) == 1; }
143 void clientLoadCompleted(CSSStyleSheet*);
144 void clientLoadStarted(CSSStyleSheet*);
143 145
144 bool isMutable() const { return m_isMutable; } 146 bool isMutable() const { return m_isMutable; }
145 void setMutable() { m_isMutable = true; } 147 void setMutable() { m_isMutable = true; }
146 148
147 bool isInMemoryCache() const { return m_isInMemoryCache; } 149 bool isInMemoryCache() const { return m_isInMemoryCache; }
148 void addedToMemoryCache(); 150 void addedToMemoryCache();
149 void removedFromMemoryCache(); 151 void removedFromMemoryCache();
150 152
151 void setHasMediaQueries(); 153 void setHasMediaQueries();
152 bool hasMediaQueries() { return m_hasMediaQueries; } 154 bool hasMediaQueries() { return m_hasMediaQueries; }
(...skipping 25 matching lines...) Expand all
178 bool m_hasSyntacticallyValidCSSHeader : 1; 180 bool m_hasSyntacticallyValidCSSHeader : 1;
179 bool m_didLoadErrorOccur : 1; 181 bool m_didLoadErrorOccur : 1;
180 bool m_usesRemUnits : 1; 182 bool m_usesRemUnits : 1;
181 bool m_isMutable : 1; 183 bool m_isMutable : 1;
182 bool m_isInMemoryCache : 1; 184 bool m_isInMemoryCache : 1;
183 bool m_hasFontFaceRule : 1; 185 bool m_hasFontFaceRule : 1;
184 bool m_hasMediaQueries : 1; 186 bool m_hasMediaQueries : 1;
185 187
186 CSSParserContext m_parserContext; 188 CSSParserContext m_parserContext;
187 189
188 WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet> > m_clients; 190 WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet> > m_loadingClients;
191 WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet> > m_completedClients ;
189 typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet> >::iterator ClientsIterator; 192 typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<CSSStyleSheet> >::iterator ClientsIterator;
190 193
191 OwnPtrWillBeMember<RuleSet> m_ruleSet; 194 OwnPtrWillBeMember<RuleSet> m_ruleSet;
192 }; 195 };
193 196
194 } // namespace 197 } // namespace
195 198
196 #endif 199 #endif
OLDNEW
« 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