Chromium Code Reviews| Index: content/common/host_discardable_shared_memory_manager.cc |
| diff --git a/content/common/host_discardable_shared_memory_manager.cc b/content/common/host_discardable_shared_memory_manager.cc |
| index 90eee02594c38a9629b84a443c3ed0076ba2c9e2..1568376993f52b0aa66275ed8fa5803648889bbf 100644 |
| --- a/content/common/host_discardable_shared_memory_manager.cc |
| +++ b/content/common/host_discardable_shared_memory_manager.cc |
| @@ -210,16 +210,20 @@ bool HostDiscardableSharedMemoryManager::OnMemoryDump( |
| #if defined(COUNT_RESIDENT_BYTES_SUPPORTED) |
| if (args.level_of_detail == |
| base::trace_event::MemoryDumpLevelOfDetail::DETAILED) { |
| - size_t resident_size = |
| - base::trace_event::ProcessMemoryDump::CountResidentBytes( |
| - segment->memory()->memory(), segment->memory()->mapped_size()); |
| + size_t resident_size; |
| // This is added to the global dump since it has to be attributed to |
| // both the allocator dumps involved. |
| - pmd->GetSharedGlobalAllocatorDump(shared_segment_guid) |
| - ->AddScalar("resident_size", |
| - base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| - static_cast<uint64>(resident_size)); |
| + if (base::trace_event::ProcessMemoryDump::CountResidentBytes( |
| + segment->memory()->memory(), segment->memory()->mapped_size(), |
| + &resident_size)) { |
| + pmd->GetSharedGlobalAllocatorDump(shared_segment_guid) |
| + ->AddScalar("resident_size", |
| + base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| + static_cast<uint64>(resident_size)); |
| + } else { |
| + NOTREACHED(); |
|
reveman
2015/10/14 12:31:29
please
bool rv = base::trace_event::ProcessMemory
ssid
2015/10/14 12:44:29
In general it should not fail. What I want is in r
reveman
2015/10/14 13:03:53
ok, sounds good. I don't like when NOTREACHED/DCHE
ssid
2015/10/14 13:35:55
Done.
|
| + } |
| } |
| #endif // defined(COUNT_RESIDENT_BYTES_SUPPORTED) |
| } |