Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp |
| diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp |
| index 66e3d2a87849e6ecf7608494b46e1e38a03c872a..5c35fb7fbe9bda8c46041cce1e48357a8e32f5b0 100644 |
| --- a/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp |
| +++ b/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp |
| @@ -10,19 +10,16 @@ |
| namespace blink { |
| -CSSParserContext::CSSParserContext(CSSParserMode mode, |
| - UseCounter* useCounter, |
| - SelectorProfile profile) |
| +CSSParserContext::CSSParserContext(CSSParserMode mode, SelectorProfile profile) |
| : m_mode(mode), |
| m_matchMode(mode), |
| m_profile(profile), |
| m_isHTMLDocument(false), |
| m_useLegacyBackgroundSizeShorthandBehavior(false), |
| m_shouldCheckContentSecurityPolicy(DoNotCheckContentSecurityPolicy), |
| - m_useCounter(useCounter) {} |
| + m_useCounter(nullptr) {} |
| CSSParserContext::CSSParserContext(const Document& document, |
| - UseCounter* useCounter, |
| const KURL& baseURL, |
| const String& charset, |
| SelectorProfile profile) |
| @@ -39,7 +36,7 @@ CSSParserContext::CSSParserContext(const Document& document, |
| ->getUseLegacyBackgroundSizeShorthandBehavior() |
| : false), |
| m_shouldCheckContentSecurityPolicy(DoNotCheckContentSecurityPolicy), |
| - m_useCounter(useCounter) { |
| + m_useCounter(nullptr) { |
| if (ContentSecurityPolicy::shouldBypassMainWorld(&document)) |
| m_shouldCheckContentSecurityPolicy = DoNotCheckContentSecurityPolicy; |
| else |
| @@ -54,19 +51,19 @@ CSSParserContext::CSSParserContext(const Document& document, |
| } |
| } |
| -CSSParserContext::CSSParserContext(const CSSParserContext& other, |
| +CSSParserContext::CSSParserContext(const CSSParserContext* other, |
| UseCounter* useCounter) |
| - : m_baseURL(other.m_baseURL), |
| - m_charset(other.m_charset), |
| - m_mode(other.m_mode), |
| - m_matchMode(other.m_matchMode), |
| - m_profile(other.m_profile), |
| - m_referrer(other.m_referrer), |
| - m_isHTMLDocument(other.m_isHTMLDocument), |
| + : m_baseURL(other->m_baseURL), |
| + m_charset(other->m_charset), |
| + m_mode(other->m_mode), |
| + m_matchMode(other->m_matchMode), |
| + m_profile(other->m_profile), |
| + m_referrer(other->m_referrer), |
| + m_isHTMLDocument(other->m_isHTMLDocument), |
| m_useLegacyBackgroundSizeShorthandBehavior( |
| - other.m_useLegacyBackgroundSizeShorthandBehavior), |
| + other->m_useLegacyBackgroundSizeShorthandBehavior), |
| m_shouldCheckContentSecurityPolicy( |
| - other.m_shouldCheckContentSecurityPolicy), |
| + other->m_shouldCheckContentSecurityPolicy), |
| m_useCounter(useCounter) {} |
| bool CSSParserContext::operator==(const CSSParserContext& other) const { |
| @@ -78,9 +75,9 @@ bool CSSParserContext::operator==(const CSSParserContext& other) const { |
| other.m_useLegacyBackgroundSizeShorthandBehavior; |
| } |
| -const CSSParserContext& strictCSSParserContext() { |
| - DEFINE_STATIC_LOCAL(CSSParserContext, strictContext, |
| - (HTMLStandardMode, nullptr)); |
| +const CSSParserContext* strictCSSParserContext() { |
| + static CSSParserContext* strictContext = |
|
rune
2017/01/11 12:59:26
Doesn't it need to be Persistent?
haraken
2017/01/11 13:04:54
Nice catch! This needs to be DEFINE_STATIC_LOCAL(P
sof
2017/01/11 13:09:21
DEFINE_STATIC_LOCAL(T, ...) will implicitly wrap a
Bret
2017/01/11 23:05:15
Done... though needing "&strictContext" doesn't se
|
| + new CSSParserContext(HTMLStandardMode); |
| return strictContext; |
| } |