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

Unified Diff: webkit/glue/webkitplatformsupport_impl.cc

Issue 10823205: Report memory retained by memory allocator internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed the API function. Created 8 years, 3 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
« no previous file with comments | « webkit/glue/webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
}
« no previous file with comments | « webkit/glue/webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698