Index: base/memory/shared_memory_mac.cc |
diff --git a/base/memory/shared_memory_mac.cc b/base/memory/shared_memory_mac.cc |
index 8237b44411ca34cd5913d58d699398fad4f0f8cf..8eae811a1085e3d2b11330c7761a3aed2cd4af21 100644 |
--- a/base/memory/shared_memory_mac.cc |
+++ b/base/memory/shared_memory_mac.cc |
@@ -17,6 +17,7 @@ |
#include "base/mac/mac_util.h" |
#include "base/mac/scoped_mach_vm.h" |
#include "base/memory/shared_memory_helper.h" |
+#include "base/memory/shared_memory_tracker.h" |
#include "base/metrics/field_trial.h" |
#include "base/metrics/histogram_macros.h" |
#include "base/posix/eintr_wrapper.h" |
@@ -205,6 +206,7 @@ bool SharedMemory::MapAt(off_t offset, size_t bytes) { |
DCHECK_EQ(0U, reinterpret_cast<uintptr_t>(memory_) & |
(SharedMemory::MAP_MINIMUM_ALIGNMENT - 1)); |
mapped_memory_mechanism_ = shm_.type_; |
+ SharedMemoryTracker::GetInstance()->IncrementMemoryUsage(*this); |
} else { |
last_error_ = SharedMemoryError::MMAP_FAILED; |
memory_ = NULL; |
@@ -227,7 +229,7 @@ bool SharedMemory::Unmap() { |
mapped_size_); |
break; |
} |
- |
+ SharedMemoryTracker::GetInstance()->DecrementMemoryUsage(*this); |
memory_ = NULL; |
mapped_size_ = 0; |
return true; |