Chromium Code Reviews| Index: third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp |
| diff --git a/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp b/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp |
| index d269b2935139513e1d1452d0d4f7d7aa39f788ba..d57fc845309bdf8da4bb5b969b77d049961e6c47 100644 |
| --- a/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp |
| +++ b/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp |
| @@ -112,17 +112,20 @@ bool PartitionAllocMemoryDumpProvider::onMemoryDump(WebMemoryDumpLevelOfDetail l |
| if (m_isHeapProfilingEnabled) { |
| // Overhead should always be reported, regardless of light vs. heavy. |
| base::trace_event::TraceEventMemoryOverhead overhead; |
| - base::hash_map<base::trace_event::AllocationContext, size_t> bytesByContext; |
| + base::hash_map<base::trace_event::AllocationContext, base::trace_event::AllocationMetrics> metricsByContext; |
|
Maria
2016/04/14 20:11:34
not sure about blink style, but is this a long lin
ssid
2016/04/14 20:17:11
yes, long lines are allowed in blink.
|
| { |
| MutexLocker locker(m_allocationRegisterMutex); |
| // Dump only the overhead estimation in non-detailed dumps. |
| if (levelOfDetail == WebMemoryDumpLevelOfDetail::Detailed) { |
| - for (const auto& allocSize : *m_allocationRegister) |
| - bytesByContext[allocSize.context] += allocSize.size; |
| + for (const auto& allocSize : *m_allocationRegister) { |
| + auto metrics& = metricsByContext[alloc_size.context]; |
| + metrics.size += alloc_size.size; |
| + metrics.count++; |
| + } |
| } |
| m_allocationRegister->EstimateTraceMemoryOverhead(&overhead); |
| } |
| - memoryDump->dumpHeapUsage(bytesByContext, overhead, "partition_alloc"); |
| + memoryDump->dumpHeapUsage(metricsByContext, overhead, "partition_alloc"); |
| } |
| PartitionStatsDumperImpl partitionStatsDumper(memoryDump, levelOfDetail); |