Chromium Code Reviews| Index: webkit/glue/webkitplatformsupport_impl.cc |
| diff --git a/webkit/glue/webkitplatformsupport_impl.cc b/webkit/glue/webkitplatformsupport_impl.cc |
| index f0659d2d1b7ea22fd8f1a1adf8291f0ca298c43c..4f223330bf5000214e3cbc95b4ad68f4cb34a21b 100644 |
| --- a/webkit/glue/webkitplatformsupport_impl.cc |
| +++ b/webkit/glue/webkitplatformsupport_impl.cc |
| @@ -12,6 +12,7 @@ |
| #include <vector> |
| +#include "base/allocator/allocator_extension.h" |
| #include "base/bind.h" |
| #include "base/debug/trace_event.h" |
| #include "base/memory/scoped_ptr.h" |
| @@ -796,6 +797,19 @@ bool WebKitPlatformSupportImpl::processMemorySizesInBytes( |
| return CurrentProcessMetrics()->GetMemoryBytes(private_bytes, shared_bytes); |
| } |
| +bool WebKitPlatformSupportImpl::memoryAllocatorInternalsInBytes(size_t* size) { |
| + size_t heap_size, allocated_bytes, unmapped_bytes; |
| + if (base::allocator::GetProperty("generic.heap_size", &heap_size) && |
|
darin (slow to review)
2012/10/18 18:02:54
nit: Shouldn't there be some named constants for t
alph-g
2012/10/22 12:19:41
Hmm, I don't see any significant benefits of a gen
|
| + base::allocator::GetProperty("generic.current_allocated_bytes", |
| + &allocated_bytes) && |
| + base::allocator::GetProperty("tcmalloc.pageheap_unmapped_bytes", |
| + &unmapped_bytes)) { |
| + *size = heap_size - allocated_bytes - unmapped_bytes; |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| void WebKitPlatformSupportImpl::SuspendSharedTimer() { |
| ++shared_timer_suspended_; |
| } |