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

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

Issue 2315923002: Lazy Parse CSS (Closed)
Patch Set: CL for src perf tryjob to run page_cycler_v2.typical_25 benchmark on all-android platform(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, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008, 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 26 matching lines...) Expand all
37 37
38 class CSSStyleDeclaration; 38 class CSSStyleDeclaration;
39 class ImmutableStylePropertySet; 39 class ImmutableStylePropertySet;
40 class MutableStylePropertySet; 40 class MutableStylePropertySet;
41 class StyleSheetContents; 41 class StyleSheetContents;
42 42
43 class CORE_EXPORT StylePropertySet : public GarbageCollectedFinalized<StylePrope rtySet> { 43 class CORE_EXPORT StylePropertySet : public GarbageCollectedFinalized<StylePrope rtySet> {
44 WTF_MAKE_NONCOPYABLE(StylePropertySet); 44 WTF_MAKE_NONCOPYABLE(StylePropertySet);
45 friend class PropertyReference; 45 friend class PropertyReference;
46 public: 46 public:
47
48 void finalizeGarbageCollectedObject(); 47 void finalizeGarbageCollectedObject();
49 48
50 class PropertyReference { 49 class PropertyReference {
51 STACK_ALLOCATED(); 50 STACK_ALLOCATED();
52 public: 51 public:
53 PropertyReference(const StylePropertySet& propertySet, unsigned index) 52 PropertyReference(const StylePropertySet& propertySet, unsigned index)
54 : m_propertySet(&propertySet) 53 : m_propertySet(&propertySet)
55 , m_index(index) 54 , m_index(index)
56 { 55 {
57 } 56 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 , m_arraySize(std::min(immutableArraySize, unsigned(MaxArraySize))) 140 , m_arraySize(std::min(immutableArraySize, unsigned(MaxArraySize)))
142 { } 141 { }
143 142
144 unsigned m_cssParserMode : 3; 143 unsigned m_cssParserMode : 3;
145 mutable unsigned m_isMutable : 1; 144 mutable unsigned m_isMutable : 1;
146 unsigned m_arraySize : 28; 145 unsigned m_arraySize : 28;
147 146
148 friend class PropertySetCSSStyleDeclaration; 147 friend class PropertySetCSSStyleDeclaration;
149 }; 148 };
150 149
150 // Used for lazily parsing properties.
151 typedef Function<StylePropertySet*(), WTF::SameThreadAffinity> DeferredPropertie sClosure;
152
151 class CORE_EXPORT ImmutableStylePropertySet : public StylePropertySet { 153 class CORE_EXPORT ImmutableStylePropertySet : public StylePropertySet {
152 public: 154 public:
153 ~ImmutableStylePropertySet(); 155 ~ImmutableStylePropertySet();
154 static ImmutableStylePropertySet* create(const CSSProperty* properties, unsi gned count, CSSParserMode); 156 static ImmutableStylePropertySet* create(const CSSProperty* properties, unsi gned count, CSSParserMode);
155 157
156 unsigned propertyCount() const { return m_arraySize; } 158 unsigned propertyCount() const { return m_arraySize; }
157 159
158 const Member<const CSSValue>* valueArray() const; 160 const Member<const CSSValue>* valueArray() const;
159 const StylePropertyMetadata* metadataArray() const; 161 const StylePropertyMetadata* metadataArray() const;
160 162
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 inline int StylePropertySet::findPropertyIndex(T property) const 286 inline int StylePropertySet::findPropertyIndex(T property) const
285 { 287 {
286 if (m_isMutable) 288 if (m_isMutable)
287 return toMutableStylePropertySet(this)->findPropertyIndex(property); 289 return toMutableStylePropertySet(this)->findPropertyIndex(property);
288 return toImmutableStylePropertySet(this)->findPropertyIndex(property); 290 return toImmutableStylePropertySet(this)->findPropertyIndex(property);
289 } 291 }
290 292
291 } // namespace blink 293 } // namespace blink
292 294
293 #endif // StylePropertySet_h 295 #endif // StylePropertySet_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/StyleRule.h » ('j') | third_party/WebKit/Source/core/css/StyleRule.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698