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

Side by Side Diff: Source/core/dom/CSSSelectorWatch.cpp

Issue 273843003: [Oilpan]: Make StylePropertySet fully garbage collected. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review feedback Created 6 years, 6 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/resolver/StyleResolver.cpp ('k') | Source/core/dom/Element.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 return true; 138 return true;
139 } 139 }
140 140
141 void CSSSelectorWatch::watchCSSSelectors(const Vector<String>& selectors) 141 void CSSSelectorWatch::watchCSSSelectors(const Vector<String>& selectors)
142 { 142 {
143 m_watchedCallbackSelectors.clear(); 143 m_watchedCallbackSelectors.clear();
144 BisonCSSParser parser(CSSParserContext(UASheetMode, 0)); 144 BisonCSSParser parser(CSSParserContext(UASheetMode, 0));
145 145
146 const CSSProperty callbackProperty(CSSPropertyInternalCallback, CSSPrimitive Value::createIdentifier(CSSValueInternalPresence)); 146 const CSSProperty callbackProperty(CSSPropertyInternalCallback, CSSPrimitive Value::createIdentifier(CSSValueInternalPresence));
147 const RefPtr<StylePropertySet> callbackPropertySet = ImmutableStylePropertyS et::create(&callbackProperty, 1, UASheetMode); 147 const RefPtrWillBeRawPtr<StylePropertySet> callbackPropertySet = ImmutableSt ylePropertySet::create(&callbackProperty, 1, UASheetMode);
148 148
149 CSSSelectorList selectorList; 149 CSSSelectorList selectorList;
150 for (unsigned i = 0; i < selectors.size(); ++i) { 150 for (unsigned i = 0; i < selectors.size(); ++i) {
151 parser.parseSelector(selectors[i], selectorList); 151 parser.parseSelector(selectors[i], selectorList);
152 if (!selectorList.isValid()) 152 if (!selectorList.isValid())
153 continue; 153 continue;
154 154
155 // Only accept Compound Selectors, since they're cheaper to match. 155 // Only accept Compound Selectors, since they're cheaper to match.
156 if (!allCompound(selectorList)) 156 if (!allCompound(selectorList))
157 continue; 157 continue;
158 158
159 RefPtrWillBeRawPtr<StyleRule> rule = StyleRule::create(); 159 RefPtrWillBeRawPtr<StyleRule> rule = StyleRule::create();
160 rule->wrapperAdoptSelectorList(selectorList); 160 rule->wrapperAdoptSelectorList(selectorList);
161 rule->setProperties(callbackPropertySet); 161 rule->setProperties(callbackPropertySet);
162 m_watchedCallbackSelectors.append(rule.release()); 162 m_watchedCallbackSelectors.append(rule.release());
163 } 163 }
164 m_document.changedSelectorWatch(); 164 m_document.changedSelectorWatch();
165 } 165 }
166 166
167 void CSSSelectorWatch::trace(Visitor* visitor) 167 void CSSSelectorWatch::trace(Visitor* visitor)
168 { 168 {
169 visitor->trace(m_watchedCallbackSelectors); 169 visitor->trace(m_watchedCallbackSelectors);
170 DocumentSupplement::trace(visitor); 170 DocumentSupplement::trace(visitor);
171 } 171 }
172 172
173 } // namespace WebCore 173 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698