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

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

Issue 1858753003: Remove RawPtr from core/css (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 * 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 unsigned b; 115 unsigned b;
116 unsigned c; 116 unsigned c;
117 unsigned d[4]; 117 unsigned d[4];
118 }; 118 };
119 119
120 static_assert(sizeof(RuleData) == sizeof(SameSizeAsRuleData), "RuleData should s tay small"); 120 static_assert(sizeof(RuleData) == sizeof(SameSizeAsRuleData), "RuleData should s tay small");
121 121
122 class CORE_EXPORT RuleSet : public GarbageCollectedFinalized<RuleSet> { 122 class CORE_EXPORT RuleSet : public GarbageCollectedFinalized<RuleSet> {
123 WTF_MAKE_NONCOPYABLE(RuleSet); 123 WTF_MAKE_NONCOPYABLE(RuleSet);
124 public: 124 public:
125 static RawPtr<RuleSet> create() { return new RuleSet; } 125 static RuleSet* create() { return new RuleSet; }
126 126
127 void addRulesFromSheet(StyleSheetContents*, const MediaQueryEvaluator&, AddR uleFlags = RuleHasNoSpecialState); 127 void addRulesFromSheet(StyleSheetContents*, const MediaQueryEvaluator&, AddR uleFlags = RuleHasNoSpecialState);
128 void addStyleRule(StyleRule*, AddRuleFlags); 128 void addStyleRule(StyleRule*, AddRuleFlags);
129 void addRule(StyleRule*, unsigned selectorIndex, AddRuleFlags); 129 void addRule(StyleRule*, unsigned selectorIndex, AddRuleFlags);
130 130
131 const RuleFeatureSet& features() const { return m_features; } 131 const RuleFeatureSet& features() const { return m_features; }
132 132
133 const HeapTerminatedArray<RuleData>* idRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_idRules.get(key); } 133 const HeapTerminatedArray<RuleData>* idRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_idRules.get(key); }
134 const HeapTerminatedArray<RuleData>* classRules(const AtomicString& key) con st { ASSERT(!m_pendingRules); return m_classRules.get(key); } 134 const HeapTerminatedArray<RuleData>* classRules(const AtomicString& key) con st { ASSERT(!m_pendingRules); return m_classRules.get(key); }
135 const HeapTerminatedArray<RuleData>* tagRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_tagRules.get(key); } 135 const HeapTerminatedArray<RuleData>* tagRules(const AtomicString& key) const { ASSERT(!m_pendingRules); return m_tagRules.get(key); }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 void addKeyframesRule(StyleRuleKeyframes*); 180 void addKeyframesRule(StyleRuleKeyframes*);
181 181
182 void addChildRules(const HeapVector<Member<StyleRuleBase>>&, const MediaQuer yEvaluator& medium, AddRuleFlags); 182 void addChildRules(const HeapVector<Member<StyleRuleBase>>&, const MediaQuer yEvaluator& medium, AddRuleFlags);
183 bool findBestRuleSetAndAdd(const CSSSelector&, RuleData&); 183 bool findBestRuleSetAndAdd(const CSSSelector&, RuleData&);
184 184
185 void compactRules(); 185 void compactRules();
186 static void compactPendingRules(PendingRuleMap&, CompactRuleMap&); 186 static void compactPendingRules(PendingRuleMap&, CompactRuleMap&);
187 187
188 class PendingRuleMaps : public GarbageCollected<PendingRuleMaps> { 188 class PendingRuleMaps : public GarbageCollected<PendingRuleMaps> {
189 public: 189 public:
190 static RawPtr<PendingRuleMaps> create() { return new PendingRuleMaps; } 190 static PendingRuleMaps* create() { return new PendingRuleMaps; }
191 191
192 PendingRuleMap idRules; 192 PendingRuleMap idRules;
193 PendingRuleMap classRules; 193 PendingRuleMap classRules;
194 PendingRuleMap tagRules; 194 PendingRuleMap tagRules;
195 PendingRuleMap shadowPseudoElementRules; 195 PendingRuleMap shadowPseudoElementRules;
196 196
197 DECLARE_TRACE(); 197 DECLARE_TRACE();
198 198
199 private: 199 private:
200 PendingRuleMaps() { } 200 PendingRuleMaps() { }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 HeapVector<RuleData> m_allRules; 235 HeapVector<RuleData> m_allRules;
236 #endif 236 #endif
237 }; 237 };
238 238
239 } // namespace blink 239 } // namespace blink
240 240
241 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); 241 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData);
242 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MinimalRuleData); 242 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MinimalRuleData);
243 243
244 #endif // RuleSet_h 244 #endif // RuleSet_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp ('k') | third_party/WebKit/Source/core/css/RuleSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698