Chromium Code Reviews| Index: base/memory/shared_memory_posix.cc |
| diff --git a/base/memory/shared_memory_posix.cc b/base/memory/shared_memory_posix.cc |
| index 783bdfce86cd13eec8c133ca36fdeeb419dfabab..b3de60f8c350021933b5f13b5105d71bc56e1f74 100644 |
| --- a/base/memory/shared_memory_posix.cc |
| +++ b/base/memory/shared_memory_posix.cc |
| @@ -14,6 +14,7 @@ |
| #include "base/files/file_util.h" |
| #include "base/files/scoped_file.h" |
| #include "base/logging.h" |
| +#include "base/memory/shared_memory_dump_provider.h" |
| #include "base/posix/eintr_wrapper.h" |
| #include "base/posix/safe_strerror.h" |
| #include "base/process/process_metrics.h" |
| @@ -358,6 +359,7 @@ bool SharedMemory::MapAt(off_t offset, size_t bytes) { |
| mapped_size_ = bytes; |
| DCHECK_EQ(0U, reinterpret_cast<uintptr_t>(memory_) & |
| (SharedMemory::MAP_MINIMUM_ALIGNMENT - 1)); |
| + SharedMemoryDumpProvider::GetInstance()->IncrementMemoryUsage(mapped_size_); |
|
haraken
2016/11/30 04:39:26
We want to get not only the mmaped size but also t
|
| } else { |
| memory_ = NULL; |
| } |
| @@ -370,6 +372,7 @@ bool SharedMemory::Unmap() { |
| return false; |
| munmap(memory_, mapped_size_); |
| + SharedMemoryDumpProvider::GetInstance()->DecrementMemoryUsage(mapped_size_); |
| memory_ = NULL; |
| mapped_size_ = 0; |
| return true; |