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

Unified Diff: third_party/WebKit/Source/core/css/StyleRuleImport.cpp

Issue 2616093003: Make CSSParserContext be garbage collected. (Closed)
Patch Set: fix fuzzer compile again 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/StyleRuleImport.cpp
diff --git a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
index d35a32f26909363acac7a55e9f40583f2a412062..5d8d808445494cd2999fd0c07e6fde25e3d50847 100644
--- a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
+++ b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
@@ -72,17 +72,19 @@ void StyleRuleImport::setCSSStyleSheet(
if (m_styleSheet)
m_styleSheet->clearOwnerRule();
- CSSParserContext context = m_parentStyleSheet
- ? m_parentStyleSheet->parserContext()
- : strictCSSParserContext();
- context.setCharset(charset);
+ CSSParserContext* context = CSSParserContext::create(
+ m_parentStyleSheet ? m_parentStyleSheet->parserContext()
+ : strictCSSParserContext(),
+ nullptr);
+ context->setCharset(charset);
Document* document =
m_parentStyleSheet ? m_parentStyleSheet->singleOwnerDocument() : nullptr;
if (!baseURL.isNull()) {
- context.setBaseURL(baseURL);
- if (document)
- context.setReferrer(Referrer(baseURL.strippedForUseAsReferrer(),
- document->getReferrerPolicy()));
+ context->setBaseURL(baseURL);
+ if (document) {
+ context->setReferrer(Referrer(baseURL.strippedForUseAsReferrer(),
+ document->getReferrerPolicy()));
+ }
}
m_styleSheet = StyleSheetContents::create(this, href, context);
« no previous file with comments | « third_party/WebKit/Source/core/css/StylePropertySet.cpp ('k') | third_party/WebKit/Source/core/css/StyleSheetContents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698