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

Side by Side Diff: third_party/WebKit/Source/core/css/StyleSheetContents.h

Issue 2315923002: Lazy Parse CSS (Closed)
Patch Set: s/->/. Created 4 years, 2 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
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 bool hasMediaQueries() const { return m_hasMediaQueries; } 152 bool hasMediaQueries() const { return m_hasMediaQueries; }
153 153
154 bool didLoadErrorOccur() const { return m_didLoadErrorOccur; } 154 bool didLoadErrorOccur() const { return m_didLoadErrorOccur; }
155 155
156 RuleSet& ruleSet() { ASSERT(m_ruleSet); return *m_ruleSet.get(); } 156 RuleSet& ruleSet() { ASSERT(m_ruleSet); return *m_ruleSet.get(); }
157 RuleSet& ensureRuleSet(const MediaQueryEvaluator&, AddRuleFlags); 157 RuleSet& ensureRuleSet(const MediaQueryEvaluator&, AddRuleFlags);
158 void clearRuleSet(); 158 void clearRuleSet();
159 159
160 String sourceMapURL() const { return m_sourceMapURL; } 160 String sourceMapURL() const { return m_sourceMapURL; }
161 161
162 void takeEscapedStrings(std::unique_ptr<Vector<String>> strings)
163 {
164 m_escapedStrings.reset(strings.release());
165 }
166
162 DECLARE_TRACE(); 167 DECLARE_TRACE();
163 168
164 private: 169 private:
165 StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, co nst CSSParserContext&); 170 StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, co nst CSSParserContext&);
166 StyleSheetContents(const StyleSheetContents&); 171 StyleSheetContents(const StyleSheetContents&);
167 StyleSheetContents() = delete; 172 StyleSheetContents() = delete;
168 StyleSheetContents& operator=(const StyleSheetContents&) = delete; 173 StyleSheetContents& operator=(const StyleSheetContents&) = delete;
169 void notifyRemoveFontFaceRule(const StyleRuleFontFace*); 174 void notifyRemoveFontFaceRule(const StyleRuleFontFace*);
170 175
171 Document* clientSingleOwnerDocument() const; 176 Document* clientSingleOwnerDocument() const;
(...skipping 18 matching lines...) Expand all
190 bool m_hasSingleOwnerDocument : 1; 195 bool m_hasSingleOwnerDocument : 1;
191 bool m_isUsedFromTextCache : 1; 196 bool m_isUsedFromTextCache : 1;
192 197
193 CSSParserContext m_parserContext; 198 CSSParserContext m_parserContext;
194 199
195 HeapHashSet<WeakMember<CSSStyleSheet>> m_loadingClients; 200 HeapHashSet<WeakMember<CSSStyleSheet>> m_loadingClients;
196 HeapHashSet<WeakMember<CSSStyleSheet>> m_completedClients; 201 HeapHashSet<WeakMember<CSSStyleSheet>> m_completedClients;
197 202
198 Member<RuleSet> m_ruleSet; 203 Member<RuleSet> m_ruleSet;
199 String m_sourceMapURL; 204 String m_sourceMapURL;
205
206 // Used for retaining references to escaped strings for lazy parsing. For
207 // non-lazy parsing these are only retained in the CSSTokenizer::Scope.
208 std::unique_ptr<Vector<String>> m_escapedStrings;
209
210 // Only initialized if using lazy parsing. Also referenced on the css resour ce.
211 String m_sheetText;
200 }; 212 };
201 213
202 } // namespace blink 214 } // namespace blink
203 215
204 #endif 216 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698