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

Unified Diff: Source/core/dom/StyleEngine.cpp

Issue 211073002: [Oilpan]: Move CSSFontSelectorClient to the oilpan heap using transition types. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adding StyleEngine.cpp change (forgot to upload diff again with WTF change) Created 6 years, 9 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: Source/core/dom/StyleEngine.cpp
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp
index 223d67de858fa0e6f5193bc5af6420577499c883..df6bd126897ccb901adedf05507471cd3258400f 100644
--- a/Source/core/dom/StyleEngine.cpp
+++ b/Source/core/dom/StyleEngine.cpp
@@ -90,8 +90,10 @@ void StyleEngine::detachFromDocument()
if (m_fontSelector) {
m_fontSelector->clearDocument();
+#if !ENABLE(OILPAN)
if (m_resolver)
m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get());
+#endif
}
// Decrement reference counts for things we could be keeping alive.
@@ -447,7 +449,7 @@ void StyleEngine::createResolver()
ASSERT(m_document.frame());
ASSERT(m_fontSelector);
- m_resolver = adoptPtr(new StyleResolver(m_document));
+ m_resolver = adoptPtrWillBeNoop(new StyleResolver(m_document));
appendActiveAuthorStyleSheets();
m_fontSelector->registerForInvalidationCallbacks(m_resolver.get());
combineCSSFeatureFlags(m_resolver->ensureUpdatedRuleFeatureSet());
@@ -460,7 +462,9 @@ void StyleEngine::clearResolver()
ASSERT(m_fontSelector || !m_resolver);
if (m_resolver) {
m_document.updateStyleInvalidationIfNeeded();
+#if !ENABLE(OILPAN)
m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get());
+#endif
}
m_resolver.clear();
}
@@ -585,7 +589,7 @@ PassRefPtrWillBeRawPtr<CSSStyleSheet> StyleEngine::createSheet(Element* e, const
if (!e->document().inQuirksMode()) {
AtomicString textContent(text);
- HashMap<AtomicString, StyleSheetContents*>::AddResult result = m_textToSheetCache.add(textContent, 0);
+ WillBeHeapHashMap<AtomicString, RawPtrWillBeMember<StyleSheetContents> >::AddResult result = m_textToSheetCache.add(textContent, nullptr);
if (result.isNewEntry || !result.storedValue->value) {
styleSheet = StyleEngine::parseSheet(e, text, startPosition, createdByParser);
if (result.isNewEntry && isCacheableForStyleElement(*styleSheet->contents())) {
@@ -619,7 +623,7 @@ PassRefPtrWillBeRawPtr<CSSStyleSheet> StyleEngine::parseSheet(Element* e, const
void StyleEngine::removeSheet(StyleSheetContents* contents)
{
- HashMap<StyleSheetContents*, AtomicString>::iterator it = m_sheetToTextCache.find(contents);
+ WillBeHeapHashMap<RawPtrWillBeMember<StyleSheetContents>, AtomicString>::iterator it = m_sheetToTextCache.find(contents);
if (it == m_sheetToTextCache.end())
return;
@@ -633,6 +637,9 @@ void StyleEngine::trace(Visitor* visitor)
visitor->trace(m_authorStyleSheets);
visitor->trace(m_documentStyleSheetCollection);
visitor->trace(m_styleSheetCollectionMap);
+ visitor->trace(m_resolver);
+ visitor->trace(m_textToSheetCache);
+ visitor->trace(m_sheetToTextCache);
}
}

Powered by Google App Engine
This is Rietveld 408576698