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

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

Issue 196513007: Oilpan: Reapply: Remove all the RefPtrs and most of the raw pointers to style (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix assertion for global persistents 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
« no previous file with comments | « Source/core/dom/StyleEngine.h ('k') | Source/core/dom/StyleSheetCollection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/StyleEngine.cpp
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp
index 3943305ebf108caf542c031dac82ced750bf351c..65ed280169245b6df8811c6e0c8bccecdd1dbd00 100644
--- a/Source/core/dom/StyleEngine.cpp
+++ b/Source/core/dom/StyleEngine.cpp
@@ -143,9 +143,9 @@ TreeScopeStyleSheetCollection* StyleEngine::ensureStyleSheetCollectionFor(TreeSc
if (treeScope == m_document)
return &m_documentStyleSheetCollection;
- HashMap<TreeScope*, OwnPtr<TreeScopeStyleSheetCollection> >::AddResult result = m_styleSheetCollectionMap.add(&treeScope, nullptr);
+ WillBeHeapHashMap<TreeScope*, OwnPtrWillBeMember<ShadowTreeStyleSheetCollection> >::AddResult result = m_styleSheetCollectionMap.add(&treeScope, nullptr);
if (result.isNewEntry)
- result.storedValue->value = adoptPtr(new ShadowTreeStyleSheetCollection(toShadowRoot(treeScope)));
+ result.storedValue->value = adoptPtrWillBeNoop(new ShadowTreeStyleSheetCollection(toShadowRoot(treeScope)));
return result.storedValue->value.get();
}
@@ -154,7 +154,7 @@ TreeScopeStyleSheetCollection* StyleEngine::styleSheetCollectionFor(TreeScope& t
if (treeScope == m_document)
return &m_documentStyleSheetCollection;
- HashMap<TreeScope*, OwnPtr<TreeScopeStyleSheetCollection> >::iterator it = m_styleSheetCollectionMap.find(&treeScope);
+ WillBeHeapHashMap<TreeScope*, OwnPtrWillBeMember<ShadowTreeStyleSheetCollection> >::iterator it = m_styleSheetCollectionMap.find(&treeScope);
if (it == m_styleSheetCollectionMap.end())
return 0;
return it->value.get();
@@ -562,9 +562,9 @@ void StyleEngine::markDocumentDirty()
m_document.import()->master()->styleEngine()->markDocumentDirty();
}
-PassRefPtr<CSSStyleSheet> StyleEngine::createSheet(Element* e, const String& text, TextPosition startPosition, bool createdByParser)
+PassRefPtrWillBeRawPtr<CSSStyleSheet> StyleEngine::createSheet(Element* e, const String& text, TextPosition startPosition, bool createdByParser)
{
- RefPtr<CSSStyleSheet> styleSheet;
+ RefPtrWillBeRawPtr<CSSStyleSheet> styleSheet;
e->document().styleEngine()->addPendingSheet();
@@ -593,9 +593,9 @@ PassRefPtr<CSSStyleSheet> StyleEngine::createSheet(Element* e, const String& tex
return styleSheet;
}
-PassRefPtr<CSSStyleSheet> StyleEngine::parseSheet(Element* e, const String& text, TextPosition startPosition, bool createdByParser)
+PassRefPtrWillBeRawPtr<CSSStyleSheet> StyleEngine::parseSheet(Element* e, const String& text, TextPosition startPosition, bool createdByParser)
{
- RefPtr<CSSStyleSheet> styleSheet;
+ RefPtrWillBeRawPtr<CSSStyleSheet> styleSheet;
styleSheet = CSSStyleSheet::createInline(e, KURL(), startPosition, e->document().inputEncoding());
styleSheet->contents()->parseStringAtPosition(text, startPosition, createdByParser);
return styleSheet;
@@ -615,6 +615,8 @@ void StyleEngine::trace(Visitor* visitor)
{
visitor->trace(m_injectedAuthorStyleSheets);
visitor->trace(m_authorStyleSheets);
+ visitor->trace(m_documentStyleSheetCollection);
+ visitor->trace(m_styleSheetCollectionMap);
}
}
« no previous file with comments | « Source/core/dom/StyleEngine.h ('k') | Source/core/dom/StyleSheetCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698