Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / css / CSSParserMode.h
index 36084b8..078b74f 100644 (file)
@@ -88,11 +88,18 @@ inline bool isUseCounterEnabledForMode(CSSParserMode mode)
     return mode != UASheetMode;
 }
 
+class UseCounter;
+
 class CSSParserContext {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    CSSParserContext(CSSParserMode);
-    CSSParserContext(const Document&, const KURL& baseURL = KURL(), const String& charset = emptyString());
+    CSSParserContext(CSSParserMode, UseCounter*);
+    // 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());
+    // 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*);
 
     bool operator==(const CSSParserContext&) const;
     bool operator!=(const CSSParserContext& other) const { return !(*this == other); }
@@ -115,12 +122,16 @@ public:
 
     KURL completeURL(const String& url) const;
 
+    UseCounter* useCounter() const { return m_useCounter; }
+
 private:
     KURL m_baseURL;
     String m_charset;
     CSSParserMode m_mode;
     bool m_isHTMLDocument;
     bool m_useLegacyBackgroundSizeShorthandBehavior;
+
+    UseCounter* m_useCounter;
 };
 
 const CSSParserContext& strictCSSParserContext();