diff options
Diffstat (limited to 'parser/html/nsHtml5StringParser.h')
-rw-r--r-- | parser/html/nsHtml5StringParser.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/parser/html/nsHtml5StringParser.h b/parser/html/nsHtml5StringParser.h index 1d41404841..8b0203301d 100644 --- a/parser/html/nsHtml5StringParser.h +++ b/parser/html/nsHtml5StringParser.h @@ -67,6 +67,9 @@ class nsHtml5StringParser : public nsParserBase { bool aScriptingEnabledForNoscriptParsing, bool aDeclarativeShadowRootsAllowed); + void TryCache(); + void ClearCaches(); + /** * The tree operation executor */ @@ -86,6 +89,24 @@ class nsHtml5StringParser : public nsParserBase { * The scoped atom table */ nsHtml5AtomTable mAtomTable; + + class CacheClearer : public mozilla::Runnable { + public: + explicit CacheClearer(nsHtml5StringParser* aParser) + : Runnable("CacheClearer"), mParser(aParser) {} + NS_IMETHOD Run() { + if (mParser) { + mParser->ClearCaches(); + } + return NS_OK; + } + void Disconnect() { mParser = nullptr; } + + private: + nsHtml5StringParser* mParser; + }; + + RefPtr<CacheClearer> mCacheClearer; }; #endif // nsHtml5StringParser_h |