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

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

Issue 1989093003: Remove the prefinalizer of Resource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp1985033003
Patch Set: Created 4 years, 7 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.cpp
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
index 42640f3030fefa184c8bc75851df6b6d9a54bd7e..c79583017a736b1fbbab801410603b05f9e01ebe 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
+++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
@@ -62,7 +62,6 @@ StyleSheetContents::StyleSheetContents(StyleRuleImport* ownerRule, const String&
, m_hasSyntacticallyValidCSSHeader(true)
, m_didLoadErrorOccur(false)
, m_isMutable(false)
- , m_isReferencedFromResource(false)
, m_hasFontFaceRule(false)
, m_hasMediaQueries(false)
, m_hasSingleOwnerDocument(true)
@@ -81,7 +80,6 @@ StyleSheetContents::StyleSheetContents(const StyleSheetContents& o)
, m_hasSyntacticallyValidCSSHeader(o.m_hasSyntacticallyValidCSSHeader)
, m_didLoadErrorOccur(false)
, m_isMutable(false)
- , m_isReferencedFromResource(false)
, m_hasFontFaceRule(o.m_hasFontFaceRule)
, m_hasMediaQueries(o.m_hasMediaQueries)
, m_hasSingleOwnerDocument(true)
@@ -586,11 +584,19 @@ void StyleSheetContents::removeSheetFromCache(Document* document)
document->styleEngine().removeSheet(this);
}
-void StyleSheetContents::setReferencedFromResource(bool referenced)
+void StyleSheetContents::setReferencedFromResource(CSSStyleSheetResource* resource)
{
- ASSERT(referenced != m_isReferencedFromResource);
- ASSERT(isCacheableForResource());
- m_isReferencedFromResource = referenced;
+ DCHECK(resource);
+ DCHECK(!isReferencedFromResource());
+ DCHECK(isCacheableForResource());
+ m_referencedFromResource = resource;
+}
+
+void StyleSheetContents::clearReferencedFromResource()
+{
+ DCHECK(isReferencedFromResource());
+ DCHECK(isCacheableForResource());
+ m_referencedFromResource = nullptr;
}
RuleSet& StyleSheetContents::ensureRuleSet(const MediaQueryEvaluator& medium, AddRuleFlags addRuleFlags)
@@ -679,6 +685,7 @@ DEFINE_TRACE(StyleSheetContents)
visitor->trace(m_loadingClients);
visitor->trace(m_completedClients);
visitor->trace(m_ruleSet);
+ visitor->trace(m_referencedFromResource);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/StyleSheetContents.h ('k') | third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698