Index: third_party/WebKit/Source/core/fetch/Resource.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp |
index 46a06cd63061565546509cb35eba678139840d3e..797293a9237202c027308a2c090d1bc15d54068d 100644 |
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp |
@@ -304,6 +304,7 @@ Resource::Resource(const ResourceRequest& request, |
: m_loadFinishTime(0), |
m_identifier(0), |
m_encodedSize(0), |
+ m_encodedSizeMemoryUsage(0), |
m_decodedSize(0), |
m_overheadSize(calculateOverheadSize()), |
m_preloadCount(0), |
@@ -793,13 +794,18 @@ void Resource::setDecodedSize(size_t decodedSize) { |
} |
void Resource::setEncodedSize(size_t encodedSize) { |
- if (encodedSize == m_encodedSize) |
+ if (encodedSize == m_encodedSize && encodedSize == m_encodedSizeMemoryUsage) |
return; |
size_t oldSize = size(); |
m_encodedSize = encodedSize; |
+ m_encodedSizeMemoryUsage = encodedSize; |
memoryCache()->update(this, oldSize, size()); |
} |
+void Resource::setEncodedSizeMemoryUsage(size_t encodedSize) { |
+ m_encodedSizeMemoryUsage = encodedSize; |
+} |
+ |
void Resource::didAccessDecodedData() { |
memoryCache()->updateDecodedResource(this, UpdateForAccess); |
memoryCache()->prune(); |
@@ -861,11 +867,11 @@ void Resource::onMemoryDump(WebMemoryDumpLevelOfDetail levelOfDetail, |
const String dumpName = getMemoryDumpName(); |
WebMemoryAllocatorDump* dump = |
memoryDump->createMemoryAllocatorDump(dumpName); |
- dump->addScalar("encoded_size", "bytes", m_encodedSize); |
+ dump->addScalar("encoded_size", "bytes", m_encodedSizeMemoryUsage); |
if (hasClientsOrObservers()) |
- dump->addScalar("live_size", "bytes", m_encodedSize); |
+ dump->addScalar("live_size", "bytes", m_encodedSizeMemoryUsage); |
else |
- dump->addScalar("dead_size", "bytes", m_encodedSize); |
+ dump->addScalar("dead_size", "bytes", m_encodedSizeMemoryUsage); |
if (m_data) |
m_data->onMemoryDump(dumpName, memoryDump); |