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

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

Issue 2616093003: Make CSSParserContext be garbage collected. (Closed)
Patch Set: comments 1 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/StyleSheetContents.cpp
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
index 982ca98cd915c3eca85234df06ff1ccadbe26695..91e88b582ae7eed7f96dc44be3d16117b408aaa8 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
+++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
@@ -59,7 +59,7 @@ unsigned StyleSheetContents::estimatedSizeInBytes() const {
StyleSheetContents::StyleSheetContents(StyleRuleImport* ownerRule,
const String& originalURL,
- const CSSParserContext& context)
+ const CSSParserContext* context)
: m_ownerRule(ownerRule),
m_originalURL(originalURL),
m_defaultNamespace(starAtom),
@@ -346,7 +346,7 @@ void StyleSheetContents::parseAuthorStyleSheet(
}
CSSStyleSheetResource::MIMETypeCheck mimeTypeCheck =
- isQuirksModeBehavior(m_parserContext.mode()) && isSameOriginRequest
+ isQuirksModeBehavior(m_parserContext->mode()) && isSameOriginRequest
? CSSStyleSheetResource::MIMETypeCheck::Lax
: CSSStyleSheetResource::MIMETypeCheck::Strict;
String sheetText = cachedStyleSheet->sheetText(mimeTypeCheck);
@@ -358,7 +358,8 @@ void StyleSheetContents::parseAuthorStyleSheet(
m_sourceMapURL = response.httpHeaderField(HTTPNames::X_SourceMap);
}
- CSSParserContext context(parserContext(), UseCounter::getFrom(this));
+ const CSSParserContext* context =
+ CSSParserContext::create(parserContext(), this);
CSSParser::parseSheet(context, this, sheetText,
RuntimeEnabledFeatures::lazyParseCSSEnabled());
@@ -379,7 +380,8 @@ void StyleSheetContents::parseString(const String& sheetText) {
void StyleSheetContents::parseStringAtPosition(
const String& sheetText,
const TextPosition& startPosition) {
- CSSParserContext context(parserContext(), UseCounter::getFrom(this));
+ const CSSParserContext* context =
+ CSSParserContext::create(parserContext(), this);
CSSParser::parseSheet(context, this, sheetText);
}
@@ -693,6 +695,7 @@ DEFINE_TRACE(StyleSheetContents) {
visitor->trace(m_completedClients);
visitor->trace(m_ruleSet);
visitor->trace(m_referencedFromResource);
+ visitor->trace(m_parserContext);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698