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

Unified Diff: third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp

Issue 1609423002: Adjust heap profiler integration for ContiguousContainer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/platform/graphics/ContiguousContainer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
index 6cec28724a00253d939b1fa47e0521e410991c77..ba3d5d39ef5637fc9f39bb119c5d02bb85800051 100644
--- a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
@@ -21,7 +21,7 @@ class ContiguousContainerBase::Buffer {
WTF_MAKE_NONCOPYABLE(Buffer);
USING_FAST_MALLOC(Buffer);
public:
- explicit Buffer(size_t bufferSize, const char* typeName)
+ Buffer(size_t bufferSize, const char* typeName)
{
m_capacity = WTF::Partitions::bufferActualSize(bufferSize);
m_begin = m_end = static_cast<char*>(
@@ -65,19 +65,12 @@ private:
size_t m_capacity;
};
-ContiguousContainerBase::ContiguousContainerBase(size_t maxObjectSize, const char* typeName)
+ContiguousContainerBase::ContiguousContainerBase(size_t maxObjectSize)
: m_endIndex(0)
, m_maxObjectSize(maxObjectSize)
{
}
-ContiguousContainerBase::ContiguousContainerBase(
- size_t maxObjectSize, size_t initialSizeBytes, const char* typeName)
- : ContiguousContainerBase(maxObjectSize, typeName)
-{
- allocateNewBufferForNextAllocation(std::max(maxObjectSize, initialSizeBytes), typeName);
-}
-
ContiguousContainerBase::~ContiguousContainerBase()
{
}
@@ -104,6 +97,11 @@ size_t ContiguousContainerBase::memoryUsageInBytes() const
+ m_elements.capacity() * sizeof(m_elements[0]);
}
+void ContiguousContainerBase::reserveInitialCapacity(size_t bufferSize, const char* typeName)
+{
+ allocateNewBufferForNextAllocation(bufferSize, typeName);
+}
+
void* ContiguousContainerBase::allocate(size_t objectSize, const char* typeName)
{
ASSERT(objectSize <= m_maxObjectSize);

Powered by Google App Engine
This is Rietveld 408576698