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

Unified Diff: content/common/host_discardable_shared_memory_manager.cc

Issue 1398163003: Handle EAGAIN error for the mincore syscall used (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resident
Patch Set: Rebase. Created 5 years, 2 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: 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)
}
« base/trace_event/process_memory_dump.cc ('K') | « base/trace_event/process_memory_dump_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698