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

Unified Diff: sky/engine/core/css/resolver/MatchedPropertiesCache.cpp

Issue 681963002: Remove heap/*.cpp files (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « sky/engine/core/css/resolver/MatchedPropertiesCache.h ('k') | sky/engine/core/loader/ImageLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/resolver/MatchedPropertiesCache.cpp
diff --git a/sky/engine/core/css/resolver/MatchedPropertiesCache.cpp b/sky/engine/core/css/resolver/MatchedPropertiesCache.cpp
index 83642357365208a5c76679bb6d29918822e7aa87..eaf7b9f09f4f59f375be30805c7e89ef1385d5c6 100644
--- a/sky/engine/core/css/resolver/MatchedPropertiesCache.cpp
+++ b/sky/engine/core/css/resolver/MatchedPropertiesCache.cpp
@@ -35,34 +35,6 @@
namespace blink {
-#if ENABLE(OILPAN)
-bool CachedMatchedPropertiesHashTraits::traceInCollection(Visitor* visitor, Member<CachedMatchedProperties>& cachedProperties, WTF::ShouldWeakPointersBeMarkedStrongly strongify)
-{
- // Only honor the cache's weakness semantics if the collection is traced
- // with WeakPointersActWeak. Otherwise just trace the cachedProperties
- // strongly, ie. call trace on it.
- if (cachedProperties && strongify == WTF::WeakPointersActWeak) {
- // A given cache entry is only kept alive if none of the MatchedProperties
- // in the CachedMatchedProperties value contain a dead "properties" field.
- // If there is a dead field the entire cache entry is removed.
- HeapVector<MatchedProperties>::iterator it = cachedProperties->matchedProperties.begin();
- HeapVector<MatchedProperties>::iterator end = cachedProperties->matchedProperties.end();
- for (; it != end; ++it) {
- if (!visitor->isAlive(it->properties)) {
- // For now report the cache entry as dead. This might not
- // be the final result if in a subsequent call for this entry,
- // the "properties" field has been marked via another path.
- return true;
- }
- }
- }
- // At this point none of the entries in the matchedProperties vector
- // had a dead "properties" field so trace CachedMatchedProperties strongly.
- visitor->trace(cachedProperties);
- return false;
-}
-#endif
-
void CachedMatchedProperties::set(const RenderStyle* style, const RenderStyle* parentStyle, const MatchResult& matchResult)
{
matchedProperties.appendVector(matchResult.matchedProperties);
@@ -82,10 +54,8 @@ void CachedMatchedProperties::clear()
}
MatchedPropertiesCache::MatchedPropertiesCache()
-#if !ENABLE(OILPAN)
: m_additionsSinceLastSweep(0)
, m_sweepTimer(this, &MatchedPropertiesCache::sweep)
-#endif
{
}
@@ -113,14 +83,12 @@ const CachedMatchedProperties* MatchedPropertiesCache::find(unsigned hash, const
void MatchedPropertiesCache::add(const RenderStyle* style, const RenderStyle* parentStyle, unsigned hash, const MatchResult& matchResult)
{
-#if !ENABLE(OILPAN)
static const unsigned maxAdditionsBetweenSweeps = 100;
if (++m_additionsSinceLastSweep >= maxAdditionsBetweenSweeps
&& !m_sweepTimer.isActive()) {
static const unsigned sweepTimeInSeconds = 60;
m_sweepTimer.startOneShot(sweepTimeInSeconds, FROM_HERE);
}
-#endif
ASSERT(hash);
Cache::AddResult addResult = m_cache.add(hash, nullptr);
@@ -150,7 +118,6 @@ void MatchedPropertiesCache::clearViewportDependent()
m_cache.removeAll(toRemove);
}
-#if !ENABLE(OILPAN)
void MatchedPropertiesCache::sweep(Timer<MatchedPropertiesCache>*)
{
// FIXME(sky): Do we still need this now that we removed PresentationAttributeStyle?
@@ -170,7 +137,6 @@ void MatchedPropertiesCache::sweep(Timer<MatchedPropertiesCache>*)
m_cache.removeAll(toRemove);
m_additionsSinceLastSweep = 0;
}
-#endif
bool MatchedPropertiesCache::isCacheable(const Element* element, const RenderStyle* style, const RenderStyle* parentStyle)
{
@@ -193,9 +159,6 @@ bool MatchedPropertiesCache::isCacheable(const Element* element, const RenderSty
void MatchedPropertiesCache::trace(Visitor* visitor)
{
-#if ENABLE(OILPAN)
- visitor->trace(m_cache);
-#endif
}
}
« no previous file with comments | « sky/engine/core/css/resolver/MatchedPropertiesCache.h ('k') | sky/engine/core/loader/ImageLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698