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

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: Fix nits 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..50b74cf98df65c427ffd1d28cb4113bd63cffed2 100644
--- a/third_party/WebKit/Source/core/html/CollectionItemsCache.h
+++ b/third_party/WebKit/Source/core/html/CollectionItemsCache.h
@@ -34,7 +34,6 @@
#include "core/html/CollectionIndexCache.h"
#include "wtf/Vector.h"
-#include <v8.h>
namespace blink {
@@ -59,12 +58,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 +71,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 +91,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;
« no previous file with comments | « third_party/WebKit/Source/core/dom/StaticNodeList.h ('k') | third_party/WebKit/Source/platform/heap/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698