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

Unified Diff: third_party/WebKit/Source/core/html/CollectionItemsCache.h

Issue 1670463002: [Oilpan] Unify memory usage reporters of Oilpan (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up Created 4 years, 10 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/html/CollectionItemsCache.h
diff --git a/third_party/WebKit/Source/core/html/CollectionItemsCache.h b/third_party/WebKit/Source/core/html/CollectionItemsCache.h
index f288ce7990c8e6bba835bf8e4b4b4b559cd28b21..b1fe8b70622b04b36c4ccb7e287cde52b678d1c8 100644
--- a/third_party/WebKit/Source/core/html/CollectionItemsCache.h
+++ b/third_party/WebKit/Source/core/html/CollectionItemsCache.h
@@ -59,12 +59,6 @@ public:
void invalidate();
private:
- ptrdiff_t allocationSize() const { return m_cachedList.capacity() * sizeof(NodeType*); }
- static void reportExtraMemoryCostForCollectionItemsCache(ptrdiff_t diff)
- {
- v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(diff);
- }
-
bool m_listValid;
WillBeHeapVector<RawPtrWillBeMember<NodeType>> m_cachedList;
};
@@ -78,8 +72,6 @@ CollectionItemsCache<Collection, NodeType>::CollectionItemsCache()
template <typename Collection, typename NodeType>
CollectionItemsCache<Collection, NodeType>::~CollectionItemsCache()
{
- if (ptrdiff_t diff = allocationSize())
- reportExtraMemoryCostForCollectionItemsCache(-diff);
}
template <typename Collection, typename NodeType>
@@ -100,13 +92,10 @@ unsigned CollectionItemsCache<Collection, NodeType>::nodeCount(const Collection&
NodeType* currentNode = collection.traverseToFirst();
unsigned currentIndex = 0;
- ptrdiff_t oldCapacity = allocationSize();
while (currentNode) {
m_cachedList.append(currentNode);
currentNode = collection.traverseForwardToOffset(currentIndex + 1, *currentNode, currentIndex);
}
- if (ptrdiff_t diff = allocationSize() - oldCapacity)
- reportExtraMemoryCostForCollectionItemsCache(diff);
this->setCachedNodeCount(m_cachedList.size());
m_listValid = true;

Powered by Google App Engine
This is Rietveld 408576698