Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/parser/CSSParserContext.h |
| diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserContext.h b/third_party/WebKit/Source/core/css/parser/CSSParserContext.h |
| index b96c3db467e536ec14bba21ebeb28bc3ddd68407..13f754b7031003a3a09b94c13a03ca986269d2e8 100644 |
| --- a/third_party/WebKit/Source/core/css/parser/CSSParserContext.h |
| +++ b/third_party/WebKit/Source/core/css/parser/CSSParserContext.h |
| @@ -13,31 +13,34 @@ |
| namespace blink { |
| +class CSSStyleSheet; |
| class Document; |
| +class StyleSheetContents; |
| class UseCounter; |
| -class CORE_EXPORT CSSParserContext { |
| - USING_FAST_MALLOC(CSSParserContext); |
| - |
| +class CORE_EXPORT CSSParserContext |
| + : public GarbageCollectedFinalized<CSSParserContext> { |
| public: |
| // https://drafts.csswg.org/selectors/#profiles |
| enum SelectorProfile { DynamicProfile, StaticProfile }; |
| - CSSParserContext(CSSParserMode, |
| - UseCounter*, |
| - SelectorProfile = DynamicProfile); |
| + static CSSParserContext* create(const CSSParserContext*, |
| + const CSSStyleSheet*); |
| + static CSSParserContext* create(const CSSParserContext*, |
| + const StyleSheetContents*); |
| + |
| + CSSParserContext(CSSParserMode, SelectorProfile = DynamicProfile); |
|
haraken
2017/01/12 04:51:13
Put these constructors in a private section.
Bret
2017/01/13 02:15:28
Done.
|
| // FIXME: We shouldn't need the UseCounter argument as we could infer it from |
| // the Document but some callers want to disable use counting (e.g. the |
| // WebInspector). |
| CSSParserContext(const Document&, |
| - UseCounter*, |
| const KURL& baseURL = KURL(), |
| const String& charset = emptyString(), |
| SelectorProfile = DynamicProfile); |
| // FIXME: This constructor shouldn't exist if we properly piped the UseCounter |
| // through the CSS subsystem. Currently the UseCounter life time is too crazy |
| // and we need a way to override it. |
| - CSSParserContext(const CSSParserContext&, UseCounter*); |
| + CSSParserContext(const CSSParserContext*, UseCounter*); |
| bool operator==(const CSSParserContext&) const; |
| bool operator!=(const CSSParserContext& other) const { |
| @@ -73,11 +76,15 @@ class CORE_EXPORT CSSParserContext { |
| // This may return nullptr if counting is disabled. |
| // See comments on constructors. |
| UseCounter* useCounter() const { return m_useCounter; } |
| + bool isUseCounterRecordingEnabled() const { return m_useCounter; } |
| + void setUseCounter(UseCounter* useCounter) { m_useCounter = useCounter; } |
| ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy() const { |
| return m_shouldCheckContentSecurityPolicy; |
| } |
| + DEFINE_INLINE_TRACE() {} |
| + |
| private: |
| KURL m_baseURL; |
| String m_charset; |
| @@ -92,8 +99,8 @@ class CORE_EXPORT CSSParserContext { |
| UseCounter* m_useCounter; |
| }; |
| -CORE_EXPORT const CSSParserContext& strictCSSParserContext(); |
| +CORE_EXPORT const CSSParserContext* strictCSSParserContext(); |
| } // namespace blink |
| -#endif // CSSParserMode_h |
| +#endif // CSSParserContext_h |