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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSGroupingRule.cpp

Issue 2616093003: Make CSSParserContext be garbage collected. (Closed)
Patch Set: fix fuzzer compile Created 3 years, 11 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) 2011 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
3 * Copyright (C) 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above 9 * 1. Redistributions of source code must retain the above
10 * copyright notice, this list of conditions and the following 10 * copyright notice, this list of conditions and the following
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 if (index > m_groupRule->childRules().size()) { 56 if (index > m_groupRule->childRules().size()) {
57 exceptionState.throwDOMException( 57 exceptionState.throwDOMException(
58 IndexSizeError, 58 IndexSizeError,
59 "the index " + String::number(index) + 59 "the index " + String::number(index) +
60 " must be less than or equal to the length of the rule list."); 60 " must be less than or equal to the length of the rule list.");
61 return 0; 61 return 0;
62 } 62 }
63 63
64 CSSStyleSheet* styleSheet = parentStyleSheet(); 64 CSSStyleSheet* styleSheet = parentStyleSheet();
65 CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); 65 CSSParserContext* context =
66 new CSSParserContext(parserContext(), UseCounter::getFrom(styleSheet));
haraken 2017/01/11 02:42:18 Maybe we want to have a factory method. CSSParserC
rune 2017/01/11 12:59:26 +1
Bret 2017/01/11 23:05:15 Added for CSSStyleSheet and StyleSheetContents. Th
66 StyleRuleBase* newRule = CSSParser::parseRule( 67 StyleRuleBase* newRule = CSSParser::parseRule(
67 context, styleSheet ? styleSheet->contents() : nullptr, ruleString); 68 context, styleSheet ? styleSheet->contents() : nullptr, ruleString);
68 if (!newRule) { 69 if (!newRule) {
69 exceptionState.throwDOMException( 70 exceptionState.throwDOMException(
70 SyntaxError, 71 SyntaxError,
71 "the rule '" + ruleString + "' is invalid and cannot be parsed."); 72 "the rule '" + ruleString + "' is invalid and cannot be parsed.");
72 return 0; 73 return 0;
73 } 74 }
74 75
75 if (newRule->isNamespaceRule()) { 76 if (newRule->isNamespaceRule()) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 158 }
158 159
159 DEFINE_TRACE(CSSGroupingRule) { 160 DEFINE_TRACE(CSSGroupingRule) {
160 CSSRule::trace(visitor); 161 CSSRule::trace(visitor);
161 visitor->trace(m_childRuleCSSOMWrappers); 162 visitor->trace(m_childRuleCSSOMWrappers);
162 visitor->trace(m_groupRule); 163 visitor->trace(m_groupRule);
163 visitor->trace(m_ruleListCSSOMWrapper); 164 visitor->trace(m_ruleListCSSOMWrapper);
164 } 165 }
165 166
166 } // namespace blink 167 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698