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

Side by Side Diff: sky/engine/core/css/ElementRuleCollector.h

Issue 723253004: Remove tons of OILPAN. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/css/DOMWindowCSS.h ('k') | sky/engine/core/css/FontFaceCache.h » ('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 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 ASSERT(m_ruleData); 55 ASSERT(m_ruleData);
56 static const unsigned BitsForPositionInRuleData = 18; 56 static const unsigned BitsForPositionInRuleData = 18;
57 static const unsigned BitsForStyleSheetIndex = 32; 57 static const unsigned BitsForStyleSheetIndex = 32;
58 m_position = ((uint64_t)cascadeOrder << (BitsForStyleSheetIndex + BitsFo rPositionInRuleData)) + ((uint64_t)styleSheetIndex << BitsForPositionInRuleData) + m_ruleData->position(); 58 m_position = ((uint64_t)cascadeOrder << (BitsForStyleSheetIndex + BitsFo rPositionInRuleData)) + ((uint64_t)styleSheetIndex << BitsForPositionInRuleData) + m_ruleData->position();
59 } 59 }
60 60
61 const RuleData* ruleData() const { return m_ruleData; } 61 const RuleData* ruleData() const { return m_ruleData; }
62 uint32_t cascadeScope() const { return m_cascadeScope; } 62 uint32_t cascadeScope() const { return m_cascadeScope; }
63 uint64_t position() const { return m_position; } 63 uint64_t position() const { return m_position; }
64 const CSSStyleSheet* parentStyleSheet() const { return m_parentStyleSheet; } 64 const CSSStyleSheet* parentStyleSheet() const { return m_parentStyleSheet; }
65 void trace(Visitor* visitor)
66 {
67 visitor->trace(m_parentStyleSheet);
68 }
69 65
70 private: 66 private:
71 // FIXME: Oilpan: RuleData is in the oilpan heap and this pointer 67 // FIXME: Oilpan: RuleData is in the oilpan heap and this pointer
72 // really should be traced. However, RuleData objects are 68 // really should be traced. However, RuleData objects are
73 // allocated inside larger TerminatedArray objects and we cannot 69 // allocated inside larger TerminatedArray objects and we cannot
74 // trace a raw rule data pointer at this point. 70 // trace a raw rule data pointer at this point.
75 const RuleData* m_ruleData; 71 const RuleData* m_ruleData;
76 CascadeScope m_cascadeScope; 72 CascadeScope m_cascadeScope;
77 uint64_t m_position; 73 uint64_t m_position;
78 RawPtr<const CSSStyleSheet> m_parentStyleSheet; 74 RawPtr<const CSSStyleSheet> m_parentStyleSheet;
79 }; 75 };
80 76
81 } // namespace blink 77 } // namespace blink
82 78
83 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MatchedRule); 79 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MatchedRule);
84 80
85 namespace blink { 81 namespace blink {
86 82
87 // FIXME: oilpan: when transition types are gone this class can be replaced with HeapVector. 83 // FIXME: oilpan: when transition types are gone this class can be replaced with HeapVector.
88 class StyleRuleList final : public RefCounted<StyleRuleList> { 84 class StyleRuleList final : public RefCounted<StyleRuleList> {
89 public: 85 public:
90 static PassRefPtr<StyleRuleList> create() { return adoptRef(new StyleRuleLis t()); } 86 static PassRefPtr<StyleRuleList> create() { return adoptRef(new StyleRuleLis t()); }
91 87
92 void trace(Visitor* visitor)
93 {
94 #if ENABLE(OILPAN)
95 visitor->trace(m_list);
96 #endif
97 }
98
99 Vector<RawPtr<StyleRule> > m_list; 88 Vector<RawPtr<StyleRule> > m_list;
100 }; 89 };
101 90
102 // ElementRuleCollector is designed to be used as a stack object. 91 // ElementRuleCollector is designed to be used as a stack object.
103 // Create one, ask what rules the ElementResolveContext matches 92 // Create one, ask what rules the ElementResolveContext matches
104 // and then let it go out of scope. 93 // and then let it go out of scope.
105 // FIXME: Currently it modifies the RenderStyle but should not! 94 // FIXME: Currently it modifies the RenderStyle but should not!
106 class ElementRuleCollector { 95 class ElementRuleCollector {
107 STACK_ALLOCATED(); 96 STACK_ALLOCATED();
108 WTF_MAKE_NONCOPYABLE(ElementRuleCollector); 97 WTF_MAKE_NONCOPYABLE(ElementRuleCollector);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 150
162 // Output. 151 // Output.
163 RefPtr<StaticCSSRuleList> m_cssRuleList; 152 RefPtr<StaticCSSRuleList> m_cssRuleList;
164 RefPtr<StyleRuleList> m_styleRuleList; 153 RefPtr<StyleRuleList> m_styleRuleList;
165 MatchResult m_result; 154 MatchResult m_result;
166 }; 155 };
167 156
168 } // namespace blink 157 } // namespace blink
169 158
170 #endif // ElementRuleCollector_h 159 #endif // ElementRuleCollector_h
OLDNEW
« no previous file with comments | « sky/engine/core/css/DOMWindowCSS.h ('k') | sky/engine/core/css/FontFaceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698