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

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

Issue 2205843003: Use weak members to cache StyleSheetContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Might be in cache without being used before garbage collection Created 4 years, 4 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.h
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.h b/third_party/WebKit/Source/core/css/StyleSheetContents.h
index 3c1a0013941d4848967a70044855dc18b8229ea9..ae3d78c6608c4ca89226a7272d245209d69698af 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetContents.h
+++ b/third_party/WebKit/Source/core/css/StyleSheetContents.h
@@ -82,6 +82,7 @@ public:
bool hasSingleOwnerNode() const;
Node* singleOwnerNode() const;
Document* singleOwnerDocument() const;
+ bool hasSingleOwnerDocument() const { return m_hasSingleOwnerDocument; }
const String& charset() const { return m_parserContext.charset(); }
@@ -140,7 +141,8 @@ public:
bool isMutable() const { return m_isMutable; }
void setMutable() { m_isMutable = true; }
- void removeSheetFromCache(Document*);
+ bool isUsedFromTextCache() const { return m_isUsedFromTextCache; }
+ void setIsUsedFromTextCache() { m_isUsedFromTextCache = true; }
bool isReferencedFromResource() const { return m_referencedFromResource; }
void setReferencedFromResource(CSSStyleSheetResource*);
@@ -186,6 +188,7 @@ private:
bool m_hasFontFaceRule : 1;
bool m_hasMediaQueries : 1;
bool m_hasSingleOwnerDocument : 1;
+ bool m_isUsedFromTextCache : 1;
CSSParserContext m_parserContext;

Powered by Google App Engine
This is Rietveld 408576698