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

Unified Diff: third_party/WebKit/Source/core/css/CSSStyleSheet.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
index decf3122e874050427793152263540490b9d64ee..b6059308b69bc5af1af175eae2339c6078f5618f 100644
--- a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
+++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
@@ -102,8 +102,8 @@ CSSStyleSheet* CSSStyleSheet::createInline(Node& ownerNode,
const KURL& baseURL,
const TextPosition& startPosition,
const String& encoding) {
- CSSParserContext parserContext(ownerNode.document(), nullptr, baseURL,
- encoding);
+ CSSParserContext* parserContext =
+ new CSSParserContext(ownerNode.document(), baseURL, encoding);
StyleSheetContents* sheet =
StyleSheetContents::create(baseURL.getString(), parserContext);
return new CSSStyleSheet(sheet, ownerNode, true, startPosition);
@@ -264,8 +264,8 @@ unsigned CSSStyleSheet::insertRule(const String& ruleString,
String::number(length()) + ").");
return 0;
}
- CSSParserContext context(m_contents->parserContext(),
- UseCounter::getFrom(this));
+ const CSSParserContext* context = new CSSParserContext(
+ m_contents->parserContext(), UseCounter::getFrom(this));
StyleRuleBase* rule =
CSSParser::parseRule(context, m_contents.get(), ruleString);

Powered by Google App Engine
This is Rietveld 408576698